diff options
| author | Janne Kiviluoto (NVIDIA) <235827468+jkiviluoto-nv@users.noreply.github.com> | 2025-10-13 13:50:32 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-13 10:50:32 +0000 |
| commit | f5a3a6dc6a98d22964154f809f9e0dcae30ab67f (patch) | |
| tree | ce758e44c584f02aaee94455ab341ba2ef627b2d | |
| parent | 8f499fbe9baf68ef880da2ffe4812fbed1e5c1fa (diff) | |
Support tests outside tests directory (#7791) (#8666)
As running slang-test in slang root is implicitly assumed (and mentioned
in CONTRIBUTING.md), no detailed path checks are done.
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index db0102304..36e79659f 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -4868,6 +4868,19 @@ void runTestsInDirectory(TestContext* context) List<String> files; getFilesInDirectory(context->options.testDir, files); + // Also add any test prefixes that point to actual files outside the test directory + for (const auto& testPrefix : context->options.testPrefixes) + { + if (File::exists(testPrefix)) + { + // Avoid duplicates - only add if not already in the list + if (files.indexOf(testPrefix) == Index(-1)) + { + files.add(testPrefix); + } + } + } + // NTFS on Windows stores files in sorted order but not on Linux/Macos. // Because of that, the testing on Linux/Macos were randomly failing, which // is a good thing because it reveals problems. But it is useless |
