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

codeblocks_files.lua « codeblocks « actions « tests - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 34945f3da1d2d42b636f84bfe95d1b9e7c728729 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
--
-- tests/actions/codeblocks/codeblocks_files.lua
-- Validate generation of files block in CodeLite C/C++ projects.
-- Copyright (c) 2011 Jason Perkins and the Premake project
--

	T.codeblocks_files = { }
	local suite = T.codeblocks_files
	local codeblocks = premake.codeblocks


--
-- Setup 
--

	local sln, prj
	
	function suite.setup()
		sln = test.createsolution()
	end
	
	local function prepare()
		premake.bake.buildconfigs()
		prj = premake.solution.getproject(sln, 1)
		codeblocks.files(prj)
	end


--
-- Test grouping and nesting
--

	function suite.SimpleSourceFile()
		files { "hello.cpp" }
		prepare()
		test.capture [[
		<Unit filename="hello.cpp">
		</Unit>
		]]
	end


	function suite.SingleFolderLevel()
		files { "src/hello.cpp" }
		prepare()
		test.capture [[
		<Unit filename="src/hello.cpp">
		</Unit>
		]]
	end


	function suite.MultipleFolderLevels()
		files { "src/greetings/hello.cpp" }
		prepare()
		test.capture [[
		<Unit filename="src/greetings/hello.cpp">
		</Unit>
		]]
	end
	

--
-- Test source file type handling
--

	function suite.CFileInCppProject()
		files { "hello.c" }
		prepare()
		test.capture [[
		<Unit filename="hello.c">
			<Option compilerVar="CC" />
		</Unit>
		]]
	end


	function suite.WindowsResourceFile()
		files { "hello.rc" }
		prepare()
		test.capture [[
		<Unit filename="hello.rc">
			<Option compilerVar="WINDRES" />
		</Unit>
		]]
	end


	function suite.PchFile()
		files { "hello.h" }
		pchheader "hello.h"
		prepare()
		test.capture [[
		<Unit filename="hello.h">
			<Option compilerVar="CPP" />
			<Option compile="1" />
			<Option weight="0" />
			<Add option="-x c++-header" />
		</Unit>
		]]
	end