2013-04-03 15:53:00 +00:00
|
|
|
--
|
|
|
|
-- tests/actions/vstudio/vc2010/test_nmake_props.lua
|
|
|
|
-- Check makefile project generation.
|
|
|
|
-- Copyright (c) 2013 Jason Perkins and the Premake project
|
|
|
|
--
|
|
|
|
|
|
|
|
local suite = test.declare("vs2010_nmake_props")
|
|
|
|
local vc2010 = premake.vstudio.vc2010
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Setup
|
|
|
|
--
|
|
|
|
|
2013-11-14 13:52:55 +00:00
|
|
|
local sln, prj
|
2013-04-03 15:53:00 +00:00
|
|
|
|
|
|
|
function suite.setup()
|
2013-04-03 18:09:39 +00:00
|
|
|
_ACTION = "vs2010"
|
2013-11-14 13:52:55 +00:00
|
|
|
sln, prj = test.createsolution()
|
2013-04-03 15:53:00 +00:00
|
|
|
kind "Makefile"
|
|
|
|
end
|
|
|
|
|
|
|
|
local function prepare()
|
2013-11-14 13:52:55 +00:00
|
|
|
local cfg = test.getconfig(prj, "Debug")
|
2013-04-03 15:53:00 +00:00
|
|
|
vc2010.nmakeProperties(cfg)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check the structure with the default project values.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.structureIsCorrect_onDefaultValues()
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
|
|
<NMakeOutput>$(OutDir)MyProject</NMakeOutput>
|
|
|
|
</PropertyGroup>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Element should be skipped for non-Makefile projects.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.skips_onNonMakefile()
|
|
|
|
kind "ConsoleApp"
|
|
|
|
prepare()
|
|
|
|
test.isemptycapture()
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Make sure the target file extension is included.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.usesTargetExtension()
|
|
|
|
targetextension ".exe"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
|
|
<NMakeOutput>$(OutDir)MyProject.exe</NMakeOutput>
|
|
|
|
</PropertyGroup>
|
|
|
|
]]
|
|
|
|
end
|
2013-04-07 18:30:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify generation of the build commands.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.buildCommandLine_onSingleCommand()
|
|
|
|
buildcommands { "command 1" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
|
|
<NMakeOutput>$(OutDir)MyProject</NMakeOutput>
|
|
|
|
<NMakeBuildCommandLine>command 1</NMakeBuildCommandLine>
|
|
|
|
</PropertyGroup>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.buildCommandLine_onMultipleCommands()
|
|
|
|
buildcommands { "command 1", "command 2" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
|
|
<NMakeOutput>$(OutDir)MyProject</NMakeOutput>
|
|
|
|
<NMakeBuildCommandLine>command 1
|
|
|
|
command 2</NMakeBuildCommandLine>
|
|
|
|
</PropertyGroup>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.rebuildCommandLine()
|
|
|
|
rebuildcommands { "command 1" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
|
|
<NMakeOutput>$(OutDir)MyProject</NMakeOutput>
|
|
|
|
<NMakeReBuildCommandLine>command 1</NMakeReBuildCommandLine>
|
|
|
|
</PropertyGroup>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.cleanCommandLine()
|
|
|
|
cleancommands { "command 1" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
|
|
<NMakeOutput>$(OutDir)MyProject</NMakeOutput>
|
|
|
|
<NMakeCleanCommandLine>command 1</NMakeCleanCommandLine>
|
|
|
|
</PropertyGroup>
|
|
|
|
]]
|
|
|
|
end
|