diff options
author | Betsy McPhail <betsy.mcphail@kitware.com> | 2016-11-04 20:51:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-09 20:34:07 (GMT) |
commit | 3a523eec7814dfbed2361da298849a5b5964318a (patch) | |
tree | 2ed1c49fd6a61b4d11961a0c333a31390c06a57c /Source/CTest/cmCTestMemCheckCommand.cxx | |
parent | 60d80bca4afcfb3a38b588a5a2060cc275b4afbc (diff) | |
download | CMake-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/cmCTestMemCheckCommand.cxx')
-rw-r--r-- | Source/CTest/cmCTestMemCheckCommand.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestMemCheckCommand.cxx b/Source/CTest/cmCTestMemCheckCommand.cxx index 05d0a53..5e4c5ae 100644 --- a/Source/CTest/cmCTestMemCheckCommand.cxx +++ b/Source/CTest/cmCTestMemCheckCommand.cxx @@ -4,6 +4,15 @@ #include "cmCTest.h" #include "cmCTestGenericHandler.h" +#include "cmCTestMemCheckHandler.h" +#include "cmMakefile.h" + +cmCTestMemCheckCommand::cmCTestMemCheckCommand() +{ + this->Arguments[ctm_DEFECT_COUNT] = "DEFECT_COUNT"; + this->Arguments[ctm_LAST] = CM_NULLPTR; + this->Last = ctm_LAST; +} cmCTestGenericHandler* cmCTestMemCheckCommand::InitializeActualHandler() { @@ -28,3 +37,14 @@ cmCTestGenericHandler* cmCTestMemCheckCommand::InitializeActualHandler() handler->SetQuiet(this->Quiet); return handler; } + +void cmCTestMemCheckCommand::ProcessAdditionalValues( + cmCTestGenericHandler* handler) +{ + if (this->Values[ctm_DEFECT_COUNT] && *this->Values[ctm_DEFECT_COUNT]) { + std::ostringstream str; + str << static_cast<cmCTestMemCheckHandler*>(handler)->GetDefectCount(); + this->Makefile->AddDefinition(this->Values[ctm_DEFECT_COUNT], + str.str().c_str()); + } +} |