diff options
author | Brad King <brad.king@kitware.com> | 2014-08-05 13:22:35 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-08-05 13:22:35 (GMT) |
commit | 6548e171e36b91af6dcbbe8c5e265cd37b8a2a5f (patch) | |
tree | 7f42ef168666dbd1c2cade16e243ada5259ada32 | |
parent | 99f6eab8514214d873d7b4f5161e1062ea50829f (diff) | |
parent | b35a7730ce8c6ce853d359654d436334c452aec6 (diff) | |
download | CMake-6548e171e36b91af6dcbbe8c5e265cd37b8a2a5f.zip CMake-6548e171e36b91af6dcbbe8c5e265cd37b8a2a5f.tar.gz CMake-6548e171e36b91af6dcbbe8c5e265cd37b8a2a5f.tar.bz2 |
Merge topic 'fix_truncation_logic_valgrind_output'
b35a7730 Fix truncation of valgrind output logic.
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index ced7982..a7ab077 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -932,7 +932,6 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( double sttime = cmSystemTools::GetTime(); cmCTestLog(this->CTest, DEBUG, "Start test: " << lines.size() << std::endl); std::string::size_type totalOutputSize = 0; - bool outputFull = false; for ( cc = 0; cc < lines.size(); cc ++ ) { cmCTestLog(this->CTest, DEBUG, "test line " @@ -1019,32 +1018,30 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( } } // Now put all all the non valgrind output into the test output - if(!outputFull) + // This should be last in case it gets truncated by the output + // limiting code + for(std::vector<std::string::size_type>::iterator i = + nonValGrindOutput.begin(); i != nonValGrindOutput.end(); ++i) { - for(std::vector<std::string::size_type>::iterator i = - nonValGrindOutput.begin(); i != nonValGrindOutput.end(); ++i) + totalOutputSize += lines[*i].size(); + cmCTestLog(this->CTest, DEBUG, "before xml safe " + << lines[*i] << std::endl); + cmCTestLog(this->CTest, DEBUG, "after xml safe " + << cmXMLSafe(lines[*i]) << std::endl); + ostr << cmXMLSafe(lines[*i]) << std::endl; + if(!unlimitedOutput && totalOutputSize > + static_cast<size_t>(this->CustomMaximumFailedTestOutputSize)) { - totalOutputSize += lines[*i].size(); - cmCTestLog(this->CTest, DEBUG, "before xml safe " - << lines[*i] << std::endl); - cmCTestLog(this->CTest, DEBUG, "after xml safe " - << cmXMLSafe(lines[*i]) << std::endl); - - ostr << cmXMLSafe(lines[*i]) << std::endl; - if(!unlimitedOutput && totalOutputSize > - static_cast<size_t>(this->CustomMaximumFailedTestOutputSize)) - { - outputFull = true; - ostr << "....\n"; - ostr << "Test Output for this test has been truncated see testing" - " machine logs for full output,\n"; - ostr << "or put CTEST_FULL_OUTPUT in the output of " - "this test program.\n"; - } + ostr << "....\n"; + ostr << "Test Output for this test has been truncated see testing" + " machine logs for full output,\n"; + ostr << "or put CTEST_FULL_OUTPUT in the output of " + "this test program.\n"; + break; // stop the copy of output if we are full } } cmCTestLog(this->CTest, DEBUG, "End test (elapsed: " - << (cmSystemTools::GetTime() - sttime) << std::endl); + << (cmSystemTools::GetTime() - sttime) << std::endl); log = ostr.str(); if ( defects ) { |