diff options
author | Brad King <brad.king@kitware.com> | 2016-11-17 14:40:26 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-11-17 14:40:26 (GMT) |
commit | 8dd3c319c9baa60459df6b368440d8a7f0857580 (patch) | |
tree | 1acb8078e514a87675bcdf161c25809b5f1cdf6d /Source | |
parent | 837d1359ee4d227476154d81de41f4af5ecf2c7c (diff) | |
parent | f0d50957b9c75963222c084c09295e63a45f08f5 (diff) | |
download | CMake-8dd3c319c9baa60459df6b368440d8a7f0857580.zip CMake-8dd3c319c9baa60459df6b368440d8a7f0857580.tar.gz CMake-8dd3c319c9baa60459df6b368440d8a7f0857580.tar.bz2 |
Merge topic 'improve_ctest_memcheck_output'
f0d50957 ctest: Improve output for `-T memcheck`
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 0f27fac..2c31f60 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -329,10 +329,8 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml) } xml.EndElement(); // TestList cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - "-- Processing memory checking output: ", this->Quiet); + "-- Processing memory checking output:\n", this->Quiet); size_t total = this->TestResults.size(); - size_t step = total / 10; - size_t current = 0; for (cc = 0; cc < this->TestResults.size(); cc++) { cmCTestTestResult* result = &this->TestResults[cc]; std::string memcheckstr; @@ -347,18 +345,29 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml) static_cast<size_t>(this->CustomMaximumFailedTestOutputSize)); this->WriteTestResultHeader(xml, result); xml.StartElement("Results"); + int memoryErrors = 0; for (std::vector<int>::size_type kk = 0; kk < memcheckresults.size(); ++kk) { if (memcheckresults[kk]) { xml.StartElement("Defect"); xml.Attribute("type", this->ResultStringsLong[kk]); xml.Content(memcheckresults[kk]); + memoryErrors += memcheckresults[kk]; xml.EndElement(); // Defect } this->GlobalResults[kk] += memcheckresults[kk]; } xml.EndElement(); // Results - + if (memoryErrors > 0) { + const int maxTestNameWidth = this->CTest->GetMaxTestNameWidth(); + std::string outname = result->Name + " "; + outname.resize(maxTestNameWidth + 4, '.'); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, cc + 1 + << "/" << total << " MemCheck: #" + << result->TestCount << ": " << outname + << " Defects: " << memoryErrors << std::endl, + this->Quiet); + } xml.StartElement("Log"); if (this->CTest->ShouldCompressTestOutput()) { this->CTest->CompressString(memcheckstr); @@ -369,13 +378,16 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml) xml.EndElement(); // Log this->WriteTestResultFooter(xml, result); - if (current < cc) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "#" << std::flush, - this->Quiet); - current += step; - } } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, std::endl, this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "MemCheck log files can be found here: " + "( * corresponds to test number)" + << std::endl, + this->Quiet); + std::string output = this->MemoryTesterOutputFile; + cmSystemTools::ReplaceString(output, "??", "*"); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, output << std::endl, + this->Quiet); cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Memory checking results:" << std::endl, this->Quiet); xml.StartElement("DefectList"); |