diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2024-05-28 10:53:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-28 10:53:41 -0700 |
| commit | f6b755dc62df5ff796eb076ae1459a69746ee2f7 (patch) | |
| tree | 6295c6aa2efd38722fa3453c4892b5a9e06d64d1 /tools/slang-test/options.cpp | |
| parent | 9323095c1aa35d8a406f3d94d7abf2d5621b01e9 (diff) | |
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.
Diffstat (limited to 'tools/slang-test/options.cpp')
| -rw-r--r-- | tools/slang-test/options.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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) { |
