premake/tests/api/test_deprecations.lua

66 lines
1.6 KiB
Lua
Raw Normal View History

--
-- tests/api/test_table_kind.lua
-- Tests the table API value type.
-- Copyright (c) 2012-2014 Jason Perkins and the Premake project
--
local suite = test.declare("api_deprecations")
local api = premake.api
function suite.setup()
2016-09-06 18:53:47 +00:00
workspace("MyWorkspace")
configurations { "Debug", "Release" }
end
function suite.setsNewValue_whenOldValueIsRemovedViaWildcard_inSubConfig()
2016-09-06 18:53:47 +00:00
local prj = project "MyProject"
filter { "configurations:Debug" }
flags { "Symbols" }
2016-09-06 18:53:47 +00:00
filter { "*" }
removeflags { "*" }
2016-09-06 18:53:47 +00:00
-- test output.
local cfg = test.getconfig(prj, "Debug", platform)
test.isequal("Default", cfg.Symbols)
end
function suite.setsNewValue_whenOldValueIsRemovedInOtherConfig_inSubConfig()
2016-09-06 18:53:47 +00:00
local prj = project "MyProject"
flags { "Symbols" }
2016-09-06 18:53:47 +00:00
filter { "configurations:Release" }
removeflags { "*" }
2016-09-06 18:53:47 +00:00
-- test output.
test.isequal("On", test.getconfig(prj, "Debug", platform).Symbols)
test.isequal("Default", test.getconfig(prj, "Release", platform).Symbols)
end
function suite.dontRemoveFlagIfSetThroughNewApi()
2016-09-06 18:53:47 +00:00
local prj = project "MyProject"
floatingpoint "Fast"
removeflags "*"
2016-09-06 18:53:47 +00:00
-- test output.
local cfg = test.getconfig(prj, "Debug", platform)
test.isequal("Fast", cfg.floatingpoint)
end
2016-09-06 18:53:47 +00:00
function suite.setsNewValue_whenOldValueFromParentIsRemovedInOtherConfig_inSubConfig()
flags { "Symbols" }
local prj = project "MyProject"
filter { "configurations:Release" }
removeflags { "*" }
-- test output.
test.isequal("On", test.getconfig(prj, "Debug", platform).Symbols)
test.isequal("Default", test.getconfig(prj, "Release", platform).Symbols)
end