From f5a3a6dc6a98d22964154f809f9e0dcae30ab67f Mon Sep 17 00:00:00 2001 From: "Janne Kiviluoto (NVIDIA)" <235827468+jkiviluoto-nv@users.noreply.github.com> Date: Mon, 13 Oct 2025 13:50:32 +0300 Subject: 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. --- tools/slang-test/slang-test-main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tools') 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 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 -- cgit v1.2.3