summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestMemCheckHandler.cxx
diff options
context:
space:
mode:
authorBetsy McPhail <betsy.mcphail@kitware.com>2016-11-04 20:51:42 (GMT)
committerBrad King <brad.king@kitware.com>2016-11-09 20:34:07 (GMT)
commit3a523eec7814dfbed2361da298849a5b5964318a (patch)
tree2ed1c49fd6a61b4d11961a0c333a31390c06a57c /Source/CTest/cmCTestMemCheckHandler.cxx
parent60d80bca4afcfb3a38b588a5a2060cc275b4afbc (diff)
downloadCMake-3a523eec7814dfbed2361da298849a5b5964318a.zip
CMake-3a523eec7814dfbed2361da298849a5b5964318a.tar.gz
CMake-3a523eec7814dfbed2361da298849a5b5964318a.tar.bz2
ctest_memcheck: Add DEFECT_COUNT option to capture defect count
Diffstat (limited to 'Source/CTest/cmCTestMemCheckHandler.cxx')
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 0052a16..c18e20c 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()) {
@@ -702,6 +708,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput(
ostr << *i << std::endl;
}
log = ostr.str();
+ this->DefectCount += defects;
return defects == 0;
}
bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
@@ -743,6 +750,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
}
log = ostr.str();
+ this->DefectCount += defects;
return defects == 0;
}
@@ -878,6 +886,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
<< (cmSystemTools::GetTime() - sttime) << std::endl,
this->Quiet);
log = ostr.str();
+ this->DefectCount += defects;
return defects == 0;
}
@@ -923,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