From 77f3d5249efb979be79c73a2762babab5d6d5d6d Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Tue, 12 Nov 2013 07:49:14 -0500 Subject: Fix virtual path building for patterns like "filename.*" --- tests/project/test_vpaths.lua | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/project/test_vpaths.lua b/tests/project/test_vpaths.lua index 3055986..66322d4 100644 --- a/tests/project/test_vpaths.lua +++ b/tests/project/test_vpaths.lua @@ -5,7 +5,7 @@ -- T.project_vpaths = { } - local suite = T.project_vpaths + local suite = T.project_vpaths local project = premake.project @@ -26,7 +26,7 @@ return project.getvpath(prj, cfg.files[1]) end - + -- -- Test simple replacements -- @@ -94,7 +94,7 @@ files { "src/myproject/hello.h" } vpaths { ["Source/Headers"] = "**.h" } test.isequal("Source/Headers/hello.h", run()) - end + end function suite.MatchFilePattern_ToGroup_WithTrailingSlash() files { "src/myproject/hello.h" } @@ -106,32 +106,39 @@ files { "src/myproject/hello.h" } vpaths { ["Group/Headers"] = "**.h" } test.isequal("Group/Headers/hello.h", run()) - end + end function suite.MatchFilePattern_ToGroup_Nested() files { "src/myproject/hello.h" } vpaths { ["Headers/*"] = "**.h" } test.isequal("Headers/src/myproject/hello.h", run()) - end + end function suite.MatchFilePattern_ToGroup_Nested_OneStar() files { "src/myproject/hello.h" } vpaths { ["Headers/*"] = "**.h" } test.isequal("Headers/src/myproject/hello.h", run()) - end + end function suite.MatchFilePatternWithPath_ToGroup_Nested() files { "src/myproject/hello.h" } vpaths { ["Headers/*"] = "src/**.h" } test.isequal("Headers/myproject/hello.h", run()) - end + end + + function suite.matchBaseFileName_onWildcardExtension() + files { "hello.cpp" } + vpaths { ["Sources"] = "hello.*" } + test.isequal("Sources/hello.cpp", run()) + end + -- -- Test with project locations -- - function suite.MatchPath_OnProjectLocationSet() + function suite.MatchPath_OnProjectLocationSet() location "build" files "src/hello.h" vpaths { [""] = "src" } -- cgit v1.2.3