tests: Disable deep binding with ThreadSanitizer
authorAndreas Schneider <asn@samba.org>
Fri, 4 Nov 2022 13:41:19 +0000 (14:41 +0100)
committerAndreas Schneider <asn@samba.org>
Fri, 4 Nov 2022 13:41:50 +0000 (14:41 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
tests/CMakeLists.txt

index 0d57a3f1e77868b0f1830fbb8e234292c2168291..18c0ad2fe217d4aeb48a69cbe15fe6cc3a0f542c 100644 (file)
@@ -66,6 +66,13 @@ function(ADD_CMOCKA_TEST_ENVIRONMENT _TEST_NAME)
     list(APPEND TORTURE_ENVIRONMENT NSS_WRAPPER_HOSTS=${CMAKE_CURRENT_BINARY_DIR}/hosts)
     list(APPEND TORTURE_ENVIRONMENT NSS_WRAPPER_MODULE_SO_PATH=${CMAKE_CURRENT_BINARY_DIR}/libnss_nwrap.so)
     list(APPEND TORTURE_ENVIRONMENT NSS_WRAPPER_MODULE_FN_PREFIX=nwrap)
+    if (CMAKE_BUILD_TYPE)
+        string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+
+        if (CMAKE_BUILD_TYPE_LOWER STREQUAL "threadsanitizer")
+            list(APPEND TORTURE_ENVIRONMENT NSS_WRAPPER_DISABLE_DEEPBIND=1)
+        endif()
+    endif()
 
     set_property(TEST
                     ${_TEST_NAME}