--
-- tests/actions/vstudio/vc2010/test_item_def_group.lua
-- Check the item definition groups, containing compile and link flags.
-- Copyright (c) 2013 Jason Perkins and the Premake project
local suite = test.declare("vs2010_item_def_group")
local vc2010 = premake.vstudio.vc2010
local project = premake.project
-- Setup
local sln, prj
function suite.setup()
sln, prj = test.createsolution()
end
local function prepare(buildcfg)
local cfg = test.getconfig(prj, buildcfg or "Debug")
vc2010.itemDefinitionGroup(cfg)
-- Check generation of opening element for typical C++ project.
function suite.structureIsCorrect_onDefaultValues()
prepare()
test.capture [[
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
]]
-- Makefile projects omit the condition and all contents.
function suite.structureIsCorrect_onMakefile()
kind "Makefile"
<ItemDefinitionGroup>
</ItemDefinitionGroup>
function suite.structureIsCorrect_onNone()
-- Because the item definition group for makefile projects is not
-- tied to a particular condition, it should only get written for
-- the first configuration.
function suite.skipped_onSubsequentConfigs()
prepare("Release")
test.isemptycapture()
function suite.skipped_onSubsequentConfigs_onNone()
kind "None"