2009-04-09 20:02:49 +00:00
|
|
|
--
|
|
|
|
-- tests/test_platforms.lua
|
|
|
|
-- Automated test suite for platform handling functions.
|
|
|
|
-- Copyright (c) 2009 Jason Perkins and the Premake project
|
|
|
|
--
|
|
|
|
|
|
|
|
T.platforms = { }
|
|
|
|
|
|
|
|
|
2009-04-20 19:46:23 +00:00
|
|
|
local testmap = { Native="Win32", x32="Win32", x64="x64" }
|
2009-04-09 20:02:49 +00:00
|
|
|
|
|
|
|
local sln, r
|
|
|
|
function T.platforms.setup()
|
|
|
|
sln = solution "MySolution"
|
|
|
|
configurations { "Debug", "Release" }
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function T.platforms.filter_OnNoSolutionPlatforms()
|
2011-05-18 21:32:04 +00:00
|
|
|
premake.bake.buildconfigs()
|
2009-04-09 20:02:49 +00:00
|
|
|
r = premake.filterplatforms(sln, testmap)
|
|
|
|
test.isequal("", table.concat(r, ":"))
|
|
|
|
end
|
|
|
|
|
|
|
|
function T.platforms.filter_OnNoSolutionPlatformsAndDefault()
|
2011-05-18 21:32:04 +00:00
|
|
|
premake.bake.buildconfigs()
|
2009-04-09 20:02:49 +00:00
|
|
|
r = premake.filterplatforms(sln, testmap, "x32")
|
|
|
|
test.isequal("x32", table.concat(r, ":"))
|
|
|
|
end
|
|
|
|
|
|
|
|
function T.platforms.filter_OnIntersection()
|
2009-04-20 19:46:23 +00:00
|
|
|
platforms { "x32", "x64", "Xbox360" }
|
2011-05-18 21:32:04 +00:00
|
|
|
premake.bake.buildconfigs()
|
2009-04-09 20:02:49 +00:00
|
|
|
r = premake.filterplatforms(sln, testmap, "x32")
|
|
|
|
test.isequal("x32:x64", table.concat(r, ":"))
|
|
|
|
end
|
|
|
|
|
|
|
|
function T.platforms.filter_OnNoIntersection()
|
2009-04-20 19:46:23 +00:00
|
|
|
platforms { "Universal", "Xbox360" }
|
2011-05-18 21:32:04 +00:00
|
|
|
premake.bake.buildconfigs()
|
2009-04-09 20:02:49 +00:00
|
|
|
r = premake.filterplatforms(sln, testmap)
|
|
|
|
test.isequal("", table.concat(r, ":"))
|
|
|
|
end
|
|
|
|
|
|
|
|
function T.platforms.filter_OnNoIntersectionAndDefault()
|
2009-04-20 19:46:23 +00:00
|
|
|
platforms { "Universal", "Xbox360" }
|
2011-05-18 21:32:04 +00:00
|
|
|
premake.bake.buildconfigs()
|
2009-04-09 20:02:49 +00:00
|
|
|
r = premake.filterplatforms(sln, testmap, "x32")
|
|
|
|
test.isequal("x32", table.concat(r, ":"))
|
|
|
|
end
|
2009-04-20 19:46:23 +00:00
|
|
|
|
|
|
|
function T.platforms.filter_OnDuplicateKeys()
|
|
|
|
platforms { "Native", "x32" }
|
2011-05-18 21:32:04 +00:00
|
|
|
premake.bake.buildconfigs()
|
2009-04-20 19:46:23 +00:00
|
|
|
r = premake.filterplatforms(sln, testmap, "x32")
|
|
|
|
test.isequal("Native", table.concat(r, ":"))
|
|
|
|
end
|
|
|
|
|