2012-06-22 21:15:17 +00:00
|
|
|
--
|
|
|
|
-- tests/actions/make/cpp/test_target_rules.lua
|
|
|
|
-- Validate the makefile target building rules.
|
2013-08-11 18:22:24 +00:00
|
|
|
-- Copyright (c) 2009-2013 Jason Perkins and the Premake project
|
2012-06-22 21:15:17 +00:00
|
|
|
--
|
|
|
|
|
2013-08-11 18:22:24 +00:00
|
|
|
local suite = test.declare("make_cpp_target_rules")
|
|
|
|
local make = premake.make
|
2013-09-13 15:15:36 +00:00
|
|
|
local project = premake.project
|
2012-06-22 21:15:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2013-08-11 18:22:24 +00:00
|
|
|
-- Setup
|
2012-06-22 21:15:17 +00:00
|
|
|
--
|
|
|
|
|
|
|
|
local sln, prj
|
2013-08-11 18:22:24 +00:00
|
|
|
|
2012-06-22 21:15:17 +00:00
|
|
|
function suite.setup()
|
|
|
|
sln, prj = test.createsolution()
|
|
|
|
end
|
2013-08-11 18:22:24 +00:00
|
|
|
|
2012-06-22 21:15:17 +00:00
|
|
|
local function prepare()
|
2013-11-14 13:52:55 +00:00
|
|
|
local cfg = test.getconfig(prj, "Debug")
|
2013-08-11 18:22:24 +00:00
|
|
|
make.cppAllRules(cfg)
|
2012-06-22 21:15:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check the default, normal format of the rules.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.defaultRules()
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
|
|
|
|
@:
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check rules for an OS X Cocoa application.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.osxWindowedAppRules()
|
|
|
|
system "MacOSX"
|
|
|
|
kind "WindowedApp"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist
|
|
|
|
@:
|
|
|
|
|
|
|
|
$(dir $(TARGETDIR))PkgInfo:
|
|
|
|
$(dir $(TARGETDIR))Info.plist:
|
|
|
|
]]
|
|
|
|
end
|