diff options
| author | bspeice <bspeice@users.noreply.github.com> | 2025-01-01 18:26:43 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-01 18:26:43 -0800 |
| commit | e3b71cf0356692bda5f0b3a06aed9d49ad3314a4 (patch) | |
| tree | 6bb5dd847275f5f940d974727ef738cd296bf6c3 /tools/slang-test/options.cpp | |
| parent | a13ef050996c2792ff3c16b6424d3a6336e56a58 (diff) | |
Allow explicit test root (#5980)
Diffstat (limited to 'tools/slang-test/options.cpp')
| -rw-r--r-- | tools/slang-test/options.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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; } |
