2016-09-01 23:29:10 +00:00
|
|
|
--
|
|
|
|
-- 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" }
|
2016-09-01 23:29:10 +00:00
|
|
|
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-01 23:29:10 +00:00
|
|
|
|
2016-09-06 18:53:47 +00:00
|
|
|
filter { "*" }
|
|
|
|
removeflags { "*" }
|
2016-09-01 23:29:10 +00:00
|
|
|
|
2016-09-06 18:53:47 +00:00
|
|
|
-- test output.
|
|
|
|
local cfg = test.getconfig(prj, "Debug", platform)
|
2016-09-01 23:29:10 +00:00
|
|
|
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-01 23:29:10 +00:00
|
|
|
|
2016-09-06 18:53:47 +00:00
|
|
|
filter { "configurations:Release" }
|
|
|
|
removeflags { "*" }
|
2016-09-01 23:29:10 +00:00
|
|
|
|
2016-09-06 18:53:47 +00:00
|
|
|
-- test output.
|
2016-09-01 23:29:10 +00:00
|
|
|
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-01 23:29:10 +00:00
|
|
|
|
2016-09-06 18:53:47 +00:00
|
|
|
-- test output.
|
|
|
|
local cfg = test.getconfig(prj, "Debug", platform)
|
2016-09-01 23:29:10 +00:00
|
|
|
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
|
|
|
|
|