Commit 7a86b39d authored by Gyula Laszlo's avatar Gyula Laszlo

Added ZMQ_BUILD_TESTS to CMakeLists.txt to allow turning off tests. Useful when…

Added ZMQ_BUILD_TESTS to CMakeLists.txt to allow turning off tests. Useful when building ZMQ as a git submodule.
parent 5a47fc4f
...@@ -580,81 +580,89 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") # Why? ...@@ -580,81 +580,89 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") # Why?
endforeach() endforeach()
endif() endif()
enable_testing() #-----------------------------------------------------------------------------
set(tests # tests
test_system
test_pair_inproc set(ZMQ_BUILD_TESTS ON CACHE BOOL "Build the tests for ZeroMQ")
test_pair_tcp
test_reqrep_inproc if(ZMQ_BUILD_TESTS)
test_reqrep_tcp enable_testing()
test_hwm set(tests
test_reqrep_device test_system
test_sub_forward test_pair_inproc
test_invalid_rep test_pair_tcp
test_msg_flags test_reqrep_inproc
test_connect_resolve test_reqrep_tcp
test_immediate test_hwm
test_last_endpoint test_reqrep_device
test_term_endpoint test_sub_forward
test_router_mandatory test_invalid_rep
test_probe_router test_msg_flags
test_stream test_connect_resolve
test_stream_empty test_immediate
test_stream_disconnect test_last_endpoint
test_disconnect_inproc test_term_endpoint
test_ctx_options test_router_mandatory
test_ctx_destroy test_probe_router
test_security_null test_stream
test_security_plain test_stream_empty
test_security_curve test_stream_disconnect
test_iov test_disconnect_inproc
test_spec_req test_ctx_options
test_spec_rep test_ctx_destroy
test_spec_dealer test_security_null
test_spec_router test_security_plain
test_spec_pushpull test_security_curve
test_req_correlate test_iov
test_req_relaxed test_spec_req
test_conflate test_spec_rep
test_inproc_connect test_spec_dealer
test_issue_566 test_spec_router
test_shutdown_stress test_spec_pushpull
test_timeo test_req_correlate
test_many_sockets test_req_relaxed
test_diffserv test_conflate
test_connect_rid test_inproc_connect
) test_issue_566
if(NOT WIN32) test_shutdown_stress
list(APPEND tests test_timeo
test_monitor test_many_sockets
test_pair_ipc test_diffserv
test_reqrep_ipc test_connect_rid
test_fork )
test_abstract_ipc if(NOT WIN32)
test_proxy list(APPEND tests
test_filter_ipc test_monitor
) test_pair_ipc
endif() test_reqrep_ipc
test_fork
test_abstract_ipc
test_proxy
test_filter_ipc
)
endif()
foreach(test ${tests}) foreach(test ${tests})
add_executable(${test} tests/${test}.cpp) add_executable(${test} tests/${test}.cpp)
target_link_libraries(${test} libzmq) target_link_libraries(${test} libzmq)
if(RT_LIBRARY) if(RT_LIBRARY)
target_link_libraries(${test} ${RT_LIBRARY}) target_link_libraries(${test} ${RT_LIBRARY})
endif() endif()
if(WIN32) if(WIN32)
add_test(NAME ${test} WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH} COMMAND ${test}) add_test(NAME ${test} WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH} COMMAND ${test})
else() else()
add_test(NAME ${test} COMMAND ${test}) add_test(NAME ${test} COMMAND ${test})
endif() endif()
endforeach() endforeach()
if(NOT WIN32) if(NOT WIN32)
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux") if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
set_tests_properties(test_abstract_ipc PROPERTIES WILL_FAIL true) set_tests_properties(test_abstract_ipc PROPERTIES WILL_FAIL true)
endif()
endif() endif()
endif()
endif() # ZMQ_BUILD_TESTS
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# installer # installer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment