summaryrefslogtreecommitdiffstats
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt31
1 files changed, 18 insertions, 13 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 260a6e7..49cd62a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -9,16 +9,21 @@ include_directories(
add_executable(echo_srv echo_srv.c)
add_cmocka_test(testsuite testsuite.c ${CMOCKA_LIBRARY} ${SWRAP_REQUIRED_LIBRARIES})
-if (OSX)
-set_property(
- TEST
- testsuite
- PROPERTY
- ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.dylib)
-else ()
-set_property(
- TEST
- testsuite
- PROPERTY
- ENVIRONMENT LD_PRELOAD=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.so)
-endif()
+add_cmocka_test(test_echo_udp_sendto_recvfrom test_echo_udp_sendto_recvfrom.c ${CMOCKA_LIBRARY} ${SWRAP_REQUIRED_LIBRARIES})
+
+set(SWRAP_TESTS testsuite test_echo_udp_sendto_recvfrom)
+foreach(_SWRAP_TEST ${SWRAP_TESTS})
+ if (OSX)
+ set_property(
+ TEST
+ ${_SWRAP_TEST}
+ PROPERTY
+ ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.dylib)
+ else ()
+ set_property(
+ TEST
+ ${_SWRAP_TEST}
+ PROPERTY
+ ENVIRONMENT LD_PRELOAD=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.so)
+ endif()
+endforeach()