Make all Linux-specific tests conditional

Move tests specific to Linux under a platform conditional thereby eliminating
unnecessary builds and fixing "make test" on Mac OS X and possibly other
non-Linux systems.

Tests specific to Linux:
    - abstract namespace support for AF_UNIX sockets
    - TIPC support (AF_TIPC)

Test success rate jumps from 90% to 100% on Mac OS X after this change.
This commit is contained in:
hitstergtd 2016-04-14 23:44:17 +01:00
parent 8c88297e63
commit 307bd952bc

View File

@ -63,14 +63,9 @@ set(tests
test_capabilities test_capabilities
test_ipc_wildcard test_ipc_wildcard
test_metadata test_metadata
test_pair_tipc
test_reqrep_device_tipc
test_reqrep_tipc
test_router_handover test_router_handover
test_router_mandatory_tipc
test_srcfd test_srcfd
test_stream_timeout test_stream_timeout
test_sub_forward_tipc
test_xpub_manual test_xpub_manual
test_xpub_welcome_msg test_xpub_welcome_msg
test_timers test_timers
@ -82,23 +77,32 @@ if(NOT WIN32)
test_monitor test_monitor
test_pair_ipc test_pair_ipc
test_reqrep_ipc test_reqrep_ipc
test_abstract_ipc
test_proxy test_proxy
test_proxy_single_socket test_proxy_single_socket
test_proxy_terminate test_proxy_terminate
test_getsockopt_memset test_getsockopt_memset
test_filter_ipc test_filter_ipc
test_connect_delay_tipc
test_shutdown_stress_tipc
test_stream_exceeds_buffer test_stream_exceeds_buffer
test_router_mandatory_hwm test_router_mandatory_hwm
test_term_endpoint_tipc
test_use_fd_ipc test_use_fd_ipc
test_use_fd_tcp test_use_fd_tcp
) )
if(HAVE_FORK) if(HAVE_FORK)
list(APPEND tests test_fork) list(APPEND tests test_fork)
endif() endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
list(APPEND tests
test_abstract_ipc
test_pair_tipc
test_reqrep_device_tipc
test_reqrep_tipc
test_router_mandatory_tipc
test_sub_forward_tipc
test_connect_delay_tipc
test_shutdown_stress_tipc
test_term_endpoint_tipc
)
endif()
endif() endif()
if(WITH_VMCI) if(WITH_VMCI)
@ -141,12 +145,6 @@ foreach(test ${tests})
set_tests_properties(${test} PROPERTIES TIMEOUT 10) set_tests_properties(${test} PROPERTIES TIMEOUT 10)
endforeach() endforeach()
if(NOT WIN32)
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
set_tests_properties(test_abstract_ipc PROPERTIES WILL_FAIL true)
endif()
endif()
#Check whether all tests in the current folder are present #Check whether all tests in the current folder are present
file(READ "${CMAKE_CURRENT_LIST_FILE}" CURRENT_LIST_FILE_CONTENT) file(READ "${CMAKE_CURRENT_LIST_FILE}" CURRENT_LIST_FILE_CONTENT)
file(GLOB ALL_TEST_SOURCES "test_*.cpp") file(GLOB ALL_TEST_SOURCES "test_*.cpp")