Welcome to mirror list, hosted at ThFree Co, Russian Federation.

codelite_files.lua « codelite « actions « tests - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 423945c0a863ea6c2438afc762fe3e7a62a48c68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
--
-- tests/actions/codelite/codelite_files.lua
-- Validate generation of files block in CodeLite C/C++ projects.
-- Copyright (c) 2011 Jason Perkins and the Premake project
--

	T.codelite_files = { }
	local suite = T.codelite_files
	local codelite = premake.codelite


--
-- Setup
--

	local sln, prj

	function suite.setup()
		sln = test.createsolution()
	end

	local function prepare()
		io.indent = "  "
		premake.bake.buildconfigs()
		prj = premake.solution.getproject(sln, 1)
		codelite.files(prj)
	end


--
-- Test grouping and nesting
--

	function suite.SimpleSourceFile()
		files { "hello.c" }
		prepare()
		test.capture [[
  <VirtualDirectory Name="MyProject">
    <File Name="hello.c"/>
  </VirtualDirectory>
		]]
	end


	function suite.SingleFolderLevel()
		files { "src/hello.c" }
		prepare()
		test.capture [[
  <VirtualDirectory Name="MyProject">
    <VirtualDirectory Name="src">
      <File Name="src/hello.c"/>
    </VirtualDirectory>
  </VirtualDirectory>
		]]
	end


	function suite.MultipleFolderLevels()
		files { "src/greetings/hello.c" }
		prepare()
		test.capture [[
  <VirtualDirectory Name="MyProject">
    <VirtualDirectory Name="src">
      <VirtualDirectory Name="greetings">
        <File Name="src/greetings/hello.c"/>
      </VirtualDirectory>
    </VirtualDirectory>
  </VirtualDirectory>
		]]
	end