5 ${CMAKE_CURRENT_SOURCE_DIR}
6 ${CMAKE_SOURCE_DIR}/src
10 set(TORTURE_LIBRARY torture)
12 # A simple DNS server for testing
13 add_executable(dns_srv dns_srv.c)
14 target_link_libraries(dns_srv ${RWRAP_REQUIRED_LIBRARIES})
16 add_library(${TORTURE_LIBRARY} STATIC torture.c)
17 target_link_libraries(${TORTURE_LIBRARY}
19 ${SWRAP_REQUIRED_LIBRARIES})
22 set(TESTSUITE_LIBRARIES ${RWRAP_REQUIRED_LIBRARIES} ${CMOCKA_LIBRARY})
24 set(TESTSUITE_LIBRARIES ${TESTSUITE_LIBRARIES} resolv)
30 set(PRELOAD_LIBS ${RESOLV_WRAPPER_LOCATION})
32 # Some tests require socket_wrapper as well.
33 find_package(socket_wrapper)
34 if (HAVE_LIBRESOLV AND SOCKET_WRAPPER_LIBRARY)
35 set(RWRAP_TESTS ${RWRAP_TESTS} test_res_query_search)
36 set(PRELOAD_LIBS ${RESOLV_WRAPPER_LOCATION}:${SOCKET_WRAPPER_LIBRARY})
39 foreach(_RWRAP_TEST ${RWRAP_TESTS})
40 add_cmocka_test(${_RWRAP_TEST} ${_RWRAP_TEST}.c ${TORTURE_LIBRARY} ${TESTSUITE_LIBRARIES})
47 ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${PRELOAD_LIBS})
53 ENVIRONMENT LD_PRELOAD=${PRELOAD_LIBS})