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/options.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tools/slang-test/options.cpp') diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp index 10f98f3a2..9dd831afa 100644 --- a/tools/slang-test/options.cpp +++ b/tools/slang-test/options.cpp @@ -327,6 +327,15 @@ static bool _isSubCommand(const char* arg) optionsOut->expectedFailureList.add(line); } } + else if (strcmp(arg, "-test-dir") == 0) + { + if (argCursor == argEnd) + { + stdError.print("error: expected operand for '%s'\n", arg); + return SLANG_FAIL; + } + optionsOut->testDir = *argCursor++; + } else { stdError.print("unknown option '%s'\n", arg); @@ -365,5 +374,11 @@ static bool _isSubCommand(const char* arg) } } + if (optionsOut->testDir.getLength() == 0) + { + // If the test directory isn't set, use the "tests" directory + optionsOut->testDir = String("tests/"); + } + return SLANG_OK; } -- cgit v1.2.3