2013-09-06 14:23:17 +00:00
|
|
|
--
|
|
|
|
-- tests/actions/make/cs/test_embed_files.lua
|
|
|
|
-- Tests embedded file listings for C# Makefiles.
|
2014-04-25 15:53:01 +00:00
|
|
|
-- Copyright (c) 2013-2014 Jason Perkins and the Premake project
|
2013-09-06 14:23:17 +00:00
|
|
|
--
|
|
|
|
|
2017-04-25 05:44:13 +00:00
|
|
|
local p = premake
|
2013-09-06 14:23:17 +00:00
|
|
|
local suite = test.declare("make_cs_embed_files")
|
2017-04-25 05:44:13 +00:00
|
|
|
local make = p.make
|
|
|
|
local cs = p.make.cs
|
|
|
|
local project = p.project
|
2013-09-06 14:23:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Setup
|
|
|
|
--
|
|
|
|
|
2015-08-28 20:16:14 +00:00
|
|
|
local wks, prj, cfg
|
2013-09-06 14:23:17 +00:00
|
|
|
|
|
|
|
function suite.setup()
|
2015-08-28 20:16:14 +00:00
|
|
|
wks = test.createWorkspace()
|
2013-09-06 14:23:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
local function prepare()
|
2017-04-25 05:44:13 +00:00
|
|
|
prj = p.workspace.getproject(wks, 1)
|
|
|
|
make.csEmbedFiles(prj, p.tools.dotnet)
|
2013-09-06 14:23:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Files that can be compiled should be listed here.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.doesListResourceFiles()
|
|
|
|
files { "Hello.resx" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
EMBEDFILES += \
|
2013-10-17 05:04:23 +00:00
|
|
|
$(OBJDIR)/MyProject.Hello.resources \
|
2013-09-06 14:23:17 +00:00
|
|
|
|
2017-04-25 17:15:33 +00:00
|
|
|
]]
|
|
|
|
end
|
2013-09-06 14:23:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Files that should not be compiled should be excluded.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.doesIgnoreNonResourceFiles()
|
|
|
|
files { "About.txt", "Hello.resx" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
EMBEDFILES += \
|
2013-10-17 05:04:23 +00:00
|
|
|
$(OBJDIR)/MyProject.Hello.resources \
|
2013-09-06 14:23:17 +00:00
|
|
|
|
2017-04-25 17:15:33 +00:00
|
|
|
]]
|
|
|
|
end
|
2013-09-06 14:23:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Files with a non-standard file extension but a build action of
|
|
|
|
-- "Embed" should be listed here.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.doesIncludeCompileBuildAction()
|
|
|
|
files { "Hello.txt" }
|
2014-04-25 15:53:01 +00:00
|
|
|
filter "files:*.txt"
|
2013-09-06 14:23:17 +00:00
|
|
|
buildaction "Embed"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
EMBEDFILES += \
|
|
|
|
Hello.txt \
|
|
|
|
|
2017-04-25 17:15:33 +00:00
|
|
|
]]
|
|
|
|
end
|