From 7df0822d3ed58ee73918cac576c0b07363e84425 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 23 Jan 2017 22:49:57 -0800 Subject: Added a bunch more compatibility stuff. I implemented the reqrep compatibility test, which uncovered a few semantic issues I had in the REQ/REP protocol, which I've fixed. There are still missing things. and at least one portion of the req/rep test suite cannot be enabled until I add tuning of the reconnect timeout, which is currently way too long (1 sec) for the test suite to work. --- tests/CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/CMakeLists.txt') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2b7a816e..52c9fdba 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -50,6 +50,21 @@ if (NNG_TESTS) math (EXPR TEST_PORT "${TEST_PORT}+10") endmacro (add_nng_test) + macro (add_nng_compat_test NAME TIMEOUT) + list (APPEND all_tests ${NAME}) + add_executable (${NAME} ${NAME}.c) + target_link_libraries (${NAME} ${PROJECT_NAME}_static) + target_link_libraries (${NAME} ${NNG_REQUIRED_LIBRARIES}) + target_compile_definitions(${NAME} PUBLIC -DNNG_STATIC_LIB) + if (CMAKE_THREAD_LIBS_INIT) + target_link_libraries (${NAME} "${CMAKE_THREAD_LIBS_INIT}") + endif() + + add_test (NAME ${NAME} COMMAND ${NAME} -v ${TEST_PORT}) + set_tests_properties (${NAME} PROPERTIES TIMEOUT ${TIMEOUT}) + math (EXPR TEST_PORT "${TEST_PORT}+10") + endmacro (add_nng_compat_test) + else () macro (add_nng_test NAME TIMEOUT) endmacro (add_nng_test) @@ -69,3 +84,6 @@ add_nng_test(pubsub 5) add_nng_test(sock 5) add_nng_test(survey 5) add_nng_test(tcp 5) + +# compatbility tests +add_nng_compat_test(compat_reqrep 5) -- cgit v1.2.3-70-g09d2