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,8 +580,14 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") # Why?
endforeach()
endif()
enable_testing()
set(tests
#-----------------------------------------------------------------------------
# tests
set(ZMQ_BUILD_TESTS ON CACHE BOOL "Build the tests for ZeroMQ")
if(ZMQ_BUILD_TESTS)
enable_testing()
set(tests
test_system
test_pair_inproc
test_pair_tcp
......@@ -623,9 +629,9 @@ set(tests
test_many_sockets
test_diffserv
test_connect_rid
)
if(NOT WIN32)
list(APPEND tests
)
if(NOT WIN32)
list(APPEND tests
test_monitor
test_pair_ipc
test_reqrep_ipc
......@@ -633,10 +639,10 @@ list(APPEND tests
test_abstract_ipc
test_proxy
test_filter_ipc
)
endif()
)
endif()
foreach(test ${tests})
foreach(test ${tests})
add_executable(${test} tests/${test}.cpp)
target_link_libraries(${test} libzmq)
......@@ -648,13 +654,15 @@ foreach(test ${tests})
else()
add_test(NAME ${test} COMMAND ${test})
endif()
endforeach()
endforeach()
if(NOT WIN32)
if(NOT WIN32)
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
set_tests_properties(test_abstract_ipc PROPERTIES WILL_FAIL true)
endif()
endif()
endif()
endif() # ZMQ_BUILD_TESTS
#-----------------------------------------------------------------------------
# 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