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

files.lua « vc200x « vstudio « actions « tests - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: facb17d197515221fd6b803e1ec61129a3ffc31a (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
--
-- tests/actions/vstudio/vc200x/files.lua
-- Validate generation of <files/> block in Visual Studio 200x projects.
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
--

	T.vstudio_vs200x_files = { }
	local suite = T.vstudio_vs200x_files
	local vc200x = premake.vstudio.vc200x


--
-- Setup 
--

	local sln, prj
	
	function suite.setup()
		sln = test.createsolution()
	end
	
	local function prepare()
		premake.bake.buildconfigs()
		prj = premake.solution.getproject(sln, 1)
		sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
		vc200x.Files(prj)
	end


--
-- Test grouping and nesting
--

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

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

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


--
-- PCH support
--

	function suite.OnPCH_OnWindows()
		files { "afxwin.cpp" }
		pchsource "afxwin.cpp"
		prepare()
		test.capture [[
		<File
			RelativePath="afxwin.cpp"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					UsePrecompiledHeader="1"
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					UsePrecompiledHeader="1"
				/>
			</FileConfiguration>
		</File>
		]]
	end
	
	function suite.Files_OnPCH_OnXbox360()
		files { "afxwin.cpp" }
		pchsource "afxwin.cpp"
		platforms { "Xbox360" }
		prepare()
		test.capture [[
		<File
			RelativePath="afxwin.cpp"
			>
			<FileConfiguration
				Name="Debug|Xbox 360"
				>
				<Tool
					Name="VCCLX360CompilerTool"
					UsePrecompiledHeader="1"
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Xbox 360"
				>
				<Tool
					Name="VCCLX360CompilerTool"
					UsePrecompiledHeader="1"
				/>
			</FileConfiguration>
		</File>
		]]
	end