From f6b755dc62df5ff796eb076ae1459a69746ee2f7 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Tue, 28 May 2024 10:53:41 -0700 Subject: Simplify test file names for slang-test (#4227) When slang-test.exe ran with a file name doesn't exactly match character-by-character, those tests don't run. This commit alters the file name given from the command-line and it will behave in a more expected way. - "./" are removed. - "../" gets removed along with its parent directory name. - Back-slash characters will be converted to slash on Windows. --- tools/slang-test/options.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tools/slang-test/options.cpp') diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp index 895b7e2bb..0f3abfdf2 100644 --- a/tools/slang-test/options.cpp +++ b/tools/slang-test/options.cpp @@ -330,7 +330,14 @@ static bool _isSubCommand(const char* arg) // first positional argument is source shader path - optionsOut->testPrefixes = std::move(positionalArgs); + optionsOut->testPrefixes.clear(); + optionsOut->testPrefixes.reserve(positionalArgs.getCount()); + for (auto testPrefix : positionalArgs) + { + Slang::StringBuilder sb; + Slang::Path::simplify(testPrefix, Slang::Path::SimplifyStyle::NoRoot, sb); + optionsOut->testPrefixes.add(sb); + } if (optionsOut->binDir.getLength() == 0) { -- cgit v1.2.3