Skip to content

Commit a9cc84a

Browse files
committed
adjusted build instructions of test for shared libs
The unit tests will compile and run now as well for cpp-netlib compiled as shared libraries.
1 parent 0ca215c commit a9cc84a

23 files changed

+69
-6
lines changed

CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ find_package( ICU )
1717
if(BUILD_SHARED_LIBS)
1818
set(Boost_USE_STATIC_LIBS OFF)
1919
# TODO/NOTE:
20-
# the unit tests and examples won't compile with the current setup and
21-
# shared libraries yet
22-
set(BUILD_TESTS OFF)
20+
# the examples won't compile with the current setup and shared libraries yet
2321
set(BUILD_EXAMPLES OFF)
2422
else()
2523
set(Boost_USE_STATIC_LIBS ON)

libs/network/src/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ endforeach(src_file)
6161
set(CPP-NETLIB_HTTP_MESSAGE_SRCS http/request.cpp http/response.cpp)
6262
add_library(cppnetlib-http-message ${CPP-NETLIB_HTTP_MESSAGE_SRCS})
6363
add_dependencies(cppnetlib-http-message
64-
${Boost_LIBRARIES}
64+
# ${Boost_LIBRARIES}
6565
cppnetlib-message)
6666
target_link_libraries(cppnetlib-http-message
6767
${Boost_LIBRARIES}
@@ -99,7 +99,7 @@ set(CPP-NETLIB_HTTP_SERVER_SRCS
9999
)
100100
add_library(cppnetlib-http-server ${CPP-NETLIB_HTTP_SERVER_SRCS})
101101
add_dependencies(cppnetlib-http-server
102-
${Boost_LIBRARIES}
102+
# ${Boost_LIBRARIES}
103103
cppnetlib-constants
104104
cppnetlib-uri
105105
cppnetlib-message
@@ -150,7 +150,7 @@ set(CPP-NETLIB_HTTP_CLIENT_SRCS
150150
http/client.cpp)
151151
add_library(cppnetlib-http-client ${CPP-NETLIB_HTTP_CLIENT_SRCS})
152152
add_dependencies(cppnetlib-http-client
153-
${Boost_LIBRARIES}
153+
# ${Boost_LIBRARIES}
154154
cppnetlib-constants
155155
cppnetlib-uri
156156
cppnetlib-message

libs/network/test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
include_directories(${CPP-NETLIB_SOURCE_DIR}/include)
77

8+
if(BUILD_SHARED_LIBS)
9+
add_definitions(-DBUILD_SHARED_LIBS)
10+
endif()
11+
812
add_subdirectory(uri)
913
add_subdirectory(http)
1014

libs/network/test/http/client_constructor_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// (See accompanying file LICENSE_1_0.txt or copy at
66
// http://www.boost.org/LICENSE_1_0.txt)
77

8+
#ifdef BUILD_SHARED_LIBS
9+
# define BOOST_TEST_DYN_LINK
10+
#endif
811
#define BOOST_TEST_MODULE HTTP 1.0 Client Constructor Test
912
#include <network/include/http/client.hpp>
1013
#include <boost/test/unit_test.hpp>

libs/network/test/http/client_get_different_port_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// (See accompanying file LICENSE_1_0.txt or copy at
66
// http://www.boost.org/LICENSE_1_0.txt)
77

8+
#ifdef BUILD_SHARED_LIBS
9+
# define BOOST_TEST_DYN_LINK
10+
#endif
811
#define BOOST_TEST_MODULE HTTP Client Get Different Port Test
912
#include <network/include/http/client.hpp>
1013
#include <boost/test/unit_test.hpp>

libs/network/test/http/client_get_streaming_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)
66

7+
#ifdef BUILD_SHARED_LIBS
8+
# define BOOST_TEST_DYN_LINK
9+
#endif
710
#define BOOST_TEST_MODULE HTTP 1.1 Get Streaming Test
811
#include <network/include/http/client.hpp>
912
#include <boost/test/unit_test.hpp>

libs/network/test/http/client_get_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)
66

7+
#ifdef BUILD_SHARED_LIBS
8+
# define BOOST_TEST_DYN_LINK
9+
#endif
710
#define BOOST_TEST_MODULE HTTP 1.0 Get Test
811
#include <network/include/http/client.hpp>
912
#include <boost/test/unit_test.hpp>

libs/network/test/http/client_get_timeout_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// (See accompanying file LICENSE_1_0.txt or copy at
66
// http://www.boost.org/LICENSE_1_0.txt)
77

8+
#ifdef BUILD_SHARED_LIBS
9+
# define BOOST_TEST_DYN_LINK
10+
#endif
811
#define BOOST_TEST_MODULE HTTP Client Get Timeout Test
912
#include <network/include/http/client.hpp>
1013
#include <boost/test/unit_test.hpp>

libs/network/test/http/request_base_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)
66

7+
#ifdef BUILD_SHARED_LIBS
8+
# define BOOST_TEST_DYN_LINK
9+
#endif
710
#define BOOST_TEST_MODULE HTTP Request Storage Base Test
811
#include <network/protocol/http/request/request_base.hpp>
912
#include <boost/test/unit_test.hpp>

libs/network/test/http/request_linearize_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// (See accompanying file LICENSE_1_0.txt or copy at
66
// http://www.boost.org/LICENSE_1_0.txt)
77

8+
#ifdef BUILD_SHARED_LIBS
9+
# define BOOST_TEST_DYN_LINK
10+
#endif
811
#define BOOST_TEST_MODULE HTTP Request Linearize Test
912
#include <network/protocol/http/request.hpp>
1013
#include <network/protocol/http/algorithms/linearize.hpp>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy