diff options
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 9b9ae65..c76314a 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -345,3 +345,24 @@ run_NoTests() # Check the configuration type variable is passed run_ctest(check-configuration-type) + +function(run_MemCheckSan case opts) + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/MemCheckSan${case}-build) + set(RunCMake_TEST_OPTIONS + "-DMEMORYCHECK_TYPE=${case}Sanitizer" + "-DMEMORYCHECK_SANITIZER_OPTIONS=${opts}" + ) + run_cmake(MemCheckSan) + unset(RunCMake_TEST_OPTIONS) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake-stdout-file "../ctest_memcheck/Dummy${case}Sanitizer-stdout.txt") + run_cmake_command(MemCheckSan${case}-ctest + ${CMAKE_CTEST_COMMAND} -C Debug -M Experimental -T MemCheck -V + ) +endfunction() +run_MemCheckSan(Address "simulate_sanitizer=1:report_bugs=1:history_size=5:exitcode=55") +run_MemCheckSan(Leak "simulate_sanitizer=1:report_bugs=1:history_size=5:exitcode=55") +run_MemCheckSan(Memory "simulate_sanitizer=1:report_bugs=1:history_size=5:exitcode=55") +run_MemCheckSan(Thread "report_bugs=1:history_size=5:exitcode=55") +run_MemCheckSan(UndefinedBehavior "simulate_sanitizer=1") |