diff --git a/catch/include/hip_test_process.hh b/catch/include/hip_test_process.hh index e65be29d7e..ee5facd704 100644 --- a/catch/include/hip_test_process.hh +++ b/catch/include/hip_test_process.hh @@ -85,6 +85,10 @@ class SpawnProc { INFO("Testing that capture file does not exist already: " << tmpFileName); REQUIRE(!fs::exists(tmpFileName)); } + if (TestContext::get().isWindows()) { + exeName = (exeName.find(" ", 0) == std::string::npos) ? exeName : ("\"" + exeName + "\""); + tmpFileName = (tmpFileName.find(" ", 0) == std::string::npos) ? tmpFileName : ("\"" + tmpFileName + "\""); + } } int run(std::string commandLineArgs = "") { @@ -100,6 +104,9 @@ class SpawnProc { execCmd += " > "; execCmd += tmpFileName; } + if (TestContext::get().isWindows()) { + execCmd = (execCmd.find(" ", 0) == std::string::npos) ? execCmd : ("\"" + execCmd + "\""); + } auto res = std::system(execCmd.c_str()); if (captureOutput) {