cmake: Define large file support for tests
[socket_wrapper.git] / tests / CMakeLists.txt
index 37484614ccea4862da6157e2291b86d458a722a5..17d8d3ceb5c6d0010115fec4b144b00515f55187 100644 (file)
@@ -58,12 +58,14 @@ set(SWRAP_TESTS
     test_tcp_listen
     test_tcp_dup2
     test_fcntl
+    test_fcntl_lock
     test_echo_tcp_connect
     test_echo_tcp_bind
     test_echo_tcp_socket_options
     test_echo_tcp_sendmsg_recvmsg
     test_echo_tcp_sendmmsg_recvmmsg
     test_echo_tcp_write_read
+    test_echo_tcp_poll
     test_echo_tcp_writev_readv
     test_echo_tcp_get_peer_sock_name
     test_echo_udp_sendto_recvfrom
@@ -125,10 +127,15 @@ function(ADD_CMOCKA_TEST_ENVIRONMENT _TEST_NAME)
                     ENVIRONMENT "${TORTURE_ENVIRONMENT}")
 endfunction()
 
+if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+    message(STATUS "Enabling large file support for tests")
+    set(LFS_CFLAGS "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64")
+endif()
+
 foreach(_SWRAP_TEST ${SWRAP_TESTS})
     add_cmocka_test(${_SWRAP_TEST}
                     SOURCES ${_SWRAP_TEST}.c
-                    COMPILE_OPTIONS ${DEFAULT_C_COMPILE_FLAGS} -D_GNU_SOURCE
+                    COMPILE_OPTIONS ${DEFAULT_C_COMPILE_FLAGS} -D_GNU_SOURCE ${LFS_CFLAGS}
                     LINK_LIBRARIES ${TORTURE_LIBRARY} socket_wrapper_noop
                     LINK_OPTIONS ${DEFAULT_LINK_FLAGS})
     add_cmocka_test_environment(${_SWRAP_TEST})