diff options
author | Jamie Snape <jamie.snape@kitware.com> | 2017-01-09 18:39:06 (GMT) |
---|---|---|
committer | Jamie Snape <jamie.snape@kitware.com> | 2017-01-09 18:39:06 (GMT) |
commit | cdacfbd255dcf640be7dd4971a1be616d015b3fd (patch) | |
tree | 7fcbb6bacca575c905e0a3c4f6b589819cdef342 | |
parent | cf590c1236e40eaff9fe76ec918fad33df4f6be4 (diff) | |
download | CMake-cdacfbd255dcf640be7dd4971a1be616d015b3fd.zip CMake-cdacfbd255dcf640be7dd4971a1be616d015b3fd.tar.gz CMake-cdacfbd255dcf640be7dd4971a1be616d015b3fd.tar.bz2 |
MEMORYCHECK_SUPPRESSIONS_FILE: add support for sanitizers
-rw-r--r-- | Help/release/dev/ctest_memcheck-leak_sanitizer.rst | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/Help/release/dev/ctest_memcheck-leak_sanitizer.rst b/Help/release/dev/ctest_memcheck-leak_sanitizer.rst index 0150da3..1348c278a 100644 --- a/Help/release/dev/ctest_memcheck-leak_sanitizer.rst +++ b/Help/release/dev/ctest_memcheck-leak_sanitizer.rst @@ -3,3 +3,7 @@ ctest_memcheck-leak_sanitizer * The :command:`ctest_memcheck` command learned to support ``LeakSanitizer`` independently from ``AddressSanitizer``. + +* The :command:`ctest_memcheck` command learned to read the location of + suppressions files for sanitizers from the + :variable:`CTEST_MEMORYCHECK_SUPPRESSIONS_FILE` variable. diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 5dec355..81b73aa 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -609,6 +609,12 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() std::string envVar; std::string extraOptions = this->CTest->GetCTestConfiguration("MemoryCheckSanitizerOptions"); + std::string suppressionsOption; + if (!this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile") + .empty()) { + suppressionsOption = " suppressions=" + + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile"); + } if (this->MemoryTesterStyle == cmCTestMemCheckHandler::ADDRESS_SANITIZER) { envVar = "ASAN_OPTIONS"; @@ -628,7 +634,8 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() } std::string outputFile = envVar + "=log_path=\"" + this->MemoryTesterOutputFile + "\" "; - this->MemoryTesterEnvironmentVariable = outputFile + extraOptions; + this->MemoryTesterEnvironmentVariable = + outputFile + extraOptions + suppressionsOption; break; } default: |