summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Dac <pawel.dac@gmail.com>2021-01-13 18:22:54 (GMT)
committerPawel Dac <pawel.dac@gmail.com>2021-01-13 21:08:53 (GMT)
commit54866346de24d46896bc22d717200035db9115bc (patch)
treee6d8f8b78ac286a5e1562c5fbe03acece2404267
parent438ed46c13bb5fccb5d1b518dab69b6232f79400 (diff)
downloadCMake-54866346de24d46896bc22d717200035db9115bc.zip
CMake-54866346de24d46896bc22d717200035db9115bc.tar.gz
CMake-54866346de24d46896bc22d717200035db9115bc.tar.bz2
CTest: Save sanitizer output files after test execution
Prior to this change after tests were executed output files produced by sanitizers were removed. User couldn't check in detail why test case didn't pass. Output files are kept without pid in the end.
-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);
+ }
}
}