diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/slang-test/options.cpp | 10 | ||||
| -rw-r--r-- | tools/slang-test/options.h | 2 | ||||
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 15 |
3 files changed, 25 insertions, 2 deletions
diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp index 27b759a0e..875f9ef0b 100644 --- a/tools/slang-test/options.cpp +++ b/tools/slang-test/options.cpp @@ -266,6 +266,16 @@ static bool _isSubCommand(const char* arg) return res; } } + else if (strcmp(arg, "-nv-api-path") == 0) + { + if (argCursor == argEnd) + { + stdError.print("error: expected operand for '%s'\n", arg); + return SLANG_FAIL; + } + + optionsOut->nvAPIPath = *argCursor++; + } else { stdError.print("unknown option '%s'\n", arg); diff --git a/tools/slang-test/options.h b/tools/slang-test/options.h index a8c2e3852..ddd905e64 100644 --- a/tools/slang-test/options.h +++ b/tools/slang-test/options.h @@ -98,6 +98,8 @@ struct Options // The adapter to use. If empty will match first found adapter. Slang::String adapter; + Slang::String nvAPIPath; + /// Parse the args, report any errors into stdError, and write the results into optionsOut static SlangResult parse(int argc, char** argv, TestCategorySet* categorySet, Slang::WriterHelper stdError, Options* optionsOut); }; diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 9ef013aad..c6562ed86 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -3191,8 +3191,6 @@ SlangResult innerMain(int argc, char** argv) TestContext context; SLANG_RETURN_ON_FAIL(SLANG_FAILED(context.init())) - TestToolUtil::setSessionDefaultPrelude(argv[0], context.getSession()); - auto& categorySet = context.categorySet; // Set up our test categories here @@ -3272,6 +3270,19 @@ SlangResult innerMain(int argc, char** argv) Options& options = context.options; + // Set up the prelude + { + TestToolUtil::PreludeInfo info; + info.exePath = argv[0]; + + if (options.nvAPIPath.getLength()) + { + info.nvAPIPath = options.nvAPIPath.getBuffer(); + } + + TestToolUtil::setSessionDefaultPrelude(info, context.getSession()); + } + if (options.outputMode == TestOutputMode::TeamCity) { // On TeamCity CI there is an issue with unix/linux targets where test system may be different from the build system |
