summaryrefslogtreecommitdiffstats
path: root/Tests/CTestTestMemcheck
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-23 13:44:32 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-07-23 13:44:32 (GMT)
commitea3e544098232edcaddf11c5fee5819256c92936 (patch)
treeb18af63498c4bcb144602a3bc3b197a77dd72d74 /Tests/CTestTestMemcheck
parenta263cab6c22ecfdd18ed592b9efb2d8a8c505852 (diff)
parentf7d62cac79f856c9c7b634ed7f5d2f6030b7ba76 (diff)
downloadCMake-ea3e544098232edcaddf11c5fee5819256c92936.zip
CMake-ea3e544098232edcaddf11c5fee5819256c92936.tar.gz
CMake-ea3e544098232edcaddf11c5fee5819256c92936.tar.bz2
Merge topic 'fix_sanitizer_test_to_work_with_sanitizer'
f7d62cac Fix leak and address sanitizer tests to be able to run with real tools.
Diffstat (limited to 'Tests/CTestTestMemcheck')
-rw-r--r--Tests/CTestTestMemcheck/CMakeLists.txt4
-rw-r--r--Tests/CTestTestMemcheck/testAddressSanitizer.cmake4
-rw-r--r--Tests/CTestTestMemcheck/testLeakSanitizer.cmake4
3 files changed, 10 insertions, 2 deletions
diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt
index f436706..3ad0b26 100644
--- a/Tests/CTestTestMemcheck/CMakeLists.txt
+++ b/Tests/CTestTestMemcheck/CMakeLists.txt
@@ -121,7 +121,7 @@ set(CTEST_EXTRA_CODE)
# add LeakSanitizer test
set(CTEST_EXTRA_CODE
-"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"report_bugs=1 history_size=5 exitcode=55\")
+"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"simulate_sanitizer=1 report_bugs=1 history_size=5 exitcode=55\")
")
set(CMAKELISTS_EXTRA_CODE
@@ -136,7 +136,7 @@ set_tests_properties(CTestTestMemcheckDummyLeakSanitizer PROPERTIES
".*Memory checking results:.*Direct leak - 2.*Indirect leak - 1.*")
# add AddressSanitizer test
set(CTEST_EXTRA_CODE
-"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"report_bugs=1 history_size=5 exitcode=55\")
+"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"simulate_sanitizer=1 report_bugs=1 history_size=5 exitcode=55\")
")
set(CMAKELISTS_EXTRA_CODE
diff --git a/Tests/CTestTestMemcheck/testAddressSanitizer.cmake b/Tests/CTestTestMemcheck/testAddressSanitizer.cmake
index a359e28..a073151 100644
--- a/Tests/CTestTestMemcheck/testAddressSanitizer.cmake
+++ b/Tests/CTestTestMemcheck/testAddressSanitizer.cmake
@@ -5,6 +5,10 @@ message("ASAN_OPTIONS = [$ENV{ASAN_OPTIONS}]")
string(REGEX REPLACE ".*log_path=\"([^\"]*)\".*" "\\1" LOG_FILE "$ENV{ASAN_OPTIONS}")
message("LOG_FILE=[${LOG_FILE}]")
+# if we are not asked to simulate address sanitizer don't do it
+if(NOT "$ENV{ASAN_OPTIONS}]" MATCHES "simulate_sanitizer.1")
+ return()
+endif()
# clear the log file
file(REMOVE "${LOG_FILE}.2343")
diff --git a/Tests/CTestTestMemcheck/testLeakSanitizer.cmake b/Tests/CTestTestMemcheck/testLeakSanitizer.cmake
index ca0a264..d0e38ce 100644
--- a/Tests/CTestTestMemcheck/testLeakSanitizer.cmake
+++ b/Tests/CTestTestMemcheck/testLeakSanitizer.cmake
@@ -4,6 +4,10 @@
message("ASAN_OPTIONS = [$ENV{ASAN_OPTIONS}]")
string(REGEX REPLACE ".*log_path=\"([^\"]*)\".*" "\\1" LOG_FILE "$ENV{ASAN_OPTIONS}")
message("LOG_FILE=[${LOG_FILE}]")
+# if we are not asked to simulate leak sanitizer don't do it
+if(NOT "$ENV{ASAN_OPTIONS}]" MATCHES "simulate_sanitizer.1")
+ return()
+endif()
# clear the log file
file(REMOVE "${LOG_FILE}.2343")