2012-02-19 17:31:20 +00:00
|
|
|
--
|
|
|
|
-- tests/solution/test_eachconfig.lua
|
|
|
|
-- Automated test suite for the solution-level configuration iterator.
|
|
|
|
-- Copyright (c) 2012 Jason Perkins and the Premake project
|
|
|
|
--
|
|
|
|
|
|
|
|
T.solution_eachconfig = { }
|
|
|
|
local suite = T.solution_eachconfig
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Setup and teardown
|
|
|
|
--
|
|
|
|
|
2015-08-28 20:16:14 +00:00
|
|
|
local wks
|
2012-02-19 17:31:20 +00:00
|
|
|
function suite.setup()
|
2015-08-28 20:16:14 +00:00
|
|
|
wks = solution("MySolution")
|
2012-02-19 17:31:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
local function prepare()
|
2012-03-05 22:45:42 +00:00
|
|
|
_p(2,"-")
|
2015-08-28 20:16:14 +00:00
|
|
|
for cfg in premake.solution.eachconfig(wks) do
|
2012-02-19 17:31:20 +00:00
|
|
|
_p(2, "%s:%s", cfg.buildcfg or "", cfg.platform or "")
|
|
|
|
end
|
2012-03-05 22:45:42 +00:00
|
|
|
_p(2,"-")
|
2012-02-19 17:31:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- All configurations listed at the solution level should be enumerated.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.listsBuildConfigurations_onSolutionLevel()
|
|
|
|
configurations { "Debug", "Release" }
|
2012-03-05 22:45:42 +00:00
|
|
|
project("MyProject")
|
2012-02-19 17:31:20 +00:00
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2012-03-05 22:45:42 +00:00
|
|
|
-
|
2012-02-19 17:31:20 +00:00
|
|
|
Debug:
|
|
|
|
Release:
|
2012-03-05 22:45:42 +00:00
|
|
|
-
|
2012-02-19 17:31:20 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Iteration order should be build configurations, then platforms.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.listsInOrder_onBuildConfigsAndPlatforms()
|
|
|
|
configurations { "Debug", "Release" }
|
2015-04-13 22:27:11 +00:00
|
|
|
platforms { "x86", "x86_64" }
|
2012-03-05 22:45:42 +00:00
|
|
|
project("MyProject")
|
2012-02-19 17:31:20 +00:00
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2012-03-05 22:45:42 +00:00
|
|
|
-
|
2015-04-13 22:27:11 +00:00
|
|
|
Debug:x86
|
|
|
|
Debug:x86_64
|
|
|
|
Release:x86
|
|
|
|
Release:x86_64
|
2012-03-05 22:45:42 +00:00
|
|
|
-
|
2012-02-19 17:31:20 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2012-05-08 18:09:07 +00:00
|
|
|
-- Configurations listed at the project level should *not* be included
|
|
|
|
-- in the solution-level lists.
|
2012-02-19 17:31:20 +00:00
|
|
|
--
|
|
|
|
|
2012-05-08 18:09:07 +00:00
|
|
|
function suite.excludesProjectLevelConfigs()
|
2012-02-19 17:31:20 +00:00
|
|
|
configurations { "Debug", "Release" }
|
2012-05-08 18:09:07 +00:00
|
|
|
project ("MyProject")
|
|
|
|
configurations { "PrjDebug", "PrjRelease" }
|
2015-04-13 22:27:11 +00:00
|
|
|
platforms { "x86", "x86_64" }
|
2012-02-19 17:31:20 +00:00
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2012-03-05 22:45:42 +00:00
|
|
|
-
|
|
|
|
Debug:
|
2012-05-08 18:09:07 +00:00
|
|
|
Release:
|
2012-03-05 22:45:42 +00:00
|
|
|
-
|
2012-02-19 17:31:20 +00:00
|
|
|
]]
|
|
|
|
end
|