This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/tests/test_platforms.lua

59 lines
1.5 KiB
Lua

--
-- 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.buildconfigs()
r = premake.filterplatforms(sln, testmap)
test.isequal("", table.concat(r, ":"))
end
function T.platforms.filter_OnNoSolutionPlatformsAndDefault()
premake.buildconfigs()
r = premake.filterplatforms(sln, testmap, "x32")
test.isequal("x32", table.concat(r, ":"))
end
function T.platforms.filter_OnIntersection()
platforms { "x32", "x64", "Xbox360" }
premake.buildconfigs()
r = premake.filterplatforms(sln, testmap, "x32")
test.isequal("x32:x64", table.concat(r, ":"))
end
function T.platforms.filter_OnNoIntersection()
platforms { "Universal", "Xbox360" }
premake.buildconfigs()
r = premake.filterplatforms(sln, testmap)
test.isequal("", table.concat(r, ":"))
end
function T.platforms.filter_OnNoIntersectionAndDefault()
platforms { "Universal", "Xbox360" }
premake.buildconfigs()
r = premake.filterplatforms(sln, testmap, "x32")
test.isequal("x32", table.concat(r, ":"))
end
function T.platforms.filter_OnDuplicateKeys()
platforms { "Native", "x32" }
premake.buildconfigs()
r = premake.filterplatforms(sln, testmap, "x32")
test.isequal("Native", table.concat(r, ":"))
end