From 573aefb65255e734a406daf030ece19913adc09a Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Thu, 20 Jul 2023 10:17:26 +0530 Subject: [PATCH] SWDEV-404873 - Add double quotes that handles space in path for windows OS. (#371) Change-Id: I4752072914aded5e39105913f5bd79fcaf4b499b --- catch/include/hip_test_process.hh | 7 +++++++ 1 file changed, 7 insertions(+) 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) {