2012-01-04 22:16:06 +00:00
|
|
|
--
|
|
|
|
-- tests/actions/vstudio/vc200x/test_platforms.lua
|
|
|
|
-- Test the Visual Studio 2002-2008 project's Platforms block
|
|
|
|
-- Copyright (c) 2009-2012 Jason Perkins and the Premake project
|
|
|
|
--
|
|
|
|
|
|
|
|
T.vstudio_vc200x_platforms = { }
|
|
|
|
local suite = T.vstudio_vc200x_platforms
|
|
|
|
local vc200x = premake.vstudio.vc200x
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Setup
|
|
|
|
--
|
|
|
|
|
|
|
|
local sln, prj
|
|
|
|
|
|
|
|
function suite.setup()
|
|
|
|
_ACTION = "vs2008"
|
2012-02-19 17:31:20 +00:00
|
|
|
sln = test.createsolution()
|
2012-01-04 22:16:06 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
local function prepare()
|
2013-09-13 15:52:00 +00:00
|
|
|
prj = premake.solution.getproject(sln, 1)
|
2012-01-04 22:16:06 +00:00
|
|
|
vc200x.platforms(prj)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- If no architectures are specified, Win32 should be the default.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.win32Listed_onNoPlatforms()
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2012-01-18 00:04:46 +00:00
|
|
|
<Platforms>
|
|
|
|
<Platform
|
|
|
|
Name="Win32"
|
|
|
|
/>
|
|
|
|
</Platforms>
|
2012-01-04 22:16:06 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- If multiple configurations use the same architecture, it should
|
|
|
|
-- still only be listed once.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.architectureListedOnlyOnce_onMultipleConfigurations()
|
|
|
|
platforms { "Static", "Dynamic" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2012-01-18 00:04:46 +00:00
|
|
|
<Platforms>
|
|
|
|
<Platform
|
|
|
|
Name="Win32"
|
|
|
|
/>
|
|
|
|
</Platforms>
|
2012-01-04 22:16:06 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- If multiple architectures are used, they should all be listed.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.allArchitecturesListed_onMultipleArchitectures()
|
|
|
|
platforms { "x32", "x64" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2012-01-18 00:04:46 +00:00
|
|
|
<Platforms>
|
|
|
|
<Platform
|
|
|
|
Name="Win32"
|
|
|
|
/>
|
|
|
|
<Platform
|
|
|
|
Name="x64"
|
|
|
|
/>
|
|
|
|
</Platforms>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify the PS3 platform.
|
|
|
|
--
|
|
|
|
|
2012-01-27 01:40:39 +00:00
|
|
|
function suite.platformIsCorrect_onPS3()
|
|
|
|
platforms { "PS3" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Platforms>
|
|
|
|
<Platform
|
|
|
|
Name="Win32"
|
|
|
|
/>
|
|
|
|
</Platforms>
|
|
|
|
]]
|
|
|
|
end
|
2012-01-18 00:04:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify the Xbox360 platform.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.platformIsCorrect_onXbox360()
|
|
|
|
platforms { "Xbox360" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Platforms>
|
|
|
|
<Platform
|
|
|
|
Name="Xbox 360"
|
|
|
|
/>
|
|
|
|
</Platforms>
|
|
|
|
]]
|
2012-01-04 22:16:06 +00:00
|
|
|
end
|