blob: 0d9406d90b4040c59cca4be27c0861ff54d7ef3b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
--
-- 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
--
-- Make sure that values only get applied to the right configurations.
--
function T.configs.RootValues()
local cfg = premake.getconfig(prj).defines
test.istrue(#cfg == 1 and cfg[1] == "GLOBAL") -- maybe table.compare instead?
end
function T.configs.ConfigValues()
local cfg = premake.getconfig(prj, "Debug").defines
test.istrue(#cfg == 2 and cfg[1] == "GLOBAL" and cfg[2] == "DEBUG")
end
function T.configs.PlatformValues()
local cfg = premake.getconfig(prj, "Debug", "x32").defines
test.istrue(#cfg == 3 and cfg[1] == "GLOBAL" and cfg[2] == "DEBUG" and cfg[3] == "X86_32")
end
function T.configs.DefaultPlaformNotInSolution()
local cfg = premake.getconfig(prj, "Debug", "xbox360").defines
test.isequal("GLOBAL:DEBUG", table.concat(cfg, ":"))
end
|