Skip to content

Commit 4b60a3e

Browse files
authored
Do no use sanitizers in tests by default (#735)
* Run gtest_test_discovery pre test instead of post build The current behavior does not work well with parallel builds using `make`. * Disable sanitizers for testing by default. They lead to segfaults and issues with dynamic loading sometimes ...
1 parent c13a45a commit 4b60a3e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (NOT N EQUAL 0)
1717
)
1818
endif ()
1919

20-
option(KAMPING_TEST_ENABLE_SANITIZERS "Enable undefined behavior sanitizer and address sanitizer." ON)
20+
option(KAMPING_TEST_ENABLE_SANITIZERS "Enable undefined behavior sanitizer and address sanitizer." OFF)
2121

2222
# Registering tests without MPI:
2323
kamping_register_test(test_checking_casts FILES checking_casts_test.cpp)

tests/cmake/KampingTestHelper.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function (kamping_register_test KAMPING_TARGET_NAME)
2424
add_executable(${KAMPING_TARGET_NAME} ${KAMPING_FILES})
2525
target_link_libraries(${KAMPING_TARGET_NAME} PRIVATE gtest gtest_main gmock kamping_base)
2626
target_compile_options(${KAMPING_TARGET_NAME} PRIVATE ${KAMPING_WARNING_FLAGS})
27-
gtest_discover_tests(${KAMPING_TARGET_NAME} WORKING_DIRECTORY ${PROJECT_DIR})
27+
gtest_discover_tests(${KAMPING_TARGET_NAME} WORKING_DIRECTORY ${PROJECT_DIR} DISCOVERY_MODE PRE_TEST)
2828
kamping_set_kassert_flags(${KAMPING_TARGET_NAME} ${ARGN})
2929
if (NOT ${KAMPING_NO_GLIBCXX_DEBUG_CONTAINERS})
3030
target_compile_definitions(${KAMPING_TARGET_NAME} PRIVATE -D_GLIBCXX_DEBUG)

0 commit comments

Comments
 (0)