From c62261710b4a5dc5ca86c04f5ef2b7bd66202e79 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 7 Nov 2014 18:32:37 +0200 Subject: [PATCH] Fixed wrong mysql libraries being used in the tests --- .../routing/readwritesplit/test/CMakeLists.txt | 8 +++++++- server/modules/routing/test/CMakeLists.txt | 11 ++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/server/modules/routing/readwritesplit/test/CMakeLists.txt b/server/modules/routing/readwritesplit/test/CMakeLists.txt index 9b49dac00..7a2a093d1 100644 --- a/server/modules/routing/readwritesplit/test/CMakeLists.txt +++ b/server/modules/routing/readwritesplit/test/CMakeLists.txt @@ -1,3 +1,9 @@ add_test(NAME ReadWriteSplitTest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/rwsplit.sh testrwsplit.log ${TEST_HOST} ${TEST_PORT_RW} ${TEST_MASTER_ID} ${TEST_USER} ${TEST_PASSWORD} ${CMAKE_CURRENT_SOURCE_DIR}) -add_test(NAME ReadWriteSplitLoginTest COMMAND $ 10000 ${TEST_HOST} ${MASTER_PORT} ${TEST_HOST} ${TEST_PORT_RW}) + +find_library(MYSQLCLIENT_LIBARIES NAMES mysqlclient PATH_SUFFIXES mysql mariadb) +if( NOT (MYSQLCLIENT_LIBRARIES MATCHES "NOTFOUND")) + add_test(NAME ReadWriteSplitLoginTest COMMAND $ 10000 ${TEST_HOST} ${MASTER_PORT} ${TEST_HOST} ${TEST_PORT_RW}) +endif() + + add_subdirectory(test_hints) \ No newline at end of file diff --git a/server/modules/routing/test/CMakeLists.txt b/server/modules/routing/test/CMakeLists.txt index 64f06f98f..0c33b534d 100644 --- a/server/modules/routing/test/CMakeLists.txt +++ b/server/modules/routing/test/CMakeLists.txt @@ -1,3 +1,8 @@ -add_executable(testconnect testconnect.c) -target_link_libraries(testconnect mysql) -add_test(NAME ReadConnRouterLoginTest COMMAND $ 10000 ${TEST_HOST} ${MASTER_PORT} ${TEST_HOST} ${TEST_PORT}) \ No newline at end of file +find_library(MYSQLCLIENT_LIBARIES NAMES mysqlclient PATH_SUFFIXES mysql mariadb) +if(MYSQLCLIENT_LIBRARIES MATCHES "NOTFOUND") + message(WARNING "Cannot find libmysqlclient. Login tests disabled.") +else() + add_executable(testconnect testconnect.c) + target_link_libraries(testconnect ${MYSQLCLIENT_LIBARIES}) + add_test(NAME ReadConnRouterLoginTest COMMAND $ 10000 ${TEST_HOST} ${MASTER_PORT} ${TEST_HOST} ${TEST_PORT}) +endif() \ No newline at end of file