diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 940a5184..de8e6b48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,8 +40,6 @@ jobs: - name: Build and check run: | if [[ "${{ matrix.version }}" == 22.04 ]]; then - # Make UBSAN print whole stack traces - export UBSAN_OPTIONS="print_stacktrace=1" make distcheck-sanitizers else make distcheck diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e7e516fe..41a12f9e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -34,6 +34,12 @@ macro(add_test_wrap test_name cmd) set_tests_properties(${test_name} PROPERTIES COST ${test_cost}) math(EXPR test_cost "${test_cost} - 1") + + # print whole stacktrace for UBSAN reports + if(SANITIZERS) + set_property(TEST ${test_name} APPEND PROPERTY + ENVIRONMENT UBSAN_OPTIONS="print_stacktrace=1") + endif() endmacro() set(test_cost 1048576)