2012-11-26 19:05:33 +00:00
|
|
|
--
|
|
|
|
-- tests/actions/vstudio/cs2005/test_platform_groups.lua
|
|
|
|
-- Check creation of per-platform property groups in VS2005+ C# projects.
|
2015-08-20 19:34:23 +00:00
|
|
|
-- Copyright (c) 2009-2015 Jason Perkins and the Premake project
|
2012-11-26 19:05:33 +00:00
|
|
|
--
|
|
|
|
|
2013-11-14 13:52:55 +00:00
|
|
|
local suite = test.declare("vstudio_cs2005_platform_groups")
|
2012-11-26 19:05:33 +00:00
|
|
|
local cs2005 = premake.vstudio.cs2005
|
|
|
|
|
|
|
|
--
|
2013-04-25 20:05:08 +00:00
|
|
|
-- Setup
|
2012-11-26 19:05:33 +00:00
|
|
|
--
|
|
|
|
|
2015-08-20 19:34:23 +00:00
|
|
|
local wks
|
|
|
|
|
2012-11-26 19:05:33 +00:00
|
|
|
function suite.setup()
|
2015-10-14 12:04:22 +00:00
|
|
|
premake.action.set("vs2010")
|
2015-08-30 15:38:35 +00:00
|
|
|
wks = workspace("MyWorkspace")
|
2015-08-20 19:34:23 +00:00
|
|
|
configurations { "Debug", "Release" }
|
|
|
|
language "C#"
|
2012-11-26 19:05:33 +00:00
|
|
|
end
|
2013-04-25 20:05:08 +00:00
|
|
|
|
2012-11-26 19:05:33 +00:00
|
|
|
local function prepare(platform)
|
2015-08-20 19:34:23 +00:00
|
|
|
local prj = project("MyProject")
|
2013-11-14 13:52:55 +00:00
|
|
|
local cfg = test.getconfig(prj, "Debug", platform)
|
2012-11-26 19:05:33 +00:00
|
|
|
cs2005.propertyGroup(cfg)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check defaults.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.vs2008()
|
2015-10-14 12:04:22 +00:00
|
|
|
premake.action.set("vs2008")
|
2012-11-26 19:05:33 +00:00
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2015-08-20 19:34:23 +00:00
|
|
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
2012-11-26 19:05:33 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function suite.vs2010()
|
2015-10-14 12:04:22 +00:00
|
|
|
premake.action.set("vs2010")
|
2012-11-26 19:05:33 +00:00
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2015-08-20 19:34:23 +00:00
|
|
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
|
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
2012-11-26 19:05:33 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check handling of specific architectures.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.vs2008_onAnyCpu()
|
2015-10-14 12:04:22 +00:00
|
|
|
premake.action.set("vs2008")
|
2015-08-20 19:34:23 +00:00
|
|
|
platforms "Any CPU"
|
2012-11-26 19:05:33 +00:00
|
|
|
prepare("Any CPU")
|
|
|
|
test.capture [[
|
2015-08-20 19:34:23 +00:00
|
|
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
2012-11-26 19:05:33 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function suite.vs2010_onAnyCpu()
|
2015-10-14 12:04:22 +00:00
|
|
|
premake.action.set("vs2010")
|
2015-08-20 19:34:23 +00:00
|
|
|
platforms "Any CPU"
|
2012-11-26 19:05:33 +00:00
|
|
|
prepare("Any CPU")
|
|
|
|
test.capture [[
|
2015-08-20 19:34:23 +00:00
|
|
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
|
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
2012-11-26 19:05:33 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2015-04-13 22:27:11 +00:00
|
|
|
function suite.onX86()
|
2015-08-20 19:34:23 +00:00
|
|
|
platforms "x86"
|
2015-04-10 13:02:19 +00:00
|
|
|
prepare("x86")
|
2012-11-26 19:05:33 +00:00
|
|
|
test.capture [[
|
2015-08-20 19:34:23 +00:00
|
|
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
|
|
|
<PlatformTarget>x86</PlatformTarget>
|
2012-11-26 19:05:33 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2015-04-13 22:27:11 +00:00
|
|
|
function suite.onX86_64()
|
2015-08-20 19:34:23 +00:00
|
|
|
platforms "x86_64"
|
2015-04-10 13:02:19 +00:00
|
|
|
prepare("x86_64")
|
2012-11-26 19:05:33 +00:00
|
|
|
test.capture [[
|
2015-08-20 19:34:23 +00:00
|
|
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
|
|
|
<PlatformTarget>x64</PlatformTarget>
|
2012-11-26 19:05:33 +00:00
|
|
|
]]
|
|
|
|
end
|
2015-08-20 19:34:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
function suite.onArbitrary64bitPlatform()
|
|
|
|
platforms "Win64"
|
|
|
|
system "Windows"
|
|
|
|
architecture "x86_64"
|
|
|
|
prepare("Win64")
|
|
|
|
test.capture [[
|
|
|
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug Win64|x64' ">
|
|
|
|
<PlatformTarget>x64</PlatformTarget>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|