File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed
Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,21 @@ if (GTest_FOUND)
66else ()
77 include (FetchContent)
88 FetchContent_Declare(
9- googletest
10- URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
9+ googletest
10+ GIT_REPOSITORY https://github.com/google/googletest.git
11+ GIT_TAG v1.17.0
1112 )
12- # For Windows: Prevent overriding the parent project's compiler/linker on Windows
13- set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
13+ if (WIN32 )
14+ # For Windows: Prevent overriding the parent project's compiler/linker on Windows
15+ set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
16+ endif ()
1417 FetchContent_MakeAvailable(googletest)
1518endif ()
1619
1720enable_testing ()
1821
22+ include (GoogleTest)
23+
1924add_executable (websocket_tests websocket_tests.cpp)
2025target_link_libraries (websocket_tests PRIVATE slick_net GTest::gtest_main)
2126
@@ -27,5 +32,15 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
2732 target_compile_options (http_tests PRIVATE /fsanitize=address)
2833endif ()
2934
30- add_test (NAME WebsocketTests COMMAND websocket_tests)
31- add_test (NAME HttpTests COMMAND http_tests)
35+ # Discover tests with increased timeout
36+ gtest_discover_tests(websocket_tests DISCOVERY_TIMEOUT 30)
37+ gtest_discover_tests(http_tests DISCOVERY_TIMEOUT 30)
38+
39+ # Set test properties
40+ set_target_properties (websocket_tests PROPERTIES
41+ RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /tests
42+ )
43+
44+ set_target_properties (http_tests PROPERTIES
45+ RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /tests
46+ )
You can’t perform that action at this time.
0 commit comments