Skip to content

Commit

Permalink
Allow to extend and override the sanitizers options
Browse files Browse the repository at this point in the history
Summary:
This cause the values from the user environment to be appended to the
options, allowing for adding options or overriding some. Update the CI
to use this feature.

Test Plan: Run the build-asan, build-ubsan and build-tsan CI builds.

Differential Revision: https://reviews.bitcoinabc.org/D5695
  • Loading branch information
Fabcien authored and dagurval committed Nov 9, 2020
1 parent 9a1388c commit 028a2a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmake/modules/Sanitizers.cmake
Expand Up @@ -46,13 +46,13 @@ https://docs.bitcoincashnode.org/doc/fuzzing/")
include(TestSuite)
set(SAN_SUPP_DIR "${CMAKE_SOURCE_DIR}/test/sanitizer_suppressions")
if("address" IN_LIST ARGN)
add_test_environment(ASAN_OPTIONS malloc_context_size=0)
add_test_environment(LSAN_OPTIONS "suppressions=${SAN_SUPP_DIR}/lsan")
add_test_environment(ASAN_OPTIONS "malloc_context_size=0:$ENV{ASAN_OPTIONS}")
add_test_environment(LSAN_OPTIONS "suppressions=${SAN_SUPP_DIR}/lsan:$ENV{LSAN_OPTIONS}")
endif()
if("thread" IN_LIST ARGN)
add_test_environment(TSAN_OPTIONS "suppressions=${SAN_SUPP_DIR}/tsan")
add_test_environment(TSAN_OPTIONS "suppressions=${SAN_SUPP_DIR}/tsan:$ENV{TSAN_OPTIONS}")
endif()
if("undefined" IN_LIST ARGN)
add_test_environment(UBSAN_OPTIONS "suppressions=${SAN_SUPP_DIR}/ubsan:print_stacktrace=1:halt_on_error=1")
add_test_environment(UBSAN_OPTIONS "suppressions=${SAN_SUPP_DIR}/ubsan:print_stacktrace=1:halt_on_error=1:$ENV{UBSAN_OPTIONS}")
endif()
endfunction()

0 comments on commit 028a2a1

Please sign in to comment.