Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstarkos <unknown>2009-05-28 23:13:50 +0400
committerstarkos <unknown>2009-05-28 23:13:50 +0400
commit2be34e3866c94e75ed12b8126e4bf4ad16e02692 (patch)
treeb0dfcda1364d3d9667a1a73bc8cd00c6a3c763a0 /tests/test_project.lua
parent96da8eb72ccf0317ca5649bcbe1a2b86e53a3c43 (diff)
Condensed parameters to walksources to make trimpaths easier to implement
Diffstat (limited to 'tests/test_project.lua')
-rw-r--r--tests/test_project.lua31
1 files changed, 19 insertions, 12 deletions
diff --git a/tests/test_project.lua b/tests/test_project.lua
index 0a293fc..8b9f4b9 100644
--- a/tests/test_project.lua
+++ b/tests/test_project.lua
@@ -1,15 +1,18 @@
--
-- tests/test_project.lua
-- Automated test suite for the project support functions.
--- Copyright (c) 2008 Jason Perkins and the Premake project
+-- Copyright (c) 2008, 2009 Jason Perkins and the Premake project
--
T.project = { }
- local result
+ local cfg, result
function T.project.setup()
_ACTION = "gmake"
+ cfg = {}
+ cfg.files = {}
+ cfg.trimpaths = {}
result = "\n"
end
@@ -31,30 +34,33 @@
result = result .. string.rep("-", nestlevel) .. item .. "\n"
end
+
function T.project.walksources_OnNoFiles()
- premake.walksources({}, {}, walktest)
+ premake.walksources(cfg, walktest)
test.isequal("\n"
.. ""
,result)
end
+
function T.project.walksources_OnSingleFile()
- local files = {
+ cfg.files = {
"hello.cpp"
}
- premake.walksources({}, files, walktest)
+ premake.walksources(cfg, walktest)
test.isequal("\n"
.. "hello.cpp\n"
,result)
end
+
function T.project.walksources_OnNestedGroups()
- local files = {
+ cfg.files = {
"rootfile.c",
"level1/level1.c",
"level1/level2/level2.c"
}
- premake.walksources({}, files, walktest)
+ premake.walksources(cfg, walktest)
test.isequal("\n"
.. "<level1>\n"
.. "-<level1/level2>\n"
@@ -66,11 +72,12 @@
,result)
end
+
function T.project.walksources_OnDottedFolders()
- local files = {
+ cfg.files = {
"src/lua-5.1.2/lapi.c"
}
- premake.walksources({}, files, walktest)
+ premake.walksources(cfg, walktest)
test.isequal("\n"
.. "<src>\n"
.. "-<src/lua-5.1.2>\n"
@@ -80,15 +87,15 @@
,result)
end
+
function T.project.walksources_OnDotDotLeaders()
- local files = {
+ cfg.files = {
"../src/hello.c",
}
- premake.walksources({}, files, walktest)
+ premake.walksources(cfg, walktest)
test.isequal("\n"
.. "<../src>\n"
.. "-../src/hello.c\n"
.. "</../src>\n"
,result)
end
- \ No newline at end of file