aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2019-02-15 13:54:31 +0100
committerAndreas Schneider <asn@samba.org>2019-02-28 12:49:30 +0100
commit1d8fd4d1a5336df2bcebc8cde3a0a4f6ea8d6442 (patch)
treeb5fc15d722ee473025bb0d995e31cbd24d18f7bb
parent5e81a6fc1f8677cd7708cd12f410f0626ee32178 (diff)
downloadnss_wrapper-1d8fd4d1a5336df2bcebc8cde3a0a4f6ea8d6442.tar.gz
nss_wrapper-1d8fd4d1a5336df2bcebc8cde3a0a4f6ea8d6442.tar.xz
nss_wrapper-1d8fd4d1a5336df2bcebc8cde3a0a4f6ea8d6442.zip
cmake: Do not run test_nwrap_disabled with sanitizers
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r--tests/CMakeLists.txt31
1 files changed, 17 insertions, 14 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 1f45b09..cdf4500 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,6 +1,7 @@
project(tests C)
set(TESTSUITE_LIBRARIES ${NWRAP_REQUIRED_LIBRARIES} ${CMOCKA_LIBRARY})
+string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
add_library(nss_nwrap SHARED nss_nwrap.c)
target_compile_options(nss_nwrap
@@ -93,17 +94,19 @@ target_link_libraries(test_nwrap_vector PRIVATE ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(test_gethostby_name_addr PRIVATE ${CMAKE_THREAD_LIBS_INIT})
# Test nwrap without wrapping so the libc functions are called
-add_cmocka_test(test_nwrap_disabled
- SOURCES test_nwrap_disabled.c
- COMPILE_OPTIONS ${DEFAULT_C_COMPILE_FLAGS}
- LINK_LIBRARIES ${TESTSUITE_LIBRARIES}
- LINK_OPTIONS ${DEFAULT_LINK_FLAGS})
-target_include_directories(test_nwrap_disabled
- PRIVATE
- ${CMAKE_BINARY_DIR}
- ${CMOCKA_INCLUDE_DIR})
-set_property(
- TEST
- test_nwrap_disabled
- PROPERTY
- ENVIRONMENT LD_PRELOAD=${NSS_WRAPPER_LOCATION})
+if (NOT CMAKE_BUILD_TYPE_LOWER MATCHES "sanitizer")
+ add_cmocka_test(test_nwrap_disabled
+ SOURCES test_nwrap_disabled.c
+ COMPILE_OPTIONS ${DEFAULT_C_COMPILE_FLAGS}
+ LINK_LIBRARIES ${TESTSUITE_LIBRARIES}
+ LINK_OPTIONS ${DEFAULT_LINK_FLAGS})
+ target_include_directories(test_nwrap_disabled
+ PRIVATE
+ ${CMAKE_BINARY_DIR}
+ ${CMOCKA_INCLUDE_DIR})
+ set_property(
+ TEST
+ test_nwrap_disabled
+ PROPERTY
+ ENVIRONMENT LD_PRELOAD=${NSS_WRAPPER_LOCATION})
+endif()