diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 62eb68be..4fdd328a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -42,13 +42,15 @@ add_custom_target(stop ) # Find dependencies -find_package(PkgConfig REQUIRED) -pkg_check_modules(GLIB_LIBRARY IMPORTED_TARGET glib-2.0) -find_library(LIBUV_LIBRARY uv HINTS /usr/lib/x86_64-linux-gnu) -find_library(LIBEV_LIBRARY ev HINTS /usr/lib/x86_64-linux-gnu) -find_library(LIBEVENT_LIBRARY event HINTS /usr/lib/x86_64-linux-gnu) -find_path(LIBEVENT_INCLUDES event2/event.h) -include_directories(${LIBEVENT_INCLUDES}) +if (NOT WIN32) + find_package(PkgConfig REQUIRED) + pkg_check_modules(GLIB_LIBRARY IMPORTED_TARGET glib-2.0) + find_library(LIBUV_LIBRARY uv HINTS /usr/lib/x86_64-linux-gnu) + find_library(LIBEV_LIBRARY ev HINTS /usr/lib/x86_64-linux-gnu) + find_library(LIBEVENT_LIBRARY event HINTS /usr/lib/x86_64-linux-gnu) + find_path(LIBEVENT_INCLUDES event2/event.h) + include_directories(${LIBEVENT_INCLUDES}) +endif() if(MSVC OR MINGW) find_library(LIBEVENT_LIBRARY Libevent) @@ -67,7 +69,10 @@ endif() if(LIBEVENT_LIBRARY) target_compile_definitions(client_test PUBLIC VALKEY_TEST_ASYNC=1) endif() -target_link_libraries(client_test valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) +target_link_libraries(client_test valkey ${SSL_LIBRARY}) +if(LIBEVENT_LIBRARY) + target_link_libraries(client_test ${LIBEVENT_LIBRARY}) +endif() add_test(NAME client_test COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/test.sh") if(TEST_WITH_REDIS_VERSION) set_property(TEST client_test PROPERTY ENVIRONMENT "VALKEY_SERVER=redis-server") @@ -76,70 +81,71 @@ if(SSL_LIBRARY) set_property(TEST client_test PROPERTY ENVIRONMENT "TEST_SSL=1") endif() -# Add cluster tests +# Add cluster tests (everywhere but Windows) +if (NOT WIN32) + add_executable(ct_async ct_async.c) + target_link_libraries(ct_async valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) + add_test(NAME ct_async COMMAND "$") + set_tests_properties(ct_async PROPERTIES LABELS "CT") -add_executable(ct_async ct_async.c) -target_link_libraries(ct_async valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) -add_test(NAME ct_async COMMAND "$") -set_tests_properties(ct_async PROPERTIES LABELS "CT") + add_executable(ct_commands ct_commands.c test_utils.c) + target_link_libraries(ct_commands valkey ${SSL_LIBRARY}) + add_test(NAME ct_commands COMMAND "$") + set_tests_properties(ct_commands PROPERTIES LABELS "CT") -add_executable(ct_commands ct_commands.c test_utils.c) -target_link_libraries(ct_commands valkey ${SSL_LIBRARY}) -add_test(NAME ct_commands COMMAND "$") -set_tests_properties(ct_commands PROPERTIES LABELS "CT") + add_executable(ct_connection ct_connection.c test_utils.c) + target_link_libraries(ct_connection valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) + add_test(NAME ct_connection COMMAND "$") + set_tests_properties(ct_connection PROPERTIES LABELS "CT") -add_executable(ct_connection ct_connection.c test_utils.c) -target_link_libraries(ct_connection valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) -add_test(NAME ct_connection COMMAND "$") -set_tests_properties(ct_connection PROPERTIES LABELS "CT") + add_executable(ct_pipeline ct_pipeline.c) + target_link_libraries(ct_pipeline valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) + add_test(NAME ct_pipeline COMMAND "$") + set_tests_properties(ct_pipeline PROPERTIES LABELS "CT") -add_executable(ct_pipeline ct_pipeline.c) -target_link_libraries(ct_pipeline valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) -add_test(NAME ct_pipeline COMMAND "$") -set_tests_properties(ct_pipeline PROPERTIES LABELS "CT") + add_executable(ct_connection_ipv6 ct_connection_ipv6.c) + target_link_libraries(ct_connection_ipv6 valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) + add_test(NAME ct_connection_ipv6 COMMAND "$") + set_tests_properties(ct_connection_ipv6 PROPERTIES LABELS "CT") + if(NOT ENABLE_IPV6_TESTS) + set_tests_properties(ct_connection_ipv6 PROPERTIES DISABLED True) + endif() -add_executable(ct_connection_ipv6 ct_connection_ipv6.c) -target_link_libraries(ct_connection_ipv6 valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) -add_test(NAME ct_connection_ipv6 COMMAND "$") -set_tests_properties(ct_connection_ipv6 PROPERTIES LABELS "CT") -if(NOT ENABLE_IPV6_TESTS) - set_tests_properties(ct_connection_ipv6 PROPERTIES DISABLED True) -endif() + add_executable(ct_out_of_memory_handling ct_out_of_memory_handling.c) + target_link_libraries(ct_out_of_memory_handling valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) + add_test(NAME ct_out_of_memory_handling COMMAND "$") + set_tests_properties(ct_out_of_memory_handling PROPERTIES LABELS "CT") -add_executable(ct_out_of_memory_handling ct_out_of_memory_handling.c) -target_link_libraries(ct_out_of_memory_handling valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) -add_test(NAME ct_out_of_memory_handling COMMAND "$") -set_tests_properties(ct_out_of_memory_handling PROPERTIES LABELS "CT") + add_executable(ct_specific_nodes ct_specific_nodes.c test_utils.c) + target_link_libraries(ct_specific_nodes valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) + add_test(NAME ct_specific_nodes COMMAND "$") + set_tests_properties(ct_specific_nodes PROPERTIES LABELS "CT") -add_executable(ct_specific_nodes ct_specific_nodes.c test_utils.c) -target_link_libraries(ct_specific_nodes valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) -add_test(NAME ct_specific_nodes COMMAND "$") -set_tests_properties(ct_specific_nodes PROPERTIES LABELS "CT") + add_executable(ut_parse_cmd ut_parse_cmd.c test_utils.c) + target_include_directories(ut_parse_cmd PRIVATE "${PROJECT_SOURCE_DIR}/src") + target_link_libraries(ut_parse_cmd valkey ${SSL_LIBRARY}) + add_test(NAME ut_parse_cmd COMMAND "$") + set_tests_properties(ut_parse_cmd PROPERTIES LABELS "UT") -add_executable(ut_parse_cmd ut_parse_cmd.c test_utils.c) -target_include_directories(ut_parse_cmd PRIVATE "${PROJECT_SOURCE_DIR}/src") -target_link_libraries(ut_parse_cmd valkey ${SSL_LIBRARY}) -add_test(NAME ut_parse_cmd COMMAND "$") -set_tests_properties(ut_parse_cmd PROPERTIES LABELS "UT") + if(LIBUV_LIBRARY) + add_executable(ct_async_libuv ct_async_libuv.c) + target_link_libraries(ct_async_libuv valkey ${SSL_LIBRARY} ${LIBUV_LIBRARY}) + add_test(NAME ct_async_libuv COMMAND "$") + set_tests_properties(ct_async_libuv PROPERTIES LABELS "CT") + else() + add_test(NAME ct_async_libuv COMMAND "") + set_tests_properties(ct_async_libuv PROPERTIES DISABLED True) + endif() -if(LIBUV_LIBRARY) - add_executable(ct_async_libuv ct_async_libuv.c) - target_link_libraries(ct_async_libuv valkey ${SSL_LIBRARY} ${LIBUV_LIBRARY}) - add_test(NAME ct_async_libuv COMMAND "$") - set_tests_properties(ct_async_libuv PROPERTIES LABELS "CT") -else() - add_test(NAME ct_async_libuv COMMAND "") - set_tests_properties(ct_async_libuv PROPERTIES DISABLED True) -endif() - -if(LIBEV_LIBRARY) - add_executable(ct_async_libev ct_async_libev.c) - target_link_libraries(ct_async_libev valkey ${SSL_LIBRARY} ${LIBEV_LIBRARY}) - add_test(NAME ct_async_libev COMMAND "$") - set_tests_properties(ct_async_libev PROPERTIES LABELS "CT") -else() - add_test(NAME ct_async_libev COMMAND "") - set_tests_properties(ct_async_libev PROPERTIES DISABLED True) + if(LIBEV_LIBRARY) + add_executable(ct_async_libev ct_async_libev.c) + target_link_libraries(ct_async_libev valkey ${SSL_LIBRARY} ${LIBEV_LIBRARY}) + add_test(NAME ct_async_libev COMMAND "$") + set_tests_properties(ct_async_libev PROPERTIES LABELS "CT") + else() + add_test(NAME ct_async_libev COMMAND "") + set_tests_properties(ct_async_libev PROPERTIES DISABLED True) + endif() endif() if(GLIB_LIBRARY_FOUND) @@ -153,117 +159,119 @@ else() endif() # Tests using simulated Valkey node -add_executable(clusterclient clusterclient.c) -target_link_libraries(clusterclient valkey ${SSL_LIBRARY}) -add_executable(clusterclient_async clusterclient_async.c) -target_link_libraries(clusterclient_async valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) -add_executable(clusterclient_reconnect_async clusterclient_reconnect_async.c) -target_link_libraries(clusterclient_reconnect_async valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) -add_test(NAME set-get-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/set-get-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME set-get-test-async - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/set-get-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME ask-redirect-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/ask-redirect-test.sh" +if (NOT WIN32) + add_executable(clusterclient clusterclient.c) + target_link_libraries(clusterclient valkey ${SSL_LIBRARY}) + add_executable(clusterclient_async clusterclient_async.c) + target_link_libraries(clusterclient_async valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) + add_executable(clusterclient_reconnect_async clusterclient_reconnect_async.c) + target_link_libraries(clusterclient_reconnect_async valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) + add_test(NAME set-get-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/set-get-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME set-get-test-async + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/set-get-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME ask-redirect-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/ask-redirect-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME ask-redirect-test-async + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/ask-redirect-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME ask-redirect-using-cluster-nodes-test-async + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/ask-redirect-using-cluster-nodes-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME moved-redirect-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/moved-redirect-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME moved-redirect-test-async + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/moved-redirect-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME moved-redirect-using-cluster-nodes-test-async + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/moved-redirect-using-cluster-nodes-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME dbsize-to-all-nodes-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/dbsize-to-all-nodes-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME dbsize-to-all-nodes-test-async + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/dbsize-to-all-nodes-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME dbsize-to-all-nodes-during-scaledown-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/dbsize-to-all-nodes-during-scaledown-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME dbsize-to-all-nodes-during-scaledown-test-async + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/dbsize-to-all-nodes-during-scaledown-test-async.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME reconnect-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/reconnect-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME timeout-handling-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/timeout-handling-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME connect-error-using-cluster-nodes-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/connect-error-using-cluster-nodes-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME command-from-callback-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/command-from-callback-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME ask-redirect-connection-error-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/ask-redirect-connection-error-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME cluster-down-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/cluster-down-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME connection-error-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/connection-error-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME redirect-with-hostname-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/redirect-with-hostname-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME redirect-with-ipv6-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/redirect-with-ipv6-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME redirect-with-ipv6-async-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/redirect-with-ipv6-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + if(NOT ENABLE_IPV6_TESTS) + set_tests_properties(redirect-with-ipv6-test PROPERTIES DISABLED True) + set_tests_properties(redirect-with-ipv6-async-test PROPERTIES DISABLED True) + endif() + add_test(NAME redirect-with-hostname-test-async + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/redirect-with-hostname-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME cluster-scale-down-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/cluster-scale-down-test.sh" "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME ask-redirect-test-async - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/ask-redirect-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME ask-redirect-using-cluster-nodes-test-async - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/ask-redirect-using-cluster-nodes-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME moved-redirect-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/moved-redirect-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME moved-redirect-test-async - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/moved-redirect-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME moved-redirect-using-cluster-nodes-test-async - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/moved-redirect-using-cluster-nodes-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME dbsize-to-all-nodes-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/dbsize-to-all-nodes-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME dbsize-to-all-nodes-test-async - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/dbsize-to-all-nodes-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME dbsize-to-all-nodes-during-scaledown-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/dbsize-to-all-nodes-during-scaledown-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME dbsize-to-all-nodes-during-scaledown-test-async - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/dbsize-to-all-nodes-during-scaledown-test-async.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME reconnect-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/reconnect-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME timeout-handling-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/timeout-handling-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME connect-error-using-cluster-nodes-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/connect-error-using-cluster-nodes-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME command-from-callback-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/command-from-callback-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME ask-redirect-connection-error-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/ask-redirect-connection-error-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME cluster-down-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/cluster-down-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME connection-error-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/connection-error-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME redirect-with-hostname-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/redirect-with-hostname-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME redirect-with-ipv6-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/redirect-with-ipv6-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME redirect-with-ipv6-async-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/redirect-with-ipv6-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -if(NOT ENABLE_IPV6_TESTS) - set_tests_properties(redirect-with-ipv6-test PROPERTIES DISABLED True) - set_tests_properties(redirect-with-ipv6-async-test PROPERTIES DISABLED True) -endif() -add_test(NAME redirect-with-hostname-test-async - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/redirect-with-hostname-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME cluster-scale-down-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/cluster-scale-down-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME slots-not-served-test - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/slots-not-served-test.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") -add_test(NAME slots-not-served-test-async - COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/slots-not-served-test-async.sh" - "$" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME slots-not-served-test + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/slots-not-served-test.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + add_test(NAME slots-not-served-test-async + COMMAND "${CMAKE_SOURCE_DIR}/tests/scripts/slots-not-served-test-async.sh" + "$" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/scripts/") + endif() diff --git a/tests/client_test.c b/tests/client_test.c index 8aa5e048..3b35c8c7 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -7,13 +7,13 @@ #include #include #include +#include #endif #include #include #include #include #include -#include #include "valkey.h" #include "async.h" @@ -26,6 +26,10 @@ #include #endif +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif + enum connection_type { CONN_TCP, CONN_UNIX,