diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-04-07 12:57:01 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-04-07 12:57:01 +0000 |
commit | d3cd9527ea4170b8d7e033b0cc3bd5db89890a38 (patch) | |
tree | fd964f597c7eeec92caf96109318746789ef0219 /build_settings.cmake | |
parent | 60489e5ce0874775eeb3d40a89ff5c23b41b6e0b (diff) |
Set sanitizer args automatically when running tests under CTest
Currently only applies to ThreadSanitizer.
Diffstat (limited to 'build_settings.cmake')
-rw-r--r-- | build_settings.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/build_settings.cmake b/build_settings.cmake index 272242ecc5c..1dfd55e7d0e 100644 --- a/build_settings.cmake +++ b/build_settings.cmake @@ -138,6 +138,14 @@ if(VALGRIND_EXECUTABLE) set(VALGRIND_OPTIONS "--leak-check=yes --error-exitcode=1 --run-libc-freeres=no --track-origins=yes --suppressions=${VALGRIND_SUPPRESSIONS_FILE}") set(VALGRIND_COMMAND "${VALGRIND_EXECUTABLE} ${VALGRIND_OPTIONS}") endif() +# Automatically set sanitizer suppressions file and arguments for unit tests +if(VESPA_USE_SANITIZER) + if(VESPA_USE_SANITIZER STREQUAL "thread") + set(VESPA_SANITIZER_SUPPRESSIONS_FILE "${PROJECT_SOURCE_DIR}/tsan-suppressions.txt") + # Maximize the amount of history we can track, including mutex order inversion histories + set(VESPA_SANITIZER_ENV "TSAN_OPTIONS=suppressions=${VESPA_SANITIZER_SUPPRESSIONS_FILE} history_size=7 detect_deadlocks=1 second_deadlock_stack=1") + endif() +endif() if(VESPA_LLVM_VERSION) else() |