This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/tests/actions/vstudio/vc2010/test_platform_toolset.lua
Jason Perkins 32183f039f Modify toolset() to accept an option version number.
toolset("gcc")   -- specifies GCC with no specific version
toolset("gcc-4.8")   -- GCC version 4.8
toolset("msc-100")  -- MSC with platform toolset v100
toolset("v100")  -- same as above
2015-04-28 18:50:56 -04:00

89 lines
1.5 KiB
Lua

--
-- tests/actions/vstudio/vc2010/test_platform_toolset.lua
-- Validate VC platform toolset generation.
-- Copyright (c) 2013-2015 Jason Perkins and the Premake project
--
local suite = test.declare("vstudio_vs2010_platform_toolset")
local vc2010 = premake.vstudio.vc2010
--
-- Setup
--
local sln, prj
function suite.setup()
_ACTION = "vs2012"
sln, prj = test.createsolution()
files "hello.cpp"
end
local function prepare()
cfg = test.getconfig(prj, "Debug")
vc2010.platformToolset(cfg)
end
--
-- Check default values for each version.
--
function suite.correctDefault_onVS2010()
_ACTION = "vs2010"
prepare()
test.isemptycapture()
end
function suite.correctDefault_onVS2012()
_ACTION = "vs2012"
prepare()
test.capture [[
<PlatformToolset>v110</PlatformToolset>
]]
end
function suite.correctDefault_onVS2013()
_ACTION = "vs2013"
prepare()
test.capture [[
<PlatformToolset>v120</PlatformToolset>
]]
end
--
-- Element should only be written if C++ files are present.
--
function suite.empty_onNoRelevantSources()
removefiles "hello.cpp"
prepare()
test.isemptycapture()
end
--
-- Check for overrides from project scripts.
--
function suite.canOverrideFromScript_withV()
toolset "v90"
prepare()
test.capture [[
<PlatformToolset>v90</PlatformToolset>
]]
end
function suite.canOverrideFromScript_withMsc()
toolset "msc-100"
prepare()
test.capture [[
<PlatformToolset>v100</PlatformToolset>
]]
end