mirror of
https://github.com/reactos/CMake.git
synced 2025-03-04 01:47:37 +00:00
Merge topic 'fix_sanitizer_test_to_work_with_sanitizer'
f7d62cac Fix leak and address sanitizer tests to be able to run with real tools.
This commit is contained in:
commit
ea3e544098
@ -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
|
||||
|
@ -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")
|
||||
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user