From: Kefu Chai Date: Sun, 17 Mar 2024 11:35:04 +0000 (+0800) Subject: cmake: error out on UBSan error X-Git-Tag: testing/wip-batrick-testing-20240411.154038~105^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a13a61d63dbaa0bf294a34da3d016291dfdc5668;p=ceph-ci.git cmake: error out on UBSan error so we can be alerted if UBSan identify something wrong. Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/AddCephTest.cmake b/cmake/modules/AddCephTest.cmake index ccd3f8dee0b..45bb26aa615 100644 --- a/cmake/modules/AddCephTest.cmake +++ b/cmake/modules/AddCephTest.cmake @@ -19,6 +19,12 @@ function(add_ceph_test test_name test_path) PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}:${CMAKE_SOURCE_DIR}/src:$ENV{PATH} PYTHONPATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cython_modules/lib.3:${CMAKE_SOURCE_DIR}/src/pybind CEPH_BUILD_VIRTUALENV=${CEPH_BUILD_VIRTUALENV}) + if(WITH_UBSAN) + set_property(TEST ${test_name} + APPEND + PROPERTY ENVIRONMENT + UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1) + endif() set_property(TEST ${test_name} PROPERTY TIMEOUT ${CEPH_TEST_TIMEOUT}) # Crimson seastar unittest always run with --smp N to start N threads. By default, crimson seastar unittest