--
-- 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 wks, prj
function suite.setup()
_ACTION = "vs2012"
wks, prj = test.createWorkspace()
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 [[
v110
]]
end
function suite.correctDefault_onVS2013()
_ACTION = "vs2013"
prepare()
test.capture [[
v120
]]
end
--
-- Check for overrides from project scripts.
--
function suite.canOverrideFromScript_withV()
toolset "v90"
prepare()
test.capture [[
v90
]]
end
function suite.canOverrideFromScript_withMsc()
toolset "msc-100"
prepare()
test.capture [[
v100
]]
end
function suite.canOverrideFromScript_withXP()
toolset "v120_xp"
prepare()
test.capture [[
v120_xp
]]
end
function suite.canOverrideFromScript_withLLVM()
toolset "msc-llvm-vs2014_xp"
prepare()
test.capture [[
LLVM-vs2014_xp
]]
end
--
-- Check if platform toolset element is being emitted correctly.
--
function suite.output_onConsoleAppAndNoCpp()
kind "ConsoleApp"
removefiles "hello.cpp"
prepare()
test.capture [[
v110
]]
end
function suite.skipped_onNoMakefileAndNoCpp()
kind "Makefile"
removefiles "hello.cpp"
prepare()
test.isemptycapture()
end
function suite.output_onNoMakefileAndCpp()
kind "Makefile"
prepare()
test.capture [[
v110
]]
end