diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/slang-test/options.cpp | 4 | ||||
| -rw-r--r-- | tools/slang-test/options.h | 3 | ||||
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 28 |
3 files changed, 27 insertions, 8 deletions
diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp index 0a6023733..70b7a4533 100644 --- a/tools/slang-test/options.cpp +++ b/tools/slang-test/options.cpp @@ -134,6 +134,10 @@ static bool _isSubCommand(const char* arg) { optionsOut->shouldBeVerbose = true; } + else if (strcmp(arg, "-verbose-paths") == 0) + { + optionsOut->verbosePaths = true; + } else if (strcmp(arg, "-generate-hlsl-baselines") == 0) { optionsOut->generateHLSLBaselines = true; diff --git a/tools/slang-test/options.h b/tools/slang-test/options.h index 4858ffd03..77460e190 100644 --- a/tools/slang-test/options.h +++ b/tools/slang-test/options.h @@ -49,6 +49,9 @@ struct Options // generate extra output (notably: command lines we run) bool shouldBeVerbose = false; + // Use verbose paths + bool verbosePaths = false; + // force generation of baselines for HLSL tests bool generateHLSLBaselines = false; diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index d0da4fc61..cbd2974da 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -519,6 +519,15 @@ String findExpectedPath(const TestInput& input, const char* postFix) return ""; } +static void _initSlangCompiler(TestContext* context, OSProcessSpawner& spawnerOut) +{ + spawnerOut.pushExecutablePath(String(context->options.binDir) + "slangc" + osGetExecutableSuffix()); + + if (context->options.verbosePaths) + { + spawnerOut.pushArgument("-verbose-paths"); + } +} TestResult runSimpleTest(TestContext* context, TestInput& input) { @@ -528,8 +537,8 @@ TestResult runSimpleTest(TestContext* context, TestInput& input) auto outputStem = input.outputStem; OSProcessSpawner spawner; + _initSlangCompiler(context, spawner); - spawner.pushExecutablePath(String(context->options.binDir) + "slangc" + osGetExecutableSuffix()); spawner.pushArgument(filePath999); for( auto arg : input.testOptions->args ) @@ -699,6 +708,8 @@ static SlangCompileTarget _getCompileTarget(const UnownedStringSlice& name) return SLANG_TARGET_UNKNOWN; } + + TestResult runCrossCompilerTest(TestContext* context, TestInput& input) { // need to execute the stand-alone Slang compiler on the file @@ -710,11 +721,11 @@ TestResult runCrossCompilerTest(TestContext* context, TestInput& input) OSProcessSpawner actualSpawner; OSProcessSpawner expectedSpawner; - actualSpawner.pushExecutablePath(String(context->options.binDir) + "slangc" + osGetExecutableSuffix()); - expectedSpawner.pushExecutablePath(String(context->options.binDir) + "slangc" + osGetExecutableSuffix()); - + _initSlangCompiler(context, actualSpawner); + _initSlangCompiler(context, expectedSpawner); + actualSpawner.pushArgument(filePath); - + const auto& args = input.testOptions->args; const UInt targetIndex = args.IndexOf("-target"); @@ -821,7 +832,8 @@ TestResult generateHLSLBaseline(TestContext* context, TestInput& input) auto outputStem = input.outputStem; OSProcessSpawner spawner; - spawner.pushExecutablePath(String(context->options.binDir) + "slangc" + osGetExecutableSuffix()); + _initSlangCompiler(context, spawner); + spawner.pushArgument(filePath999); for( auto arg : input.testOptions->args ) @@ -866,8 +878,8 @@ TestResult runHLSLComparisonTest(TestContext* context, TestInput& input) // need to execute the stand-alone Slang compiler on the file, and compare its output to what we expect OSProcessSpawner spawner; + _initSlangCompiler(context, spawner); - spawner.pushExecutablePath(String(context->options.binDir) + "slangc" + osGetExecutableSuffix()); spawner.pushArgument(filePath999); for( auto arg : input.testOptions->args ) @@ -967,8 +979,8 @@ TestResult doGLSLComparisonTestRun(TestContext* context, auto outputStem = input.outputStem; OSProcessSpawner spawner; + _initSlangCompiler(context, spawner); - spawner.pushExecutablePath(String(context->options.binDir) + "slangc" + osGetExecutableSuffix()); spawner.pushArgument(filePath999); if( langDefine ) |
