From e3b71cf0356692bda5f0b3a06aed9d49ad3314a4 Mon Sep 17 00:00:00 2001 From: bspeice Date: Wed, 1 Jan 2025 18:26:43 -0800 Subject: Allow explicit test root (#5980) --- tools/slang-test/slang-test-main.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tools/slang-test/slang-test-main.cpp') diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 376d0e0bd..0987cbf80 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -4427,10 +4427,10 @@ void runTestsInParallel(TestContext* context, int count, const F& f) context->setTestReporter(originalReporter); } -void runTestsInDirectory(TestContext* context, String directoryPath) +void runTestsInDirectory(TestContext* context) { List files; - getFilesInDirectory(directoryPath, files); + getFilesInDirectory(context->options.testDir, files); auto processFile = [&](String file) { if (shouldRunTest(context, file)) @@ -4865,9 +4865,7 @@ SlangResult innerMain(int argc, char** argv) { TestReporter::SuiteScope suiteScope(&reporter, "tests"); // Enumerate test files according to policy - // TODO: add more directories to this list - // TODO: allow for a command-line argument to select a particular directory - runTestsInDirectory(&context, "tests/"); + runTestsInDirectory(&context); } // Run the unit tests (these are internal C++ tests - not specified via files in a -- cgit v1.2.3