2012-01-04 22:16:06 +00:00
|
|
|
--
|
|
|
|
-- tests/actions/vstudio/vc200x/test_configuration.lua
|
|
|
|
-- Test the Visual Studio 2002-2008 project's Configuration block
|
2013-11-14 13:52:55 +00:00
|
|
|
-- Copyright (c) 2009-2013 Jason Perkins and the Premake project
|
2012-01-04 22:16:06 +00:00
|
|
|
--
|
|
|
|
|
2013-11-14 13:52:55 +00:00
|
|
|
local suite = test.declare("vstudio_vc200x_configuration")
|
2014-02-18 15:59:56 +00:00
|
|
|
local vstudio = premake.vstudio
|
2012-01-04 22:16:06 +00:00
|
|
|
local vc200x = premake.vstudio.vc200x
|
2013-09-13 15:15:36 +00:00
|
|
|
local project = premake.project
|
2012-01-04 22:16:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2013-04-03 18:09:39 +00:00
|
|
|
-- Setup
|
2012-01-04 22:16:06 +00:00
|
|
|
--
|
|
|
|
|
2013-11-14 13:52:55 +00:00
|
|
|
local sln, prj
|
2013-04-03 18:09:39 +00:00
|
|
|
|
2012-01-04 22:16:06 +00:00
|
|
|
function suite.setup()
|
|
|
|
_ACTION = "vs2008"
|
2013-11-14 13:52:55 +00:00
|
|
|
sln, prj = test.createsolution()
|
2012-01-04 22:16:06 +00:00
|
|
|
end
|
2013-04-03 18:09:39 +00:00
|
|
|
|
2012-01-04 22:16:06 +00:00
|
|
|
local function prepare()
|
2013-11-14 13:52:55 +00:00
|
|
|
local cfg = test.getconfig(prj, "Debug", (prj.platforms or sln.platforms or {})[1])
|
2014-02-18 15:59:56 +00:00
|
|
|
vc200x.configuration(cfg, vstudio.projectConfig(cfg))
|
2012-01-04 22:16:06 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check the results of generating with the default project settings
|
|
|
|
-- (C++ console application).
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.defaultSettings()
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2014-01-31 16:40:09 +00:00
|
|
|
<Configuration
|
|
|
|
Name="Debug|Win32"
|
|
|
|
OutputDirectory="."
|
|
|
|
IntermediateDirectory="obj\Debug"
|
|
|
|
ConfigurationType="1"
|
|
|
|
CharacterSet="2"
|
|
|
|
>
|
2012-01-04 22:16:06 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- If a platform is specified, it should be included in the platform name.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.usesWin32_onX32()
|
2012-02-19 17:31:20 +00:00
|
|
|
solution "MySolution"
|
2012-01-04 22:16:06 +00:00
|
|
|
platforms { "x32" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2014-01-31 16:40:09 +00:00
|
|
|
<Configuration
|
|
|
|
Name="Debug|Win32"
|
2012-01-04 22:16:06 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check the x64 architecture handling.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.usesX64Architecture_onX64Platform()
|
|
|
|
platforms { "x64" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2014-01-31 16:40:09 +00:00
|
|
|
<Configuration
|
|
|
|
Name="Debug|x64"
|
2012-01-04 22:16:06 +00:00
|
|
|
]]
|
|
|
|
end
|
2012-01-11 21:30:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- The output directory should use backslashes
|
|
|
|
--
|
|
|
|
|
2012-11-17 20:49:06 +00:00
|
|
|
function suite.escapesOutputDir()
|
2012-01-11 21:30:59 +00:00
|
|
|
targetdir("../bin")
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2014-01-31 16:40:09 +00:00
|
|
|
<Configuration
|
|
|
|
Name="Debug|Win32"
|
|
|
|
OutputDirectory="..\bin"
|
2012-01-11 21:30:59 +00:00
|
|
|
]]
|
|
|
|
end
|
2013-04-03 18:09:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Makefiles set the configuration type and drop the
|
|
|
|
-- character encoding.
|
|
|
|
--
|
|
|
|
|
2013-06-26 11:28:57 +00:00
|
|
|
function suite.defaultSettings_onMakefile()
|
2013-04-03 18:09:39 +00:00
|
|
|
kind "Makefile"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2014-01-31 16:40:09 +00:00
|
|
|
<Configuration
|
|
|
|
Name="Debug|Win32"
|
|
|
|
OutputDirectory="."
|
|
|
|
IntermediateDirectory="obj\Debug"
|
|
|
|
ConfigurationType="0"
|
|
|
|
>
|
2013-04-03 18:09:39 +00:00
|
|
|
]]
|
|
|
|
end
|
2013-06-26 11:28:57 +00:00
|
|
|
|
|
|
|
function suite.defaultSettings_onNone()
|
|
|
|
kind "None"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2014-01-31 16:40:09 +00:00
|
|
|
<Configuration
|
|
|
|
Name="Debug|Win32"
|
|
|
|
OutputDirectory="."
|
|
|
|
IntermediateDirectory="obj\Debug"
|
|
|
|
ConfigurationType="0"
|
|
|
|
>
|
2013-06-26 11:28:57 +00:00
|
|
|
]]
|
|
|
|
end
|