diff options
author | Jamie Snape <jamie.snape@kitware.com> | 2017-01-09 18:15:42 (GMT) |
---|---|---|
committer | Jamie Snape <jamie.snape@kitware.com> | 2017-01-09 18:15:42 (GMT) |
commit | cf590c1236e40eaff9fe76ec918fad33df4f6be4 (patch) | |
tree | e58ec1d802d001a620a2b5603f08f4320e1e996d /Source/CTest/cmCTestMemCheckHandler.cxx | |
parent | 976574b01009e11326c7894edf35a4f315b216d4 (diff) | |
download | CMake-cf590c1236e40eaff9fe76ec918fad33df4f6be4.zip CMake-cf590c1236e40eaff9fe76ec918fad33df4f6be4.tar.gz CMake-cf590c1236e40eaff9fe76ec918fad33df4f6be4.tar.bz2 |
ctest_memcheck: add support for standalone LeakSanitizer
Diffstat (limited to 'Source/CTest/cmCTestMemCheckHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 2c31f60..5dec355 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -305,6 +305,9 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml) case cmCTestMemCheckHandler::ADDRESS_SANITIZER: xml.Attribute("Checker", "AddressSanitizer"); break; + case cmCTestMemCheckHandler::LEAK_SANITIZER: + xml.Attribute("Checker", "LeakSanitizer"); + break; case cmCTestMemCheckHandler::THREAD_SANITIZER: xml.Attribute("Checker", "ThreadSanitizer"); break; @@ -459,6 +462,12 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() this->LogWithPID = true; // even if we give the log file the pid is added } if (this->CTest->GetCTestConfiguration("MemoryCheckType") == + "LeakSanitizer") { + this->MemoryTester = this->CTest->GetCTestConfiguration("CMakeCommand"); + this->MemoryTesterStyle = cmCTestMemCheckHandler::LEAK_SANITIZER; + this->LogWithPID = true; // even if we give the log file the pid is added + } + if (this->CTest->GetCTestConfiguration("MemoryCheckType") == "ThreadSanitizer") { this->MemoryTester = this->CTest->GetCTestConfiguration("CMakeCommand"); this->MemoryTesterStyle = cmCTestMemCheckHandler::THREAD_SANITIZER; @@ -586,6 +595,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() } // these are almost the same but the env var used is different case cmCTestMemCheckHandler::ADDRESS_SANITIZER: + case cmCTestMemCheckHandler::LEAK_SANITIZER: case cmCTestMemCheckHandler::THREAD_SANITIZER: case cmCTestMemCheckHandler::MEMORY_SANITIZER: case cmCTestMemCheckHandler::UB_SANITIZER: { @@ -604,6 +614,9 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() envVar = "ASAN_OPTIONS"; extraOptions += " detect_leaks=1"; } else if (this->MemoryTesterStyle == + cmCTestMemCheckHandler::LEAK_SANITIZER) { + envVar = "LSAN_OPTIONS"; + } else if (this->MemoryTesterStyle == cmCTestMemCheckHandler::THREAD_SANITIZER) { envVar = "TSAN_OPTIONS"; } else if (this->MemoryTesterStyle == @@ -644,6 +657,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckOutput(const std::string& str, case cmCTestMemCheckHandler::PURIFY: return this->ProcessMemCheckPurifyOutput(str, log, results); case cmCTestMemCheckHandler::ADDRESS_SANITIZER: + case cmCTestMemCheckHandler::LEAK_SANITIZER: case cmCTestMemCheckHandler::THREAD_SANITIZER: case cmCTestMemCheckHandler::MEMORY_SANITIZER: case cmCTestMemCheckHandler::UB_SANITIZER: @@ -680,6 +694,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( case cmCTestMemCheckHandler::ADDRESS_SANITIZER: regex = "ERROR: AddressSanitizer: (.*) on.*"; break; + case cmCTestMemCheckHandler::LEAK_SANITIZER: + // use leakWarning regex + break; case cmCTestMemCheckHandler::THREAD_SANITIZER: regex = "WARNING: ThreadSanitizer: (.*) \\(pid=.*\\)"; break; |