@@ -12,82 +12,93 @@ if (OPENSSL_FOUND)
12
12
endif ()
13
13
14
14
if (Boost_FOUND)
15
- set ( TESTS
16
- response_incremental_parser_test
17
- request_incremental_parser_test
18
- request_linearize_test
19
- )
15
+ set (TESTS response_incremental_parser_test request_incremental_parser_test
16
+ request_linearize_test)
20
17
foreach ( test ${TESTS} )
21
18
add_executable (cpp-netlib-http-${test} ${test} .cpp)
22
- add_dependencies (cpp-netlib-http-${test}
19
+ add_dependencies (cpp-netlib-http-${test} gtest_main
23
20
cppnetlib-uri)
24
21
target_link_libraries (cpp-netlib-http-${test}
25
- ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
22
+ ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} gtest_main
26
23
cppnetlib-uri)
27
- if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
24
+ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
28
25
target_link_libraries (cpp-netlib-http-${test} ws2_32)
29
26
endif ()
30
- if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
31
- target_link_libraries (cpp-netlib-http-${test} rt)
32
- endif ()
27
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
28
+ target_link_libraries (cpp-netlib-http-${test} rt)
29
+ endif ()
33
30
set_target_properties (cpp-netlib-http-${test}
34
31
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
35
32
add_test (cpp-netlib-http-${test}
36
33
${CPP-NETLIB_BINARY_DIR }/tests/cpp-netlib-http-${test} )
37
34
endforeach (test )
38
- set ( TESTS
39
- client_constructor_test
40
- client_get_test
41
- client_get_different_port_test
42
- client_get_timeout_test
43
- client_get_streaming_test
44
- )
35
+ set (TESTS client_constructor_test client_get_test
36
+ client_get_different_port_test client_get_timeout_test
37
+ client_get_streaming_test)
45
38
foreach ( test ${TESTS} )
46
39
add_executable (cpp-netlib-http-${test} ${test} .cpp)
47
- add_dependencies (cpp-netlib-http-${test}
48
- cppnetlib-uri
49
- cppnetlib-client-connections)
50
- target_link_libraries (cpp-netlib-http-${test}
51
- ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
52
- cppnetlib-uri
53
- cppnetlib-client-connections)
40
+ add_dependencies (cpp-netlib-http-${test} cppnetlib-uri
41
+ cppnetlib-client-connections gtest_main)
42
+ target_link_libraries (cpp-netlib-http-${test} ${Boost_LIBRARIES}
43
+ ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri gtest_main cppnetlib-client-connections)
54
44
if (OPENSSL_FOUND)
55
45
target_link_libraries (cpp-netlib-http-${test} ${OPENSSL_LIBRARIES} )
56
46
endif ()
57
- if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
47
+ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
58
48
target_link_libraries (cpp-netlib-http-${test} ws2_32)
59
49
endif ()
60
- if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
61
- target_link_libraries (cpp-netlib-http-${test} rt)
62
- endif ()
50
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
51
+ target_link_libraries (cpp-netlib-http-${test} rt)
52
+ endif ()
63
53
set_target_properties (cpp-netlib-http-${test}
64
54
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
65
55
add_test (cpp-netlib-http-${test}
66
56
${CPP-NETLIB_BINARY_DIR }/tests/cpp-netlib-http-${test} )
67
57
endforeach (test )
68
58
69
- set ( SERVER_API_TESTS
70
- server_constructor_test
71
- server_async_run_stop_concurrency
72
- server_header_parser_test
73
- )
74
- foreach ( test ${SERVER_API_TESTS} )
59
+ set (SERVER_API_TESTS server_constructor_test
60
+ server_header_parser_test)
61
+ foreach (test ${SERVER_API_TESTS} )
75
62
add_executable (cpp-netlib-http-${test} ${test} .cpp)
76
63
add_dependencies (cpp-netlib-http-${test} cppnetlib-server-parsers)
77
- target_link_libraries (cpp-netlib-http-${test} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
64
+ target_link_libraries (cpp-netlib-http-${test} ${Boost_LIBRARIES}
65
+ ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers gtest_main)
78
66
if (OPENSSL_FOUND)
79
67
target_link_libraries (cpp-netlib-http-${test} ${OPENSSL_LIBRARIES} )
80
68
endif ()
81
- if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
69
+ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
82
70
target_link_libraries (cpp-netlib-http-${test} ws2_32 wsock32)
83
71
endif ()
84
- if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
85
- target_link_libraries (cpp-netlib-http-${test} rt)
86
- endif ()
72
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
73
+ target_link_libraries (cpp-netlib-http-${test} rt)
74
+ endif ()
87
75
set_target_properties (cpp-netlib-http-${test}
88
76
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
89
77
add_test (cpp-netlib-http-${test}
90
78
${CPP-NETLIB_BINARY_DIR }/tests/cpp-netlib-http-${test} )
91
79
endforeach (test )
92
80
81
+ # Add the server start/stop concurrency test
82
+ add_executable (cpp-netlib-http-server_async_run_stop_concurrency
83
+ server_async_run_stop_concurrency.cpp)
84
+ add_dependencies (cpp-netlib-http-server_async_run_stop_concurrency
85
+ cppnetlib-server-parsers)
86
+ target_link_libraries (cpp-netlib-http-server_async_run_stop_concurrency
87
+ ${Boost_LIBRARIES} cppnetlib-server-parsers)
88
+ if (OPENSSL_FOUND)
89
+ target_link_libraries (cpp-netlib-http-server_async_run_stop_concurrency
90
+ ${OPENSSL_LIBRARIES} )
91
+ endif ()
92
+ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU
93
+ AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
94
+ target_link_libraries (cpp-netlib-http-server_async_run_stop_concurrency
95
+ ws2_32 wsock32)
96
+ endif ()
97
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
98
+ target_link_libraries (cpp-netlib-http-server_async_run_stop_concurrency rt)
99
+ endif ()
100
+ set_target_properties (cpp-netlib-http-server_async_run_stop_concurrency
101
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
102
+ add_test (cpp-netlib-http-server_async_run_stop_concurrency
103
+ ${CPP-NETLIB_BINARY_DIR }/tests/cpp-netlib-http-server_async_run_stop_concurrency)
93
104
endif ()
0 commit comments