This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
/
test_platforms.lua
58 lines (46 loc) · 1.56 KB
/
test_platforms.lua
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
--
-- tests/test_platforms.lua
-- Automated test suite for platform handling functions.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
T.platforms = { }
local testmap = { Native="Win32", x32="Win32", x64="x64" }
local sln, r
function T.platforms.setup()
sln = solution "MySolution"
configurations { "Debug", "Release" }
end
function T.platforms.filter_OnNoSolutionPlatforms()
premake.bake.buildconfigs()
r = premake.filterplatforms(sln, testmap)
test.isequal("", table.concat(r, ":"))
end
function T.platforms.filter_OnNoSolutionPlatformsAndDefault()
premake.bake.buildconfigs()
r = premake.filterplatforms(sln, testmap, "x32")
test.isequal("x32", table.concat(r, ":"))
end
function T.platforms.filter_OnIntersection()
platforms { "x32", "x64", "Xbox360" }
premake.bake.buildconfigs()
r = premake.filterplatforms(sln, testmap, "x32")
test.isequal("x32:x64", table.concat(r, ":"))
end
function T.platforms.filter_OnNoIntersection()
platforms { "Universal", "Xbox360" }
premake.bake.buildconfigs()
r = premake.filterplatforms(sln, testmap)
test.isequal("", table.concat(r, ":"))
end
function T.platforms.filter_OnNoIntersectionAndDefault()
platforms { "Universal", "Xbox360" }
premake.bake.buildconfigs()
r = premake.filterplatforms(sln, testmap, "x32")
test.isequal("x32", table.concat(r, ":"))
end
function T.platforms.filter_OnDuplicateKeys()
platforms { "Native", "x32" }
premake.bake.buildconfigs()
r = premake.filterplatforms(sln, testmap, "x32")
test.isequal("Native", table.concat(r, ":"))
end