premake/modules/gmake2/tests/test_gmake2_target_rules.lua

61 lines
1.0 KiB
Lua
Raw Normal View History

2017-06-13 16:51:58 +00:00
--
-- test_gmake2_target_rules.lua
-- Validate the makefile target building rules.
-- (c) 2016-2017 Jason Perkins, Blizzard Entertainment and the Premake project
--
local p = premake
local suite = test.declare("gmake2_target_rules")
local p = premake
local gmake2 = p.modules.gmake2
local project = p.project
--
-- Setup
--
local wks, prj
function suite.setup()
wks, prj = test.createWorkspace()
end
local function prepare()
local cfg = test.getconfig(prj, "Debug")
gmake2.cpp.allRules(cfg)
end
--
-- Check the default, normal format of the rules.
--
function suite.defaultRules()
prepare()
test.capture [[
2017-06-13 17:26:04 +00:00
all: prebuild prelink $(TARGET) | $(TARGETDIR) $(OBJDIR)
2017-06-13 16:51:58 +00:00
@:
]]
end
--
-- Check rules for an OS X Cocoa application.
--
function suite.osxWindowedAppRules()
system "MacOSX"
kind "WindowedApp"
prepare()
test.capture [[
2017-06-13 17:26:04 +00:00
all: prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist | $(TARGETDIR) $(OBJDIR)
2017-06-13 16:51:58 +00:00
@:
$(dir $(TARGETDIR))PkgInfo:
$(dir $(TARGETDIR))Info.plist:
]]
end