blob: fad5025a306e760a17c5e5cf4fcb86cdc9ec29fe (
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
|
--
-- tests/actions/vstudio/vc2010/test_pch.lua
-- Validate generation of files block in Visual Studio 2010 C/C++ projects.
-- Copyright (c) 2011 Jason Perkins and the Premake project
--
T.vstudio_vs2010_pch = { }
local suite = T.vstudio_vs2010_pch
local vc2010 = premake.vstudio.vc2010
--
-- 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)
vc2010.files(prj)
end
--
-- Tests
--
function suite.pch_OnProject()
files { "afxwin.cpp" }
pchheader "afxwin.h"
pchsource "afxwin.cpp"
prepare()
test.capture [[
<ItemGroup>
<ClCompile Include="afxwin.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
]]
end
function suite.pch_OnSingleConfig()
files { "afxwin.cpp" }
configuration "Debug"
pchheader "afxwin.h"
pchsource "afxwin.cpp"
prepare()
test.capture [[
<ItemGroup>
<ClCompile Include="afxwin.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
]]
end
|