From 415079a82d39b19a1ffbfdb2b8824e3484321f3d Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 16:20:32 -0700 Subject: [PATCH 01/40] Fixed compiler error on Mac OS, removing redundant but unavailable header file. --- src/ParodusInternal.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ParodusInternal.h b/src/ParodusInternal.h index b8ba997f..0a21abef 100644 --- a/src/ParodusInternal.h +++ b/src/ParodusInternal.h @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -100,7 +99,7 @@ char* getWebpaConveyHeader(); #ifdef __cplusplus } #endif - + #endif From cb448df52886280fec7392a4dcabaf57f485a14b Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 16:22:29 -0700 Subject: [PATCH 02/40] Fixed build on Mac OS, linking conditionally to non-Mac OS libs. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 934ad125..46c6edd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,9 @@ ExternalProject_Add(cJSON GIT_REPOSITORY https://github.com/DaveGamble/cJSON.git GIT_TAG "aafb64a1c549b7b927e339df6d35b1d5059dc235" CMAKE_ARGS += -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TESTING=OFF +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + CMAKE_ARGS += -DCMAKE_MACOSX_RPATH=true +endif() ) add_library(libcJSON STATIC SHARED IMPORTED) add_dependencies(libcJSON cJSON) From 8cb23b9068abebd65ed08763911a171d3ddee9f2 Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 16:25:31 -0700 Subject: [PATCH 03/40] Fixed build on Mac OS, linking conditionally to non-Mac OS libs. --- src/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 713dce9e..a2f5ad44 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,7 +31,6 @@ target_link_libraries (parodus -lmsgpackc -ltrower-base64 -lnopoll - -luuid -lm -lcimplog -lssl @@ -40,9 +39,13 @@ target_link_libraries (parodus -lcjson -lcjwt -lpthread - -lrt ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (parodus -luuid) +target_link_libraries (parodus rt) +endif() + if (FEATURE_DNS_QUERY) target_link_libraries (parodus -lucresolv -lresolv) endif (FEATURE_DNS_QUERY) From d9065b45a129e6723e24a0d41937c23131996fcf Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 16:27:27 -0700 Subject: [PATCH 04/40] Added compile selection of SSL/TSL protocol version to all build on Mac OS. --- src/connection.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/connection.c b/src/connection.c index b4361b01..f7e69577 100644 --- a/src/connection.c +++ b/src/connection.c @@ -45,6 +45,7 @@ static noPollConnOpts * createConnOpts (char * extra_headers, bool secure); static noPollConn * nopoll_tls_common_conn (noPollCtx * ctx,char * serverAddr,char *serverPort,char * extra_headers); static char* build_extra_headers( const char *auth, const char *device_id, const char *user_agent, const char *convey ); +static noPollSslProtocol get_nopoll_tls_protocol(void); /*----------------------------------------------------------------------------*/ /* External Functions */ @@ -368,8 +369,10 @@ static noPollConn * nopoll_tls_common_conn (noPollCtx * ctx,char * serverAddr,c static noPollConnOpts * createConnOpts (char * extra_headers, bool secure) { noPollConnOpts * opts; + noPollSslProtocol protocol = NOPOLL_METHOD_TLSV1; opts = nopoll_conn_opts_new (); + protocol = get_nopoll_tls_protocol(); if(secure) { if(strlen(get_parodus_cfg()->cert_path) > 0) @@ -377,7 +380,7 @@ static noPollConnOpts * createConnOpts (char * extra_headers, bool secure) nopoll_conn_opts_set_ssl_certs(opts, NULL, NULL, NULL, get_parodus_cfg()->cert_path); } nopoll_conn_opts_ssl_peer_verify (opts, nopoll_true); - nopoll_conn_opts_set_ssl_protocol (opts, NOPOLL_METHOD_TLSV1_2); + nopoll_conn_opts_set_ssl_protocol (opts, protocol); } nopoll_conn_opts_set_interface (opts,get_parodus_cfg()->webpa_interface_used); nopoll_conn_opts_set_extra_headers (opts,extra_headers); @@ -395,3 +398,16 @@ void close_and_unref_connection(noPollConn *conn) } } +static noPollSslProtocol get_nopoll_tls_protocol( void ) +{ + noPollSslProtocol _protocol; +#if defined(NOPOLL_HAVE_TLSv12_ENABLED) + _protocol = NOPOLL_METHOD_TLSV1_2; +#elif defined(NOPOLL_HAVE_TLSv11_ENABLED) + _protocol = NOPOLL_METHOD_TLSV1_1; +#elif defined(NOPOLL_HAVE_TLSv10_ENABLED) + _protocol = NOPOLL_METHOD_TLSV1; +#endif + return _protocol; +} + From 2363ac8d854ffc78bbd997df43d0ac4e45633d99 Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 16:29:00 -0700 Subject: [PATCH 05/40] Changed #include guard to distinguish between STD lib time header. --- src/time.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/time.h b/src/time.h index 4314a6ff..c64d5d48 100644 --- a/src/time.h +++ b/src/time.h @@ -18,8 +18,8 @@ #include #include -#ifndef _TIME_H_ -#define _TIME_H_ +#ifndef __TIME_H__ +#define __TIME_H__ #ifdef __cplusplus extern "C" { From 9b2cebdb7363dd27c1aa21cb29fa5b5f1bb6526e Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 16:50:58 -0700 Subject: [PATCH 06/40] Disabled test not ready for Mac OS. --- tests/test_config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_config.c b/tests/test_config.c index a7758c5e..73b1b7c3 100644 --- a/tests/test_config.c +++ b/tests/test_config.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -507,7 +507,9 @@ int main(void) cmocka_unit_test(test_parseCommandLine), cmocka_unit_test(test_parseCommandLineNull), cmocka_unit_test(err_parseCommandLine), +#ifndef __MACH__ cmocka_unit_test(test_parodusGitVersion), +#endif //__MACH__ cmocka_unit_test(test_setDefaultValuesToCfg), cmocka_unit_test(err_setDefaultValuesToCfg), }; From 0db494ac84579a4a55f85f39ed80da54ae5a7b86 Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 16:55:31 -0700 Subject: [PATCH 07/40] Disabled test not ready for Mac OS. --- tests/test_upstream.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_upstream.c b/tests/test_upstream.c index 35b23648..3d9f5097 100644 --- a/tests/test_upstream.c +++ b/tests/test_upstream.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -589,12 +589,16 @@ int main(void) cmocka_unit_test(err_handleUpstreamSockFailure), cmocka_unit_test(test_processUpstreamMessage), cmocka_unit_test(test_processUpstreamMessageInvalidPartner), +#ifndef __MACH__ cmocka_unit_test(test_processUpstreamMessageRegMsg), +#endif cmocka_unit_test(test_processUpstreamMessageRegMsgNoClients), cmocka_unit_test(err_processUpstreamMessage), cmocka_unit_test(err_processUpstreamMessageDecodeErr), cmocka_unit_test(err_processUpstreamMessageMetapackFailure), +#ifndef __MACH__ cmocka_unit_test(err_processUpstreamMessageRegMsg), +#endif cmocka_unit_test(test_sendUpstreamMsgToServer), cmocka_unit_test(err_sendUpstreamMsgToServer), }; From a4b1d521f4ef33a2974ffe7c5835b6328d4c98f5 Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 16:55:31 -0700 Subject: [PATCH 08/40] Fixed build on Mac OS and disabled test not ready for Mac OS. --- tests/test_upstream.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_upstream.c b/tests/test_upstream.c index 35b23648..3d9f5097 100644 --- a/tests/test_upstream.c +++ b/tests/test_upstream.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -589,12 +589,16 @@ int main(void) cmocka_unit_test(err_handleUpstreamSockFailure), cmocka_unit_test(test_processUpstreamMessage), cmocka_unit_test(test_processUpstreamMessageInvalidPartner), +#ifndef __MACH__ cmocka_unit_test(test_processUpstreamMessageRegMsg), +#endif cmocka_unit_test(test_processUpstreamMessageRegMsgNoClients), cmocka_unit_test(err_processUpstreamMessage), cmocka_unit_test(err_processUpstreamMessageDecodeErr), cmocka_unit_test(err_processUpstreamMessageMetapackFailure), +#ifndef __MACH__ cmocka_unit_test(err_processUpstreamMessageRegMsg), +#endif cmocka_unit_test(test_sendUpstreamMsgToServer), cmocka_unit_test(err_sendUpstreamMsgToServer), }; From d721117cd773ea7b1575bce1ef43c5e43c3e869d Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 17:04:04 -0700 Subject: [PATCH 09/40] Fixed inclusion for correct header. --- src/string_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string_helpers.c b/src/string_helpers.c index 8502866e..1b3e1826 100644 --- a/src/string_helpers.c +++ b/src/string_helpers.c @@ -14,7 +14,7 @@ * limitations under the License. * */ -#include "string.h" +#include /*----------------------------------------------------------------------------*/ /* Macros */ From 208c8a3b40d67229bfbf251ac1fe92b8cb49fc8a Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 17:05:11 -0700 Subject: [PATCH 10/40] Fixed tests build on Mac OS. --- tests/CMakeLists.txt | 132 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 106 insertions(+), 26 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1cf012a6..b93fdafe 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,13 +14,17 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -g -fprofile-arcs -ftest-coverage -O0") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST ") +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -Du_char='unsigned char' -Du_int='unsigned int' -Du_long='unsigned long'") +endif() set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -g -fprofile-arcs -ftest-coverage -O0") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -O0") set (PARODUS_COMMON_SRC ../src/string_helpers.c ../src/mutex.c ../src/time.c ../src/config.c ../src/spin_thread.c ../src/token.c) -set (PARODUS_COMMON_LIBS gcov -lcunit -lcimplog -lwrp-c - -luuid -lpthread -lmsgpackc -lnopoll -lnanomsg - -Wl,--no-as-needed -lcjson -lcjwt -ltrower-base64 - -lssl -lcrypto -lrt -lm) +set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c + -lpthread -lmsgpackc -lnopoll -lnanomsg + -lcjson -lcjwt -ltrower-base64 + -lssl -lcrypto -lm) +set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) if (ENABLE_SESHAT) set (PARODUS_COMMON_LIBS -llibseshat ${PARODUS_COMMON_LIBS}) @@ -39,9 +43,16 @@ link_directories ( ${LIBRARY_DIR} ) #------------------------------------------------------------------------------- # test_mutex #------------------------------------------------------------------------------- +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +add_test(NAME test_mutex COMMAND ./test_mutex) +else() add_test(NAME test_mutex COMMAND ${MEMORY_CHECK} ./test_mutex) +endif() add_executable(test_mutex test_mutex.c ../src/mutex.c) target_link_libraries (test_mutex ${PARODUS_COMMON_LIBS} -lcmocka) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_mutex ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_networking @@ -49,13 +60,19 @@ target_link_libraries (test_mutex ${PARODUS_COMMON_LIBS} -lcmocka) add_test(NAME test_networking COMMAND ${MEMORY_CHECK} ./test_networking) add_executable(test_networking test_networking.c ../src/networking.c) target_link_libraries (test_networking ${PARODUS_COMMON_LIBS}) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_networking ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_nopoll_helpers #------------------------------------------------------------------------------- add_test(NAME test_nopoll_helpers COMMAND ${MEMORY_CHECK} ./test_nopoll_helpers) add_executable(test_nopoll_helpers test_nopoll_helpers.c ../src/nopoll_helpers.c) -target_link_libraries (test_nopoll_helpers -Wl,--no-as-needed -lrt -lcmocka -lcimplog -lnopoll) +target_link_libraries (test_nopoll_helpers -lcmocka -lcimplog -lnopoll) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_nopoll_helpers rt -Wl,--no-as-needed) +endif() #------------------------------------------------------------------------------- # libpd_test @@ -66,14 +83,15 @@ target_link_libraries (libpd_test cunit -llibparodus -lwrp-c - -luuid -lmsgpackc -ltrower-base64 -lnanomsg -lcimplog -lm - -lpthread - -lrt) + -lpthread) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_networking ${PARODUS_LINUX_ONLY_LIBS}) +endif() if (ENABLE_SESHAT) target_link_libraries (libpd_test -llibseshat) endif (ENABLE_SESHAT) @@ -83,6 +101,9 @@ endif (ENABLE_SESHAT) add_test(NAME test_time COMMAND ${MEMORY_CHECK} ./test_time) add_executable(test_time test_time.c ../src/time.c) target_link_libraries (test_time ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_time ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_spin_thread error @@ -90,6 +111,9 @@ target_link_libraries (test_time ${PARODUS_COMMON_LIBS} ) add_test(NAME test_spin_thread_e COMMAND ${MEMORY_CHECK} ./test_spin_thread_e) add_executable(test_spin_thread_e test_spin_thread_e.c ../src/spin_thread.c) target_link_libraries (test_spin_thread_e ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_spin_thread_e ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_spin_thread success @@ -97,6 +121,9 @@ target_link_libraries (test_spin_thread_e ${PARODUS_COMMON_LIBS} ) add_test(NAME test_spin_thread_s COMMAND ${MEMORY_CHECK} ./test_spin_thread_s) add_executable(test_spin_thread_s test_spin_thread_s.c ../src/spin_thread.c) target_link_libraries (test_spin_thread_s ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_spin_thread_s ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_string_helpers @@ -104,41 +131,53 @@ target_link_libraries (test_spin_thread_s ${PARODUS_COMMON_LIBS} ) add_test(NAME test_string_helpers COMMAND ${MEMORY_CHECK} ./test_string_helpers) add_executable(test_string_helpers test_string_helpers.c ../src/string_helpers.c) target_link_libraries (test_string_helpers ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_string_helpers ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_nopoll_handlers #------------------------------------------------------------------------------- +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +add_test(NAME test_nopoll_handlers COMMAND ./test_nopoll_handlers) +else() add_test(NAME test_nopoll_handlers COMMAND ${MEMORY_CHECK} ./test_nopoll_handlers) +endif() add_executable(test_nopoll_handlers test_nopoll_handlers.c ../src/nopoll_handlers.c) -target_link_libraries (test_nopoll_handlers -lnopoll -lcunit -lcimplog -Wl,--no-as-needed -lrt -lpthread -lm) +target_link_libraries (test_nopoll_handlers -lnopoll -lcunit -lcimplog -lpthread -lm) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_nopoll_handlers -lrt -Wl,--no-as-needed) +endif() #------------------------------------------------------------------------------- # test_connection #------------------------------------------------------------------------------- add_test(NAME test_connection COMMAND ${MEMORY_CHECK} ./test_connection) -#add_executable(test_connection test_connection.c ../src/connection.c ${PARODUS_COMMON_SRC}) -#target_link_libraries (test_connection ${PARODUS_COMMON_LIBS} -lcmocka) set(SOURCES test_connection.c ../src/connection.c ${PARODUS_COMMON_SRC}) add_executable(test_connection ${SOURCES}) -#target_link_libraries (test_connection ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS} -lcmocka) target_link_libraries (test_connection ${PARODUS_COMMON_LIBS} -lcmocka) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_connection ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_connection - function createNopollConnection #------------------------------------------------------------------------------- add_test(NAME test_createConnection COMMAND ${MEMORY_CHECK} ./test_createConnection) -#add_executable(test_createConnection test_createConnection.c ../src/connection.c ../src/string_helpers.c ../src/config.c) -#target_link_libraries (test_createConnection ${PARODUS_COMMON_LIBS} -lcmocka) add_executable(test_createConnection test_createConnection.c ../src/connection.c ../src/string_helpers.c ../src/config.c) -#target_link_libraries (test_createConnection ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS} -lcmocka ) target_link_libraries (test_createConnection ${PARODUS_COMMON_LIBS} -lcmocka ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_createConnection ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_client_list #------------------------------------------------------------------------------- +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +add_test(NAME test_client_list COMMAND ./test_client_list) +else() add_test(NAME test_client_list COMMAND ${MEMORY_CHECK} ./test_client_list) -#add_executable(test_client_list test_client_list.c ../src/client_list.c ../src/service_alive.c ../src/upstream.c ../src/networking.c ../src/nopoll_helpers.c ../src/downstream.c ../src/connection.c ../src/nopoll_handlers.c ../src/ParodusInternal.c ../src/thread_tasks.c ../src/conn_interface.c ../src/partners_check.c ${PARODUS_COMMON_SRC}) -#target_link_libraries (test_client_list ${PARODUS_COMMON_LIBS}) +endif() set(SOURCES test_client_list.c ../src/client_list.c ../src/service_alive.c ../src/upstream.c ../src/networking.c ../src/nopoll_helpers.c ../src/downstream.c ../src/connection.c ../src/nopoll_handlers.c @@ -152,15 +191,19 @@ set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(test_client_list ${SOURCES}) -#target_link_libraries (test_client_list ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS}) target_link_libraries (test_client_list ${PARODUS_COMMON_LIBS}) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_client_list ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_service_alive #------------------------------------------------------------------------------- +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +add_test(NAME test_service_alive COMMAND ./test_service_alive) +else() add_test(NAME test_service_alive COMMAND ${MEMORY_CHECK} ./test_service_alive) -#add_executable(test_service_alive test_service_alive.c ../src/client_list.c ../src/service_alive.c ../src/upstream.c ../src/networking.c ../src/nopoll_helpers.c ../src/nopoll_handlers.c ../src/config.c ../src/connection.c ../src/ParodusInternal.c ../src/downstream.c ../src/thread_tasks.c ../src/conn_interface.c ../src/partners_check.c ${PARODUS_COMMON_SRC}) -#target_link_libraries (test_service_alive ${PARODUS_COMMON_LIBS}) +endif() set(SOURCES test_service_alive.c ../src/client_list.c ../src/service_alive.c ../src/upstream.c ../src/networking.c ../src/nopoll_helpers.c ../src/nopoll_handlers.c ../src/config.c ../src/connection.c ../src/ParodusInternal.c ../src/downstream.c ../src/thread_tasks.c ../src/conn_interface.c ../src/partners_check.c ${PARODUS_COMMON_SRC}) if (ENABLE_SESHAT) set(SOURCES ${SOURCES} ../src/seshat_interface.c) @@ -169,18 +212,22 @@ set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(test_service_alive ${SOURCES}) -#target_link_libraries (test_service_alive ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS}) target_link_libraries (test_service_alive ${PARODUS_COMMON_LIBS}) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_service_alive ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_config #------------------------------------------------------------------------------- add_test(NAME test_config COMMAND ${MEMORY_CHECK} ./test_config) add_executable(test_config test_config.c ../src/config.c ../src/string_helpers.c) -target_link_libraries (test_config -lcmocka - -Wl,--no-as-needed -lcimplog - -lcjson -lcjwt -ltrower-base64 -lssl -lcrypto -lrt -lm +target_link_libraries (test_config -lcmocka -lcimplog + -lcjson -lcjwt -ltrower-base64 -lssl -lcrypto -lm ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_mutex ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_upstream @@ -188,6 +235,9 @@ target_link_libraries (test_config -lcmocka add_test(NAME test_upstream COMMAND ${MEMORY_CHECK} ./test_upstream) add_executable(test_upstream test_upstream.c ../src/upstream.c ../src/string_helpers.c) target_link_libraries (test_upstream -lcmocka ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_upstream ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_downstream @@ -195,6 +245,9 @@ target_link_libraries (test_upstream -lcmocka ${PARODUS_COMMON_LIBS} ) add_test(NAME test_downstream COMMAND ${MEMORY_CHECK} ./test_downstream) add_executable(test_downstream test_downstream.c ../src/downstream.c ../src/string_helpers.c) target_link_libraries (test_downstream -lcmocka ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_downstream ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_downstream_more @@ -202,6 +255,9 @@ target_link_libraries (test_downstream -lcmocka ${PARODUS_COMMON_LIBS} ) add_test(NAME test_downstream_more COMMAND ${MEMORY_CHECK} ./test_downstream_more) add_executable(test_downstream_more test_downstream_more.c ../src/downstream.c ../src/string_helpers.c) target_link_libraries (test_downstream_more -lcmocka ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_downstream_more ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_thread_tasks @@ -209,6 +265,9 @@ target_link_libraries (test_downstream_more -lcmocka ${PARODUS_COMMON_LIBS} ) add_test(NAME test_thread_tasks COMMAND ${MEMORY_CHECK} ./test_thread_tasks) add_executable(test_thread_tasks test_thread_tasks.c ../src/thread_tasks.c) target_link_libraries (test_thread_tasks -lcmocka ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_thread_tasks ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_conn_interface @@ -222,6 +281,9 @@ set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(test_conn_interface ${SOURCES}) target_link_libraries (test_conn_interface -lcmocka ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_conn_interface ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_ParodusInternal @@ -229,6 +291,9 @@ target_link_libraries (test_conn_interface -lcmocka ${PARODUS_COMMON_LIBS} ) add_test(NAME test_ParodusInternal COMMAND ${MEMORY_CHECK} ./test_ParodusInternal) add_executable(test_ParodusInternal test_ParodusInternal.c ../src/ParodusInternal.c ../src/config.c ../src/string_helpers.c) target_link_libraries (test_ParodusInternal -lcmocka ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_ParodusInternal ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_partners_check @@ -236,14 +301,19 @@ target_link_libraries (test_ParodusInternal -lcmocka ${PARODUS_COMMON_LIBS} ) add_test(NAME test_partners_check COMMAND ${MEMORY_CHECK} ./test_partners_check) add_executable(test_partners_check test_partners_check.c ../src/partners_check.c ../src/string_helpers.c) target_link_libraries (test_partners_check -lcmocka ${PARODUS_COMMON_LIBS} -lwrp-c) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_partners_check ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_token - token.c tests #------------------------------------------------------------------------------- add_test(NAME test_token COMMAND ${MEMORY_CHECK} ./test_token) add_executable(test_token ${SOURCES} ) -#target_link_libraries (test_token ${PARODUS_COMMON_LIBS} ${PARODUS_JWT_LIBS} -lcmocka ) target_link_libraries (test_token ${PARODUS_COMMON_LIBS} -lcmocka ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_token ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_seshat_interface - registerWithSeshat @@ -256,6 +326,9 @@ set(SOURCES test_seshat_interface_stub.c ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(test_seshat_interface ${SOURCES}) target_link_libraries (test_seshat_interface -lcmocka ${PARODUS_COMMON_LIBS} -lwrp-c) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (test_seshat_interface ${PARODUS_LINUX_ONLY_LIBS}) +endif() if (INTEGRATION_TESTING) #------------------------------------------------------------------------------- @@ -271,6 +344,9 @@ set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(simple_connection ${SOURCES}) target_link_libraries (simple_connection ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (simple_connection ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # simple test @@ -285,5 +361,9 @@ set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(simple ${SOURCES}) -target_link_libraries (simple ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS} gcov -lnopoll -lnanomsg ) +target_link_libraries (simple ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS} -lnopoll -lnanomsg ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (simple ${PARODUS_LINUX_ONLY_LIBS}) +endif() + endif (INTEGRATION_TESTING) From c54c61bdf20e28cf99c5087f2f052f017267d528 Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 17:09:02 -0700 Subject: [PATCH 11/40] Fixed compilation error on Mac OS using correct version of strerror_r. --- tests/libpd_test.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/libpd_test.c b/tests/libpd_test.c index 16fbbb40..020533e1 100644 --- a/tests/libpd_test.c +++ b/tests/libpd_test.c @@ -250,7 +250,18 @@ void dbg_log_err (const char *fmt, ...) va_start(arg_ptr, fmt); vprintf(fmt, arg_ptr); va_end(arg_ptr); - printf ("LIBPD_TEST: %s\n", strerror_r (errno, errbuf, 100)); +#if _XOPEN_SOURCE >= 600 + if( 0 == strerror_r (errno, errbuf, 100) ) + { + printf("LIBPD_TEST: %s\n", errbuf); + } + else + { + printf("LIBPD_TEST: strerror_r returned failure!\n"); + } +#elif !_XOPEN_SOURCE + printf ("LIBPD_TEST: %s\n", strerror_r (errno, errbuf, 100)); +#endif } void wait_auth_received (void) From 26e1fb0d8ab5447d3e282ae25233bfdec0908d0c Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 17:11:51 -0700 Subject: [PATCH 12/40] Removed mock to use actual STD lib function. --- tests/test_string_helpers.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/test_string_helpers.c b/tests/test_string_helpers.c index 036d3c3f..701a43e7 100644 --- a/tests/test_string_helpers.c +++ b/tests/test_string_helpers.c @@ -14,9 +14,6 @@ * limitations under the License. */ #include -#include -#include -#include #include @@ -24,15 +21,6 @@ #define STRING_LENGTH 21 -/*----------------------------------------------------------------------------*/ -/* Mocks */ -/*----------------------------------------------------------------------------*/ -char *strncpy(char *destStr, const char *srcStr, size_t destSize) -{ - (void) destStr; (void) srcStr; (void) destSize; - return NULL; -} - /*----------------------------------------------------------------------------*/ /* Tests */ /*----------------------------------------------------------------------------*/ From 2730652e376711f3b208c23a21b9eea87748d923 Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 17:13:59 -0700 Subject: [PATCH 13/40] Fixed build on Mac OS, by including correct STB lib. --- tests/test_downstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_downstream.c b/tests/test_downstream.c index 73a391a6..9d7b516e 100755 --- a/tests/test_downstream.c +++ b/tests/test_downstream.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include From 2be84b146569cc67ea5280c00e6ebb33343dde05 Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 17:15:27 -0700 Subject: [PATCH 14/40] Fixed struct init error on Mac OS. --- tests/test_downstream_more.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_downstream_more.c b/tests/test_downstream_more.c index 207a0277..b4401a33 100644 --- a/tests/test_downstream_more.c +++ b/tests/test_downstream_more.c @@ -171,7 +171,7 @@ static test_t tests[] = { .s.u.event.payload = NULL, .s.u.event.payload_size = 0, - .r = {0}, + .r.u = {{0}}, }, }; From bd2ba958068ddb85ac8c7fddce3f87686410e64b Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 17:17:38 -0700 Subject: [PATCH 15/40] Fixed build on Mac OS, by including correct STB lib. --- tests/test_partners_check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_partners_check.c b/tests/test_partners_check.c index a3ad9734..62481e65 100755 --- a/tests/test_partners_check.c +++ b/tests/test_partners_check.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include From 2d17351333af16f21f295ecacb2445f9fa92a0b0 Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 17:18:52 -0700 Subject: [PATCH 16/40] Fixed type mismatch compiler error on Mac OS. --- tests/test_service_alive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_service_alive.c b/tests/test_service_alive.c index 07423803..817f651f 100644 --- a/tests/test_service_alive.c +++ b/tests/test_service_alive.c @@ -156,7 +156,7 @@ void test_keep_alive() if(byte >0) { ParodusInfo("Received keep alive msg!!! : %s \n", (char * )buf); - kill(threadId, SIGKILL); + kill((pid_t)threadId, SIGKILL); ParodusInfo("keep_alive_thread with tid %d is stopped\n", threadId); break; From 5c41d1761854246c7c6df5e616fc2abded2b9555 Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 17:19:58 -0700 Subject: [PATCH 17/40] Fixed build on Mac OS, by including correct STB lib. --- tests/test_thread_tasks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_thread_tasks.c b/tests/test_thread_tasks.c index 9375ec09..d3d8cbaf 100755 --- a/tests/test_thread_tasks.c +++ b/tests/test_thread_tasks.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include From 1623075f3d9bb281f7731945a7370a7ad9c5176e Mon Sep 17 00:00:00 2001 From: Ananthakrishnan Date: Tue, 13 Mar 2018 17:21:02 -0700 Subject: [PATCH 18/40] Fixed type mismatch compiler error on Mac OS. --- tests/test_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_time.c b/tests/test_time.c index 841e653d..fff3acc8 100644 --- a/tests/test_time.c +++ b/tests/test_time.c @@ -28,7 +28,7 @@ /*----------------------------------------------------------------------------*/ #define MOCK_RETURN_SEC 1 -int clock_gettime(int ID, struct timespec *timer) +int clock_gettime(clockid_t ID, struct timespec *timer) { (void) ID; timer->tv_sec = MOCK_RETURN_SEC; From 10933fbf28bb61929e60a0a03fb38761fa0cee6a Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 16:05:20 -0700 Subject: [PATCH 19/40] Fixed merge error. --- src/connection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/connection.c b/src/connection.c index 7193c28a..300e196b 100644 --- a/src/connection.c +++ b/src/connection.c @@ -47,6 +47,7 @@ static noPollConnOpts * createConnOpts (char * extra_headers, bool secure); static noPollConn * nopoll_tls_common_conn (noPollCtx * ctx,char * serverAddr,char *serverPort,char * extra_headers,unsigned int *fallback); static char* build_extra_headers( const char *auth, const char *device_id, const char *user_agent, const char *convey ); +static noPollSslProtocol get_nopoll_tls_protocol(void); static void toggleIPFlag (unsigned int *ptrFallback); static noPollConn * __internal_fallbackConn(noPollCtx * ctx,noPollConnOpts * opts,char * serverAddr,char *serverPort,char * extra_headers,unsigned int *fallback); @@ -501,7 +502,7 @@ static noPollConn * __internal_fallbackConn(noPollCtx * ctx,noPollConnOpts * op static noPollConnOpts * createConnOpts (char * extra_headers, bool secure) { noPollConnOpts * opts; - noPollSslProtocol protocol = NOPOLL_METHOD_TLSV1; + noPollSslProtocol protocol = NOPOLL_METHOD_TLSV1_2; opts = nopoll_conn_opts_new (); protocol = get_nopoll_tls_protocol(); From 288aacdf4df4c60ccd2c48c308b89af8dcf475e3 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 16:31:00 -0700 Subject: [PATCH 20/40] Fixed broken test. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b93fdafe..6261c325 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -90,7 +90,7 @@ target_link_libraries (libpd_test -lm -lpthread) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") -target_link_libraries (test_networking ${PARODUS_LINUX_ONLY_LIBS}) +target_link_libraries (libpd_test ${PARODUS_LINUX_ONLY_LIBS}) endif() if (ENABLE_SESHAT) target_link_libraries (libpd_test -llibseshat) From 0bd50a0d73dcdb1f83cd3173fabed7bb99a34512 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 16:56:03 -0700 Subject: [PATCH 21/40] Applied another fix to Travis. --- tests/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6261c325..431e53c8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -89,12 +89,12 @@ target_link_libraries (libpd_test -lcimplog -lm -lpthread) -if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") -target_link_libraries (libpd_test ${PARODUS_LINUX_ONLY_LIBS}) -endif() if (ENABLE_SESHAT) target_link_libraries (libpd_test -llibseshat) endif (ENABLE_SESHAT) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries (libpd_test ${PARODUS_LINUX_ONLY_LIBS}) +endif() #------------------------------------------------------------------------------- # test_time #------------------------------------------------------------------------------- From 9dc74f10819acc6fb97f3dfe2f79395c05766738 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 17:07:11 -0700 Subject: [PATCH 22/40] Fixed config test failure on Travis. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 431e53c8..1cb58e88 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -226,7 +226,7 @@ target_link_libraries (test_config -lcmocka -lcimplog -lcjson -lcjwt -ltrower-base64 -lssl -lcrypto -lm ) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") -target_link_libraries (test_mutex ${PARODUS_LINUX_ONLY_LIBS}) +target_link_libraries (test_config ${PARODUS_LINUX_ONLY_LIBS}) endif() #------------------------------------------------------------------------------- From a4fbf3bb817d92e38136eb37981cbd518c805f11 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 17:17:42 -0700 Subject: [PATCH 23/40] Applied another fix to config test. --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1cb58e88..de311922 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -222,8 +222,8 @@ endif() #------------------------------------------------------------------------------- add_test(NAME test_config COMMAND ${MEMORY_CHECK} ./test_config) add_executable(test_config test_config.c ../src/config.c ../src/string_helpers.c) -target_link_libraries (test_config -lcmocka -lcimplog - -lcjson -lcjwt -ltrower-base64 -lssl -lcrypto -lm +target_link_libraries (test_config -lssl -lcjson -lcmocka -lcimplog + -lcjwt -ltrower-base64 -lcrypto -lm ) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_config ${PARODUS_LINUX_ONLY_LIBS}) From 09c05a8997c6056cb1c7085994f8ed0cd9051ff2 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 17:43:10 -0700 Subject: [PATCH 24/40] Added another fix to Travis config test failure. --- tests/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index de311922..d3f94461 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -222,9 +222,8 @@ endif() #------------------------------------------------------------------------------- add_test(NAME test_config COMMAND ${MEMORY_CHECK} ./test_config) add_executable(test_config test_config.c ../src/config.c ../src/string_helpers.c) -target_link_libraries (test_config -lssl -lcjson -lcmocka -lcimplog - -lcjwt -ltrower-base64 -lcrypto -lm -) +target_link_libraries (test_config -lssl -lcjson -lcrypto -lcjwt -lcmocka + -lcimplog -ltrower-base64 -lm) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_config ${PARODUS_LINUX_ONLY_LIBS}) endif() From 139a492866b2756c0e950fbae4fae68596d7987e Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 18:02:12 -0700 Subject: [PATCH 25/40] Added fix #3 to Travis config test failure. --- tests/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d3f94461..a7c5a034 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -222,8 +222,7 @@ endif() #------------------------------------------------------------------------------- add_test(NAME test_config COMMAND ${MEMORY_CHECK} ./test_config) add_executable(test_config test_config.c ../src/config.c ../src/string_helpers.c) -target_link_libraries (test_config -lssl -lcjson -lcrypto -lcjwt -lcmocka - -lcimplog -ltrower-base64 -lm) +target_link_libraries (test_config -lcmocka ${PARODUS_COMMON_LIBS}) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_config ${PARODUS_LINUX_ONLY_LIBS}) endif() From 833640dcd8bc4ac44fbae9688d2e7ccd0b917d8e Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 18:27:09 -0700 Subject: [PATCH 26/40] Added fix #4 to Travis config test failure. --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a7c5a034..bc847e36 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -22,8 +22,8 @@ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-cov set (PARODUS_COMMON_SRC ../src/string_helpers.c ../src/mutex.c ../src/time.c ../src/config.c ../src/spin_thread.c ../src/token.c) set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c -lpthread -lmsgpackc -lnopoll -lnanomsg - -lcjson -lcjwt -ltrower-base64 - -lssl -lcrypto -lm) + -lcjson -ltrower-base64 -lssl -lcrypto + -lcjwt -lm) set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) if (ENABLE_SESHAT) From 97adcd0aed168b7a7130255152f4183cf1c389ac Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 18:33:21 -0700 Subject: [PATCH 27/40] Added fix #5 to Travis config test failure. --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bc847e36..ae5a61fc 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -22,8 +22,8 @@ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-cov set (PARODUS_COMMON_SRC ../src/string_helpers.c ../src/mutex.c ../src/time.c ../src/config.c ../src/spin_thread.c ../src/token.c) set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c -lpthread -lmsgpackc -lnopoll -lnanomsg - -lcjson -ltrower-base64 -lssl -lcrypto - -lcjwt -lm) + -lcjwt -lcjson -ltrower-base64 -lssl + -lcrypto -lm) set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) if (ENABLE_SESHAT) From e3ad8d15a8a2deb37bf3159f62612b3ac22ba3a9 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 18:46:43 -0700 Subject: [PATCH 28/40] Added fix #6 to Travis config test failure. --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ae5a61fc..a7c5a034 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -22,8 +22,8 @@ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-cov set (PARODUS_COMMON_SRC ../src/string_helpers.c ../src/mutex.c ../src/time.c ../src/config.c ../src/spin_thread.c ../src/token.c) set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c -lpthread -lmsgpackc -lnopoll -lnanomsg - -lcjwt -lcjson -ltrower-base64 -lssl - -lcrypto -lm) + -lcjson -lcjwt -ltrower-base64 + -lssl -lcrypto -lm) set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) if (ENABLE_SESHAT) From 7d3cb2d5e8b263fb4968308dd7237d2750f146dd Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 19:02:36 -0700 Subject: [PATCH 29/40] Added fix #7 to Travis config test failure. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a7c5a034..c16701c0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -22,7 +22,7 @@ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-cov set (PARODUS_COMMON_SRC ../src/string_helpers.c ../src/mutex.c ../src/time.c ../src/config.c ../src/spin_thread.c ../src/token.c) set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c -lpthread -lmsgpackc -lnopoll -lnanomsg - -lcjson -lcjwt -ltrower-base64 + -lcjwt -lcjson -ltrower-base64 -lssl -lcrypto -lm) set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) From 9a7c3d08d7569bd7e51bf0d9fd0edf2427c57e74 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Tue, 3 Apr 2018 19:13:46 -0700 Subject: [PATCH 30/40] Added fix #8 to Travis config test failure. --- tests/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c16701c0..1402d036 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -22,8 +22,7 @@ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-cov set (PARODUS_COMMON_SRC ../src/string_helpers.c ../src/mutex.c ../src/time.c ../src/config.c ../src/spin_thread.c ../src/token.c) set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c -lpthread -lmsgpackc -lnopoll -lnanomsg - -lcjwt -lcjson -ltrower-base64 - -lssl -lcrypto -lm) + -lcjwt -lcjson -ltrower-base64 -lssl -lcrypto -lm) set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) if (ENABLE_SESHAT) From 1d063c88d431423ebb39a6b44e346f9bb3847557 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Wed, 4 Apr 2018 11:48:53 -0700 Subject: [PATCH 31/40] Added fix #9 to Travis config test failure. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1402d036..80c67e07 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -22,7 +22,7 @@ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-cov set (PARODUS_COMMON_SRC ../src/string_helpers.c ../src/mutex.c ../src/time.c ../src/config.c ../src/spin_thread.c ../src/token.c) set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c -lpthread -lmsgpackc -lnopoll -lnanomsg - -lcjwt -lcjson -ltrower-base64 -lssl -lcrypto -lm) + -lcjwt -lcrypto -lcjson -ltrower-base64 -lssl -lm) set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) if (ENABLE_SESHAT) From ce31b4d22e85f5844bef1072ae97aa0872b6f673 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Wed, 4 Apr 2018 13:23:47 -0700 Subject: [PATCH 32/40] Added fix #9 to Travis config test failure. --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 80c67e07..da266fd2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,8 +21,8 @@ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -g -fprofile-arcs -ftest-cove set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -O0") set (PARODUS_COMMON_SRC ../src/string_helpers.c ../src/mutex.c ../src/time.c ../src/config.c ../src/spin_thread.c ../src/token.c) set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c - -lpthread -lmsgpackc -lnopoll -lnanomsg - -lcjwt -lcrypto -lcjson -ltrower-base64 -lssl -lm) + -lmsgpackc -lnopoll -lnanomsg -lcjwt -lssl -lcrypto + -lpthread -lcjson -ltrower-base64 -lm) set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) if (ENABLE_SESHAT) From b689a138e4961f99261ae449127c57a97196a690 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Wed, 4 Apr 2018 13:23:47 -0700 Subject: [PATCH 33/40] Added fix #10 to Travis config test failure. --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 80c67e07..da266fd2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,8 +21,8 @@ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -g -fprofile-arcs -ftest-cove set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -O0") set (PARODUS_COMMON_SRC ../src/string_helpers.c ../src/mutex.c ../src/time.c ../src/config.c ../src/spin_thread.c ../src/token.c) set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c - -lpthread -lmsgpackc -lnopoll -lnanomsg - -lcjwt -lcrypto -lcjson -ltrower-base64 -lssl -lm) + -lmsgpackc -lnopoll -lnanomsg -lcjwt -lssl -lcrypto + -lpthread -lcjson -ltrower-base64 -lm) set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) if (ENABLE_SESHAT) From ec22237b17e39438efe24204a64991c9b7626b4d Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Wed, 4 Apr 2018 13:41:32 -0700 Subject: [PATCH 34/40] Added fix #11 to Travis config test failure. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index da266fd2..7946fec8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -221,7 +221,7 @@ endif() #------------------------------------------------------------------------------- add_test(NAME test_config COMMAND ${MEMORY_CHECK} ./test_config) add_executable(test_config test_config.c ../src/config.c ../src/string_helpers.c) -target_link_libraries (test_config -lcmocka ${PARODUS_COMMON_LIBS}) +target_link_libraries (test_config -lcmocka -lcimplog -lcjwt -lcjson -ltrower-base64 -lssl -lcrypto ) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_config ${PARODUS_LINUX_ONLY_LIBS}) endif() From 8684bfccdd5de64ca8309dd20aab72ad6d4e2ca2 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Wed, 4 Apr 2018 13:55:48 -0700 Subject: [PATCH 35/40] Added fix #11 to Travis config test failure. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7946fec8..faab9f73 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -221,7 +221,7 @@ endif() #------------------------------------------------------------------------------- add_test(NAME test_config COMMAND ${MEMORY_CHECK} ./test_config) add_executable(test_config test_config.c ../src/config.c ../src/string_helpers.c) -target_link_libraries (test_config -lcmocka -lcimplog -lcjwt -lcjson -ltrower-base64 -lssl -lcrypto ) +target_link_libraries (test_config -lcmocka -lcimplog -lcjwt -lcjson -ltrower-base64 ) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_config ${PARODUS_LINUX_ONLY_LIBS}) endif() From 86ea2fe7f44bd09e8f68a1f01ecfb1734f88dcf8 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Wed, 4 Apr 2018 14:26:04 -0700 Subject: [PATCH 36/40] Added fix #12 to Travis config test failure. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index faab9f73..d55953eb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -221,10 +221,10 @@ endif() #------------------------------------------------------------------------------- add_test(NAME test_config COMMAND ${MEMORY_CHECK} ./test_config) add_executable(test_config test_config.c ../src/config.c ../src/string_helpers.c) -target_link_libraries (test_config -lcmocka -lcimplog -lcjwt -lcjson -ltrower-base64 ) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_config ${PARODUS_LINUX_ONLY_LIBS}) endif() +target_link_libraries (test_config -lcmocka -lcimplog -lcjwt -lcjson -ltrower-base64 -lssl) #------------------------------------------------------------------------------- # test_upstream From 4b919aa0c742572de91e74ea7d241bc2f839a1ef Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Wed, 4 Apr 2018 14:50:31 -0700 Subject: [PATCH 37/40] Added fix to Travis connection interface test failure. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d55953eb..675cb700 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -277,10 +277,10 @@ else() set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(test_conn_interface ${SOURCES}) -target_link_libraries (test_conn_interface -lcmocka ${PARODUS_COMMON_LIBS} ) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_conn_interface ${PARODUS_LINUX_ONLY_LIBS}) endif() +target_link_libraries (test_conn_interface -lcmocka ${PARODUS_COMMON_LIBS} ) #------------------------------------------------------------------------------- # test_ParodusInternal From 10599a860dc772e027f4de18678985d897a3312f Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Wed, 4 Apr 2018 15:09:09 -0700 Subject: [PATCH 38/40] Added fix #2 to Travis connection interface test failure. --- tests/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 675cb700..f94996b1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,8 +21,8 @@ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -g -fprofile-arcs -ftest-cove set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -O0") set (PARODUS_COMMON_SRC ../src/string_helpers.c ../src/mutex.c ../src/time.c ../src/config.c ../src/spin_thread.c ../src/token.c) set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c - -lmsgpackc -lnopoll -lnanomsg -lcjwt -lssl -lcrypto - -lpthread -lcjson -ltrower-base64 -lm) + -lmsgpackc -lnopoll -lnanomsg -lcjwt -lssl -lpthread + -lcjson -ltrower-base64 -lm) set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) if (ENABLE_SESHAT) @@ -277,10 +277,10 @@ else() set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(test_conn_interface ${SOURCES}) +target_link_libraries (test_conn_interface -lcmocka ${PARODUS_COMMON_LIBS} ) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_conn_interface ${PARODUS_LINUX_ONLY_LIBS}) endif() -target_link_libraries (test_conn_interface -lcmocka ${PARODUS_COMMON_LIBS} ) #------------------------------------------------------------------------------- # test_ParodusInternal From 209c04a2601a936f297c1665b94ac056cd8388a0 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Wed, 4 Apr 2018 16:59:06 -0700 Subject: [PATCH 39/40] Ensured proper order of linked libs. --- tests/CMakeLists.txt | 46 +++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f94996b1..fd7d15ac 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,10 +25,6 @@ set (PARODUS_COMMON_LIBS -lcunit -lcimplog -lwrp-c -lcjson -ltrower-base64 -lm) set (PARODUS_LINUX_ONLY_LIBS gcov -luuid -lrt -Wl,--no-as-needed) -if (ENABLE_SESHAT) -set (PARODUS_COMMON_LIBS -llibseshat ${PARODUS_COMMON_LIBS}) -endif (ENABLE_SESHAT) - if (FEATURE_DNS_QUERY) set (PARODUS_COMMON_LIBS ${PARODUS_COMMON_LIBS} -lucresolv -lresolv) endif (FEATURE_DNS_QUERY) @@ -190,10 +186,13 @@ set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(test_client_list ${SOURCES}) -target_link_libraries (test_client_list ${PARODUS_COMMON_LIBS}) +if (ENABLE_SESHAT) +target_link_libraries (test_client_list -llibseshat) +endif (ENABLE_SESHAT) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_client_list ${PARODUS_LINUX_ONLY_LIBS}) endif() +target_link_libraries (test_client_list ${PARODUS_COMMON_LIBS}) #------------------------------------------------------------------------------- # test_service_alive @@ -206,15 +205,18 @@ endif() set(SOURCES test_service_alive.c ../src/client_list.c ../src/service_alive.c ../src/upstream.c ../src/networking.c ../src/nopoll_helpers.c ../src/nopoll_handlers.c ../src/config.c ../src/connection.c ../src/ParodusInternal.c ../src/downstream.c ../src/thread_tasks.c ../src/conn_interface.c ../src/partners_check.c ${PARODUS_COMMON_SRC}) if (ENABLE_SESHAT) set(SOURCES ${SOURCES} ../src/seshat_interface.c) -else() +else(ENABLE_SESHAT) set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(test_service_alive ${SOURCES}) -target_link_libraries (test_service_alive ${PARODUS_COMMON_LIBS}) +if (ENABLE_SESHAT) +target_link_libraries (test_service_alive -llibseshat) +endif (ENABLE_SESHAT) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_service_alive ${PARODUS_LINUX_ONLY_LIBS}) endif() +target_link_libraries (test_service_alive ${PARODUS_COMMON_LIBS}) #------------------------------------------------------------------------------- # test_config @@ -224,7 +226,7 @@ add_executable(test_config test_config.c ../src/config.c ../src/string_helpers.c if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_config ${PARODUS_LINUX_ONLY_LIBS}) endif() -target_link_libraries (test_config -lcmocka -lcimplog -lcjwt -lcjson -ltrower-base64 -lssl) +target_link_libraries (test_config -lcmocka ${PARODUS_COMMON_LIBS}) #------------------------------------------------------------------------------- # test_upstream @@ -273,14 +275,17 @@ add_test(NAME test_conn_interface COMMAND ${MEMORY_CHECK} ./test_conn_interface) set(SOURCES test_conn_interface.c ../src/conn_interface.c ../src/config.c ../src/string_helpers.c ../src/mutex.c) if (ENABLE_SESHAT) set(SOURCES ${SOURCES} ../src/seshat_interface.c) -else() +else(ENABLE_SESHAT) set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(test_conn_interface ${SOURCES}) -target_link_libraries (test_conn_interface -lcmocka ${PARODUS_COMMON_LIBS} ) +if (ENABLE_SESHAT) +target_link_libraries (test_conn_interface -llibseshat) +endif(ENABLE_SESHAT) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_conn_interface ${PARODUS_LINUX_ONLY_LIBS}) endif() +target_link_libraries (test_conn_interface -lcmocka ${PARODUS_COMMON_LIBS} ) #------------------------------------------------------------------------------- # test_ParodusInternal @@ -307,10 +312,13 @@ endif() #------------------------------------------------------------------------------- add_test(NAME test_token COMMAND ${MEMORY_CHECK} ./test_token) add_executable(test_token ${SOURCES} ) -target_link_libraries (test_token ${PARODUS_COMMON_LIBS} -lcmocka ) +if (ENABLE_SESHAT) +target_link_libraries (test_token -llibseshat ) +endif (ENABLE_SESHAT) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_token ${PARODUS_LINUX_ONLY_LIBS}) endif() +target_link_libraries (test_token ${PARODUS_COMMON_LIBS} -lcmocka ) #------------------------------------------------------------------------------- # test_seshat_interface - registerWithSeshat @@ -322,10 +330,13 @@ else() set(SOURCES test_seshat_interface_stub.c ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(test_seshat_interface ${SOURCES}) -target_link_libraries (test_seshat_interface -lcmocka ${PARODUS_COMMON_LIBS} -lwrp-c) +if (ENABLE_SESHAT) +target_link_libraries (test_seshat_interface -llibseshat) +endif (ENABLE_SESHAT) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_seshat_interface ${PARODUS_LINUX_ONLY_LIBS}) endif() +target_link_libraries (test_seshat_interface -lcmocka ${PARODUS_COMMON_LIBS} -lwrp-c) if (INTEGRATION_TESTING) #------------------------------------------------------------------------------- @@ -340,10 +351,13 @@ else() set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(simple_connection ${SOURCES}) -target_link_libraries (simple_connection ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS} ) +if (ENABLE_SESHAT) +target_link_libraries (simple_connection -llibseshat) +endif (ENABLE_SESHAT) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (simple_connection ${PARODUS_LINUX_ONLY_LIBS}) endif() +target_link_libraries (simple_connection ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS} ) #------------------------------------------------------------------------------- # simple test @@ -358,9 +372,11 @@ set(SOURCES ${SOURCES} ../src/seshat_interface_stub.c) endif (ENABLE_SESHAT) add_executable(simple ${SOURCES}) -target_link_libraries (simple ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS} -lnopoll -lnanomsg ) +if (ENABLE_SESHAT) +target_link_libraries (simple -llibseshat) +endif (ENABLE_SESHAT) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (simple ${PARODUS_LINUX_ONLY_LIBS}) endif() - +target_link_libraries (simple ${PARODUS_CONN_LIBS} ${PARODUS_COMMON_LIBS} -lnopoll -lnanomsg ) endif (INTEGRATION_TESTING) From 26eda8fb189c092b54e33d1d6cd3da31c5b748a3 Mon Sep 17 00:00:00 2001 From: Ramki Ananthakrishnan Date: Wed, 4 Apr 2018 17:15:11 -0700 Subject: [PATCH 40/40] Ensured proper order of linked libs to parodus internal code test. --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fd7d15ac..fa9c6eb4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -292,20 +292,20 @@ target_link_libraries (test_conn_interface -lcmocka ${PARODUS_COMMON_LIBS} ) #------------------------------------------------------------------------------- add_test(NAME test_ParodusInternal COMMAND ${MEMORY_CHECK} ./test_ParodusInternal) add_executable(test_ParodusInternal test_ParodusInternal.c ../src/ParodusInternal.c ../src/config.c ../src/string_helpers.c) -target_link_libraries (test_ParodusInternal -lcmocka ${PARODUS_COMMON_LIBS} ) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_ParodusInternal ${PARODUS_LINUX_ONLY_LIBS}) endif() +target_link_libraries (test_ParodusInternal -lcmocka ${PARODUS_COMMON_LIBS} ) #------------------------------------------------------------------------------- # test_partners_check #------------------------------------------------------------------------------- add_test(NAME test_partners_check COMMAND ${MEMORY_CHECK} ./test_partners_check) add_executable(test_partners_check test_partners_check.c ../src/partners_check.c ../src/string_helpers.c) -target_link_libraries (test_partners_check -lcmocka ${PARODUS_COMMON_LIBS} -lwrp-c) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries (test_partners_check ${PARODUS_LINUX_ONLY_LIBS}) endif() +target_link_libraries (test_partners_check -lcmocka ${PARODUS_COMMON_LIBS} -lwrp-c) #------------------------------------------------------------------------------- # test_token - token.c tests