summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 8a30dc0..6e8091b 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -1364,9 +1364,15 @@ void cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
}
}
if (this->LogWithPID) {
- cmSystemTools::RemoveFile(ofile);
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Remove: " << ofile << "\n", this->Quiet);
+ auto pos = ofile.find_last_of('.');
+ if (pos != std::string::npos) {
+ auto ofileWithoutPid = ofile.substr(0, pos);
+ cmSystemTools::RenameFile(ofile, ofileWithoutPid);
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Renaming: " << ofile << " to: " << ofileWithoutPid
+ << "\n",
+ this->Quiet);
+ }
}
}