SWDEV-348686 - Add extension on windows platform for executable path. (#2845)
Change-Id: Id7a9b6ec49e8f210b0a74b5f5fd68d584f005b4e
[ROCm/hip commit: 768f186d69]
Esse commit está contido em:
commit de
GitHub
pai
532ebaf63e
commit
94f8b620e4
@@ -66,7 +66,12 @@ class SpawnProc {
|
||||
auto dir = fs::path(TestContext::get().currentPath());
|
||||
dir /= exeName;
|
||||
exeName = dir.string();
|
||||
|
||||
// On Windows, fs::exists returns false without extension.
|
||||
if (TestContext::get().isWindows()) {
|
||||
if(fs::path(exeName).extension().empty()) {
|
||||
exeName += ".exe";
|
||||
}
|
||||
}
|
||||
INFO("Testing that exe exists: " << exeName);
|
||||
REQUIRE(fs::exists(exeName));
|
||||
|
||||
@@ -92,13 +97,13 @@ class SpawnProc {
|
||||
execCmd += " > ";
|
||||
execCmd += tmpFileName;
|
||||
}
|
||||
|
||||
auto res = std::system(execCmd.c_str());
|
||||
|
||||
if (captureOutput) {
|
||||
std::ifstream t(tmpFileName.c_str());
|
||||
resultStr =
|
||||
std::string((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>());
|
||||
t.close();
|
||||
}
|
||||
#if HT_LINUX
|
||||
return WEXITSTATUS(res);
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário