diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2014-10-07 15:34:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-10-07 19:27:34 (GMT) |
commit | 0c6330da38bb04467eaa4d38c659b02222029ae3 (patch) | |
tree | ad74fbb25eea7046f98f8fd7f703356dda6ca498 | |
parent | 9ba8bf123c0a5c8410580b059ec33af656a569b8 (diff) | |
download | CMake-0c6330da38bb04467eaa4d38c659b02222029ae3.zip CMake-0c6330da38bb04467eaa4d38c659b02222029ae3.tar.gz CMake-0c6330da38bb04467eaa4d38c659b02222029ae3.tar.bz2 |
ctest_memcheck: Add support for MemorySanitizer msan
-rw-r--r-- | Help/variable/CTEST_MEMORYCHECK_TYPE.rst | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 22 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.h | 1 |
3 files changed, 24 insertions, 1 deletions
diff --git a/Help/variable/CTEST_MEMORYCHECK_TYPE.rst b/Help/variable/CTEST_MEMORYCHECK_TYPE.rst index af759e9..f1087c0 100644 --- a/Help/variable/CTEST_MEMORYCHECK_TYPE.rst +++ b/Help/variable/CTEST_MEMORYCHECK_TYPE.rst @@ -4,4 +4,4 @@ CTEST_MEMORYCHECK_TYPE Specify the CTest ``MemoryCheckType`` setting in a :manual:`ctest(1)` dashboard client script. Valid values are Valgrind, Purify, BoundsChecker, and ThreadSanitizer, -AddressSanitizer, and UndefinedBehaviorSanitizer. +AddressSanitizer, MemorySanitizer, and UndefinedBehaviorSanitizer. diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index cc691aa..4835010 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -376,6 +376,9 @@ void cmCTestMemCheckHandler::GenerateDartOutput(std::ostream& os) case cmCTestMemCheckHandler::THREAD_SANITIZER: os << "ThreadSanitizer"; break; + case cmCTestMemCheckHandler::MEMORY_SANITIZER: + os << "MemorySanitizer"; + break; case cmCTestMemCheckHandler::UB_SANITIZER: os << "UndefinedBehaviorSanitizer"; break; @@ -556,6 +559,14 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() this->LogWithPID = true; // even if we give the log file the pid is added } if ( this->CTest->GetCTestConfiguration("MemoryCheckType") + == "MemorySanitizer") + { + this->MemoryTester + = this->CTest->GetCTestConfiguration("CMakeCommand").c_str(); + this->MemoryTesterStyle = cmCTestMemCheckHandler::MEMORY_SANITIZER; + this->LogWithPID = true; // even if we give the log file the pid is added + } + if ( this->CTest->GetCTestConfiguration("MemoryCheckType") == "UndefinedBehaviorSanitizer") { this->MemoryTester @@ -688,6 +699,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() // these are almost the same but the env var used is different case cmCTestMemCheckHandler::ADDRESS_SANITIZER: case cmCTestMemCheckHandler::THREAD_SANITIZER: + case cmCTestMemCheckHandler::MEMORY_SANITIZER: case cmCTestMemCheckHandler::UB_SANITIZER: { // To pass arguments to ThreadSanitizer the environment variable @@ -710,6 +722,11 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() { envVar = "TSAN_OPTIONS"; } + else if(this->MemoryTesterStyle == + cmCTestMemCheckHandler::MEMORY_SANITIZER) + { + envVar = "MSAN_OPTIONS"; + } else if(this->MemoryTesterStyle == cmCTestMemCheckHandler::UB_SANITIZER) { envVar = "UBSAN_OPTIONS"; @@ -753,6 +770,8 @@ ProcessMemCheckOutput(const std::string& str, this->MemoryTesterStyle == cmCTestMemCheckHandler::THREAD_SANITIZER || this->MemoryTesterStyle == + cmCTestMemCheckHandler::MEMORY_SANITIZER || + this->MemoryTesterStyle == cmCTestMemCheckHandler::UB_SANITIZER) { return this->ProcessMemCheckSanitizerOutput(str, log, results); @@ -801,6 +820,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( case cmCTestMemCheckHandler::THREAD_SANITIZER: regex = "WARNING: ThreadSanitizer: (.*) \\(pid=.*\\)"; break; + case cmCTestMemCheckHandler::MEMORY_SANITIZER: + regex = "WARNING: MemorySanitizer: (.*)"; + break; case cmCTestMemCheckHandler::UB_SANITIZER: regex = "runtime error: (.*)"; break; diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h index f5cc91c..69fdd9f 100644 --- a/Source/CTest/cmCTestMemCheckHandler.h +++ b/Source/CTest/cmCTestMemCheckHandler.h @@ -52,6 +52,7 @@ private: // checkers after here do not use the standard error list ADDRESS_SANITIZER, THREAD_SANITIZER, + MEMORY_SANITIZER, UB_SANITIZER }; public: |