diff options
author | Brad King <brad.king@kitware.com> | 2014-10-07 18:45:26 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-10-07 18:45:26 (GMT) |
commit | fa56eb56b979214233da3937b7e0d5789d4c9cf6 (patch) | |
tree | c2cc9f109f1fa0d28001ef713a55445da140ef1b /Source | |
parent | 36c7f6620687752a2143f69688b0df3c9f7217f7 (diff) | |
parent | f25e431d6efc2f03b49e15c831df9ee17594eea2 (diff) | |
download | CMake-fa56eb56b979214233da3937b7e0d5789d4c9cf6.zip CMake-fa56eb56b979214233da3937b7e0d5789d4c9cf6.tar.gz CMake-fa56eb56b979214233da3937b7e0d5789d4c9cf6.tar.bz2 |
Merge topic 'ctest-memcheck-sanitizers'
f25e431d tests: set sanitizer options properly
f0661bf3 tests: fix copy/paste from tsan -> asan comments
ca9cc25c ctest: add support for additional sanitizer options
0b9ffffc ctest: update documentation for CTEST_MEMORYCHECK_TYPE
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestMemCheckCommand.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 16 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.h | 2 |
3 files changed, 14 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestMemCheckCommand.cxx b/Source/CTest/cmCTestMemCheckCommand.cxx index 939b4dc..f144066 100644 --- a/Source/CTest/cmCTestMemCheckCommand.cxx +++ b/Source/CTest/cmCTestMemCheckCommand.cxx @@ -23,6 +23,8 @@ cmCTestGenericHandler* cmCTestMemCheckCommand::InitializeActualHandler() this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "MemoryCheckType", "CTEST_MEMORYCHECK_TYPE"); this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, + "MemoryCheckSanitizerOptions", "CTEST_MEMORYCHECK_SANITIZER_OPTIONS"); + this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "MemoryCheckCommand", "CTEST_MEMORYCHECK_COMMAND"); this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "MemoryCheckCommandOptions", "CTEST_MEMORYCHECK_COMMAND_OPTIONS"); diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index a7ab077..16ac37c 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -686,15 +686,21 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() // TSAN_OPTIONS string with the log_path in it. this->MemoryTesterDynamicOptions.push_back("-E"); this->MemoryTesterDynamicOptions.push_back("env"); - std::string envVar = "TSAN_OPTIONS"; - std::string extraOptions; - if(this->MemoryTesterStyle == cmCTestMemCheckHandler::ADDRESS_SANITIZER) + std::string envVar; + std::string extraOptions = + this->CTest->GetCTestConfiguration("MemoryCheckSanitizerOptions"); + if(this->MemoryTesterStyle == cmCTestMemCheckHandler::THREAD_SANITIZER) + { + envVar = "TSAN_OPTIONS"; + } + else if(this->MemoryTesterStyle == + cmCTestMemCheckHandler::ADDRESS_SANITIZER) { envVar = "ASAN_OPTIONS"; - extraOptions = " detect_leaks=1"; + extraOptions += " detect_leaks=1"; } std::string outputFile = envVar + "=log_path=\"" - + this->MemoryTesterOutputFile + "\""; + + this->MemoryTesterOutputFile + "\" "; this->MemoryTesterEnvironmentVariable = outputFile + extraOptions; break; } diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h index 2195dab..f442376 100644 --- a/Source/CTest/cmCTestMemCheckHandler.h +++ b/Source/CTest/cmCTestMemCheckHandler.h @@ -49,7 +49,7 @@ private: VALGRIND, PURIFY, BOUNDS_CHECKER, - // checkers after hear do not use the standard error list + // checkers after here do not use the standard error list THREAD_SANITIZER, ADDRESS_SANITIZER }; |