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

test_output_props.lua « vc2010 « vstudio « actions « tests - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 30c6375ac854fad3895831af9b168f7244c1be7d (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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
--
-- tests/actions/vstudio/vc2010/test_output_props.lua
-- Validate generation of the output property groups.
-- Copyright (c) 2011-2013 Jason Perkins and the Premake project
--

	T.vstudio_vs2010_output_props = {}
	local suite = T.vstudio_vs2010_output_props
	local vc2010 = premake.vstudio.vc2010


--
-- Setup
--

	local sln

	function suite.setup()
		_ACTION = "vs2010"
		sln = test.createsolution()
	end

	local function prepare()
		premake.bake.buildconfigs()
		sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
		local prj = premake.solution.getproject(sln, 1)
		vc2010.outputProperties(prj)
	end


--
-- Check the structure with the default project values.
--

	function suite.structureIsCorrect_onDefaultValues()
		prepare()
		test.capture [[
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
		<OutDir>.\</OutDir>
		<IntDir>obj\Debug\</IntDir>
		<TargetName>MyProject</TargetName>
		<TargetExt>.exe</TargetExt>
		<LinkIncremental>true</LinkIncremental>
	</PropertyGroup>
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
		]]
	end


--
-- Static libraries should omit the link incremental element entirely.
--

	function suite.omitLinkIncremental_onStaticLib()
		kind "StaticLib"
		prepare()
		test.capture [[
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
		<OutDir>.\</OutDir>
		<IntDir>obj\Debug\</IntDir>
		<TargetName>MyProject</TargetName>
		<TargetExt>.lib</TargetExt>
	</PropertyGroup>
		]]
	end

--
-- Optimized builds should not link incrementally.
--

	function suite.noIncrementalLink_onOptimizedBuild()
		flags "Optimize"
		prepare()
		test.capture [[
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
		<OutDir>.\</OutDir>
		<IntDir>obj\Debug\</IntDir>
		<TargetName>MyProject</TargetName>
		<TargetExt>.exe</TargetExt>
		<LinkIncremental>false</LinkIncremental>
	</PropertyGroup>
		]]
	end

--
-- The target directory is applied, if specified.
--

	function suite.outDir_onTargetDir()
		targetdir "../bin"
		prepare()
		test.capture [[
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
		<OutDir>..\bin\</OutDir>
		]]
	end

--
-- The objeccts directory is applied, if specified.
--

	function suite.intDir_onTargetDir()
		objdir "../tmp"
		prepare()
		test.capture [[
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
		<OutDir>.\</OutDir>
		<IntDir>..\tmp\Debug\</IntDir>
		]]
	end

--
-- The target name is applied, if specified.
--

	function suite.targetName_onTargetName()
		targetname "MyTarget"
		prepare()
		test.capture [[
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
		<OutDir>.\</OutDir>
		<IntDir>obj\Debug\</IntDir>
		<TargetName>MyTarget</TargetName>
		]]
	end

--
-- A target extension should be used if specified.
--

	function suite.targetExt_onTargetExtension()
		targetextension ".delta"
		prepare()
		test.capture [[
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
		<OutDir>.\</OutDir>
		<IntDir>obj\Debug\</IntDir>
		<TargetName>MyProject</TargetName>
		<TargetExt>.delta</TargetExt>
		]]
	end

--
-- If the NoImportLib flag is set, add the IgnoreImportLibrary element.
--

	function suite.ignoreImportLib_onNoImportLib()
		kind "SharedLib"
		flags "NoImportLib"
		prepare()
		test.capture [[
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
		<OutDir>.\</OutDir>
		<IntDir>obj\Debug\</IntDir>
		<TargetName>MyProject</TargetName>
		<TargetExt>.dll</TargetExt>
		<IgnoreImportLibrary>true</IgnoreImportLibrary>
		]]
	end


--
-- If the NoManifest flag is set, add the GenerateManifest element.
--

	function suite.generateManifest_onNoManifest()
		flags "NoManifest"
		prepare()
		test.capture [[
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
		<OutDir>.\</OutDir>
		<IntDir>obj\Debug\</IntDir>
		<TargetName>MyProject</TargetName>
		<TargetExt>.exe</TargetExt>
		<LinkIncremental>true</LinkIncremental>
		<GenerateManifest>false</GenerateManifest>
	</PropertyGroup>
		]]
	end