2009-04-09 20:02:49 +00:00
|
|
|
--
|
|
|
|
-- tests/test_configs.lua
|
|
|
|
-- Automated test suite for the configuration building functions.
|
|
|
|
-- Copyright (c) 2009 Jason Perkins and the Premake project
|
|
|
|
--
|
|
|
|
|
|
|
|
T.configs = { }
|
|
|
|
|
|
|
|
|
|
|
|
local prj
|
|
|
|
function T.configs.setup()
|
|
|
|
solution "MySolution"
|
|
|
|
configurations { "Debug", "Release" }
|
|
|
|
platforms { "x32", "x64" }
|
|
|
|
|
|
|
|
prj = project "MyProject"
|
|
|
|
language "C"
|
|
|
|
kind "ConsoleApp"
|
|
|
|
defines "GLOBAL"
|
|
|
|
|
|
|
|
configuration "Debug"
|
|
|
|
defines "DEBUG"
|
|
|
|
|
|
|
|
configuration "Release"
|
|
|
|
defines "RELEASE"
|
|
|
|
|
|
|
|
configuration "x32"
|
|
|
|
defines "X86_32"
|
|
|
|
|
|
|
|
configuration "x64"
|
|
|
|
defines "X86_64"
|
|
|
|
|
|
|
|
premake.buildconfigs()
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function T.configs.RootValues()
|
2009-04-20 19:06:48 +00:00
|
|
|
local r = premake.getconfig(prj).defines
|
|
|
|
test.isequal("GLOBAL", table.concat(r,":"))
|
2009-04-09 20:02:49 +00:00
|
|
|
end
|
|
|
|
|
2009-04-20 19:06:48 +00:00
|
|
|
|
2009-04-09 20:02:49 +00:00
|
|
|
function T.configs.ConfigValues()
|
2009-04-20 19:06:48 +00:00
|
|
|
local r = premake.getconfig(prj, "Debug").defines
|
|
|
|
test.isequal("GLOBAL:DEBUG", table.concat(r,":"))
|
2009-04-09 20:02:49 +00:00
|
|
|
end
|
|
|
|
|
2009-04-20 19:06:48 +00:00
|
|
|
|
2009-04-09 20:02:49 +00:00
|
|
|
function T.configs.PlatformValues()
|
2009-04-20 19:06:48 +00:00
|
|
|
local r = premake.getconfig(prj, "Debug", "x32").defines
|
|
|
|
test.isequal("GLOBAL:DEBUG:X86_32", table.concat(r,":"))
|
2009-04-09 20:02:49 +00:00
|
|
|
end
|
|
|
|
|
2009-04-20 19:06:48 +00:00
|
|
|
|
|
|
|
function T.configs.PlaformNotInSolution()
|
2009-04-20 19:46:23 +00:00
|
|
|
local r = premake.getconfig(prj, "Debug", "Xbox360").defines
|
|
|
|
test.isequal("GLOBAL:DEBUG", table.concat(r, ":"))
|
2009-04-09 20:02:49 +00:00
|
|
|
end
|
2009-04-23 18:26:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
function T.configs.DefaultToNativePlatform()
|
|
|
|
local r = premake.getconfig(prj, "Debug").platform
|
|
|
|
test.isequal("Native", r)
|
|
|
|
end
|
|
|
|
|
2009-04-24 14:34:54 +00:00
|
|
|
|
|
|
|
function T.configs.BuildsShortName()
|
|
|
|
local r = premake.getconfig(prj, "Debug", "x32").shortname
|
|
|
|
test.isequal("debug32", r)
|
|
|
|
end
|
|
|
|
|
|
|
|
function T.configs.BuildsLongName()
|
|
|
|
local r = premake.getconfig(prj, "Debug", "x32").longname
|
|
|
|
test.isequal("Debug|x32", r)
|
|
|
|
end
|
2009-04-09 20:02:49 +00:00
|
|
|
|