diff options
Diffstat (limited to 'tools/slang-test')
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index ea2c322ad..e007d1978 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -536,7 +536,7 @@ Result spawnAndWaitExe(TestContext* context, const String& testPath, const Comma if (options.shouldBeVerbose) { - String commandLine = ProcessUtil::getCommandLineString(cmdLine); + String commandLine = cmdLine.toString(); context->reporter->messageFormat(TestMessageType::Info, "%s\n", commandLine.begin()); } @@ -570,8 +570,7 @@ Result spawnAndWaitSharedLibrary(TestContext* context, const String& testPath, c testCmdLine.addArg(exeName); testCmdLine.m_args.addRange(cmdLine.m_args); - String testCmdLineString = ProcessUtil::getCommandLineString(testCmdLine); - context->reporter->messageFormat(TestMessageType::Info, "%s\n", testCmdLineString.getBuffer()); + context->reporter->messageFormat(TestMessageType::Info, "%s\n", testCmdLine.toString().getBuffer()); } auto func = context->getInnerMainFunc(context->options.binDir, exeName); @@ -636,14 +635,12 @@ Result spawnAndWaitProxy(TestContext* context, const String& testPath, const Com // Make the first arg the name of the tool to invoke cmdLine.m_args.insert(0, exeName); - - auto exePath = Path::combine(Path::getParentDirectory(inCmdLine.m_executable), String("test-proxy") + ProcessUtil::getExecutableSuffix()); - cmdLine.setExecutablePath(exePath); + cmdLine.setExecutable(context->exeDirectoryPath, "test-proxy"); const auto& options = context->options; if (options.shouldBeVerbose) { - String commandLine = ProcessUtil::getCommandLineString(cmdLine); + String commandLine = cmdLine.toString(); context->reporter->messageFormat(TestMessageType::Info, "%s\n", commandLine.begin()); } @@ -942,7 +939,7 @@ static RenderApiFlags _getAvailableRenderApiFlags(TestContext* context) } // Try starting up the device CommandLine cmdLine; - cmdLine.setExecutablePath(Path::combine(context->options.binDir, String("render-test") + ProcessUtil::getExecutableSuffix())); + cmdLine.setExecutable(context->options.binDir, "render-test"); _addRenderTestOptions(context->options, cmdLine); // We just want to see if the device can be started up cmdLine.addArg("-only-startup"); @@ -1086,7 +1083,7 @@ String findExpectedPath(const TestInput& input, const char* postFix) static void _initSlangCompiler(TestContext* context, CommandLine& ioCmdLine) { - ioCmdLine.setExecutablePath(Path::combine(context->options.binDir, String("slangc") + ProcessUtil::getExecutableSuffix())); + ioCmdLine.setExecutable(context->options.binDir, "slangc"); if (context->options.verbosePaths) { @@ -1123,7 +1120,7 @@ static SlangResult _executeBinary(const UnownedStringSlice& hexDump, ExecuteResu String fileName; SLANG_RETURN_ON_FAIL(File::generateTemporary(UnownedStringSlice("slang-test"), fileName)); - fileName.append(ProcessUtil::getExecutableSuffix()); + fileName.append(Process::getExecutableSuffix()); TemporaryFileSet temporaryFileSet; temporaryFileSet.add(fileName); @@ -1535,7 +1532,7 @@ TestResult runReflectionTest(TestContext* context, TestInput& input) CommandLine cmdLine; - cmdLine.setExecutablePath(Path::combine(options.binDir, String("slang-reflection-test") + ProcessUtil::getExecutableSuffix())); + cmdLine.setExecutable(options.binDir, "slang-reflection-test"); cmdLine.addArg(filePath); for( auto arg : input.testOptions->args ) @@ -1820,7 +1817,7 @@ static TestResult runCPPCompilerExecute(TestContext* context, TestInput& input) { StringBuilder moduleExePath; moduleExePath << modulePath; - moduleExePath << ProcessUtil::getExecutableSuffix(); + moduleExePath << Process::getExecutableSuffix(); File::remove(moduleExePath); } @@ -1855,7 +1852,7 @@ static TestResult runCPPCompilerExecute(TestContext* context, TestInput& input) CommandLine cmdLine; StringBuilder exePath; - exePath << modulePath << ProcessUtil::getExecutableSuffix(); + exePath << modulePath << Process::getExecutableSuffix(); cmdLine.setExecutablePath(exePath); @@ -2321,7 +2318,7 @@ TestResult runPerformanceProfile(TestContext* context, TestInput& input) CommandLine cmdLine; - cmdLine.setExecutablePath(Path::combine(context->options.binDir, String("render-test") + ProcessUtil::getExecutableSuffix())); + cmdLine.setExecutable(context->options.binDir, "render-test"); cmdLine.addArg(input.filePath); cmdLine.addArg("-performance-profile"); @@ -2474,7 +2471,7 @@ TestResult runComputeComparisonImpl(TestContext* context, TestInput& input, cons CommandLine cmdLine; - cmdLine.setExecutablePath(Path::combine(context->options.binDir, String("render-test") + ProcessUtil::getExecutableSuffix())); + cmdLine.setExecutable(context->options.binDir, "render-test"); cmdLine.addArg(filePath999); _addRenderTestOptions(context->options, cmdLine); @@ -2582,7 +2579,7 @@ TestResult doRenderComparisonTestRun(TestContext* context, TestInput& input, cha CommandLine cmdLine; - cmdLine.setExecutablePath(Path::combine(context->options.binDir, String("render-test") + ProcessUtil::getExecutableSuffix())); + cmdLine.setExecutable(context->options.binDir, "render-test"); cmdLine.addArg(filePath); _addRenderTestOptions(context->options, cmdLine); @@ -3424,6 +3421,8 @@ static SlangResult runUnitTestModule(TestContext* context, TestOptions& testOpti unitTestContext.slangGlobalSession = context->getSession(); unitTestContext.workDirectory = ""; unitTestContext.enabledApis = context->options.enabledApis; + unitTestContext.executableDirectory = context->exeDirectoryPath.getBuffer(); + auto testCount = testModule->getTestCount(); for (SlangInt i = 0; i < testCount; i++) |
