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

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/project/test_vpaths.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/project/test_vpaths.lua b/tests/project/test_vpaths.lua
index 49631e2..8616907 100644
--- a/tests/project/test_vpaths.lua
+++ b/tests/project/test_vpaths.lua
@@ -124,3 +124,32 @@
prepare()
test.isequal("src/hello.c", project.getvpath(prj, "../../src/hello.c"))
end
+
+
+--
+-- Test with project locations
+--
+
+ function suite.MatchPath_OnProjectLocationSet()
+ location "build"
+ files "src/hello.h"
+ vpaths { [""] = "src" }
+ prepare()
+ test.isequal("hello.h", project.getvpath(prj, prj.files[1]))
+ end
+
+ function suite.MatchFilePattern_OnProjectLocationSet()
+ location "build"
+ files "src/hello.h"
+ vpaths { ["Headers"] = "**.h" }
+ prepare()
+ test.isequal("Headers/hello.h", project.getvpath(prj, prj.files[1]))
+ end
+
+ function suite.MatchFilePatternWithPath_OnProjectLocationSet()
+ location "build"
+ files "src/hello.h"
+ vpaths { ["Headers"] = "src/**.h" }
+ prepare()
+ test.isequal("Headers/hello.h", project.getvpath(prj, prj.files[1]))
+ end