summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestMemCheckHandler.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-10-03 17:45:07 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2014-10-03 17:45:07 (GMT)
commitca9cc25ce8c6f74998fd9f30d36449814c170ea5 (patch)
treea2b4ced445d53478efb84cab043b9325e25d7bc6 /Source/CTest/cmCTestMemCheckHandler.cxx
parent0b9ffffcd437c3538ff5aa1858d743a289b06129 (diff)
downloadCMake-ca9cc25ce8c6f74998fd9f30d36449814c170ea5.zip
CMake-ca9cc25ce8c6f74998fd9f30d36449814c170ea5.tar.gz
CMake-ca9cc25ce8c6f74998fd9f30d36449814c170ea5.tar.bz2
ctest: add support for additional sanitizer options
Sanitizers receive options through their environment variable; support user-specified options here.
Diffstat (limited to 'Source/CTest/cmCTestMemCheckHandler.cxx')
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx16
1 files changed, 11 insertions, 5 deletions
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;
}