premake/modules/gmake/tests/cs/test_embed_files.lua

76 lines
1.3 KiB
Lua
Raw Normal View History

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