diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2014-07-24 15:25:59 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2014-07-24 15:25:59 (GMT) |
commit | 5d40d88e0026824e237938a9e771206220857034 (patch) | |
tree | 03c10c39b1d7f898010a4df19fca963b2ca6fbe8 /Source | |
parent | afe21fc3c43af0c031a77b3b48041d35f248f481 (diff) | |
download | CMake-5d40d88e0026824e237938a9e771206220857034.zip CMake-5d40d88e0026824e237938a9e771206220857034.tar.gz CMake-5d40d88e0026824e237938a9e771206220857034.tar.bz2 |
Handle more than one process with sanitizer errors.
Since the Sanitizers write out one log file per process, a single
test might have more than one log file. This commit allows ctest
to read all of the log files found for a particual test.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 27 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.h | 4 |
2 files changed, 20 insertions, 11 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index ed57949..ced7982 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -1127,7 +1127,13 @@ cmCTestMemCheckHandler::PostProcessTest(cmCTestTestResult& res, } else { - this->AppendMemTesterOutput(res, test); + std::vector<std::string> files; + this->TestOutputFileNames(test, files); + for(std::vector<std::string>::iterator i = files.begin(); + i != files.end(); ++i) + { + this->AppendMemTesterOutput(res, *i); + } } } @@ -1141,11 +1147,13 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "PostProcessBoundsCheckerTest for : " << res.Name << std::endl); - std::string ofile = this->TestOutputFileName(test); - if ( ofile.empty() ) + std::vector<std::string> files; + this->TestOutputFileNames(test, files); + if ( files.size() == 0 ) { return; } + std::string ofile = files[0]; // put a scope around this to close ifs so the file can be removed { cmsys::ifstream ifs(ofile.c_str()); @@ -1175,9 +1183,8 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res, void cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res, - int test) + std::string const& ofile) { - std::string ofile = this->TestOutputFileName(test); if ( ofile.empty() ) { return; @@ -1205,8 +1212,9 @@ cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res, } } -std::string -cmCTestMemCheckHandler::TestOutputFileName(int test) +void cmCTestMemCheckHandler::TestOutputFileNames(int test, + std::vector<std::string>& + files) { std::string index; cmOStringStream stream; @@ -1229,7 +1237,8 @@ cmCTestMemCheckHandler::TestOutputFileName(int test) } else { - ofile = g.GetFiles()[0]; + files = g.GetFiles(); + return; } } else if ( !cmSystemTools::FileExists(ofile.c_str()) ) @@ -1239,5 +1248,5 @@ cmCTestMemCheckHandler::TestOutputFileName(int test) cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl); ofile = ""; } - return ofile; + files.push_back(ofile); } diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h index 2630fde..2195dab 100644 --- a/Source/CTest/cmCTestMemCheckHandler.h +++ b/Source/CTest/cmCTestMemCheckHandler.h @@ -145,10 +145,10 @@ private: ///! append MemoryTesterOutputFile to the test log void AppendMemTesterOutput(cmCTestTestHandler::cmCTestTestResult& res, - int test); + std::string const& filename); ///! generate the output filename for the given test index - std::string TestOutputFileName(int test); + void TestOutputFileNames(int test, std::vector<std::string>& files); }; #endif |