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/actions/make/workspace/test_default_config.lua
2015-09-03 18:03:39 -04:00

72 lines
1.2 KiB
Lua

--
-- tests/actions/make/test_default_config.lua
-- Validate generation of default configuration block for makefiles.
-- Copyright (c) 2012-2015 Jason Perkins and the Premake project
--
local suite = test.declare("make_default_config")
local p = premake
--
-- Setup/teardown
--
local wks, prj
function suite.setup()
wks = test.createWorkspace()
end
local function prepare()
prj = test.getproject(wks, 1)
p.make.defaultconfig(prj)
end
--
-- Verify the handling of the default setup: Debug and Release, no platforms.
--
function suite.defaultsToFirstBuildCfg_onNoPlatforms()
prepare()
test.capture [[
ifndef config
config=debug
endif
]]
end
--
-- Verify handling of build config/platform combination.
--
function suite.defaultsToFirstPairing_onPlatforms()
platforms { "Win32", "Win64" }
prepare()
test.capture [[
ifndef config
config=debug_win32
endif
]]
end
--
-- If the project excludes a workspace build cfg, it should be skipped
-- over as the default config as well.
--
function suite.usesFirstValidPairing_onExcludedConfig()
platforms { "Win32", "Win64" }
removeconfigurations { "Debug" }
prepare()
test.capture [[
ifndef config
config=release_win32
endif
]]
end