diff options
Diffstat (limited to 'Source/CTest/cmCTestMemCheckHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index b37db30..0f27fac 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -127,6 +127,7 @@ void cmCTestMemCheckHandler::Initialize() this->MemoryTesterOptions.clear(); this->MemoryTesterStyle = UNKNOWN; this->MemoryTesterOutputFile = ""; + this->DefectCount = 0; } int cmCTestMemCheckHandler::PreProcessHandler() @@ -279,6 +280,11 @@ void cmCTestMemCheckHandler::PopulateCustomVectors(cmMakefile* mf) this->Quiet); } +int cmCTestMemCheckHandler::GetDefectCount() +{ + return this->DefectCount; +} + void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml) { if (!this->CTest->GetProduceXML()) { @@ -354,7 +360,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml) xml.EndElement(); // Results xml.StartElement("Log"); - if (this->CTest->ShouldCompressMemCheckOutput()) { + if (this->CTest->ShouldCompressTestOutput()) { this->CTest->CompressString(memcheckstr); xml.Attribute("compression", "gzip"); xml.Attribute("encoding", "base64"); @@ -375,11 +381,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml) xml.StartElement("DefectList"); for (cc = 0; cc < this->GlobalResults.size(); cc++) { if (this->GlobalResults[cc]) { -#ifdef cerr -#undef cerr -#endif std::cerr.width(35); -#define cerr no_cerr cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, this->ResultStringsLong[cc] << " - " << this->GlobalResults[cc] << std::endl, @@ -706,6 +708,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( ostr << *i << std::endl; } log = ostr.str(); + this->DefectCount += defects; return defects == 0; } bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( @@ -747,6 +750,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( } log = ostr.str(); + this->DefectCount += defects; return defects == 0; } @@ -882,6 +886,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( << (cmSystemTools::GetTime() - sttime) << std::endl, this->Quiet); log = ostr.str(); + this->DefectCount += defects; return defects == 0; } @@ -927,9 +932,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput( // only put the output of Bounds Checker if there were // errors or leaks detected log = parser.Log; - return false; } - return true; + this->DefectCount += defects; + return defects == 0; } // PostProcessTest memcheck results |