Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
torbjoernk committed Nov 3, 2012
commit a9cc84aa9030ec44509a15a303522fc26d8cb373
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ find_package( ICU )
if(BUILD_SHARED_LIBS)
set(Boost_USE_STATIC_LIBS OFF)
# TODO/NOTE:
# the unit tests and examples won't compile with the current setup and
# shared libraries yet
set(BUILD_TESTS OFF)
# the examples won't compile with the current setup and shared libraries yet
set(BUILD_EXAMPLES OFF)
else()
set(Boost_USE_STATIC_LIBS ON)
Expand Down
6 changes: 3 additions & 3 deletions libs/network/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ endforeach(src_file)
set(CPP-NETLIB_HTTP_MESSAGE_SRCS http/request.cpp http/response.cpp)
add_library(cppnetlib-http-message ${CPP-NETLIB_HTTP_MESSAGE_SRCS})
add_dependencies(cppnetlib-http-message
${Boost_LIBRARIES}
# ${Boost_LIBRARIES}
cppnetlib-message)
target_link_libraries(cppnetlib-http-message
${Boost_LIBRARIES}
Expand Down Expand Up @@ -99,7 +99,7 @@ set(CPP-NETLIB_HTTP_SERVER_SRCS
)
add_library(cppnetlib-http-server ${CPP-NETLIB_HTTP_SERVER_SRCS})
add_dependencies(cppnetlib-http-server
${Boost_LIBRARIES}
# ${Boost_LIBRARIES}
cppnetlib-constants
cppnetlib-uri
cppnetlib-message
Expand Down Expand Up @@ -150,7 +150,7 @@ set(CPP-NETLIB_HTTP_CLIENT_SRCS
http/client.cpp)
add_library(cppnetlib-http-client ${CPP-NETLIB_HTTP_CLIENT_SRCS})
add_dependencies(cppnetlib-http-client
${Boost_LIBRARIES}
# ${Boost_LIBRARIES}
cppnetlib-constants
cppnetlib-uri
cppnetlib-message
Expand Down
4 changes: 4 additions & 0 deletions libs/network/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

include_directories(${CPP-NETLIB_SOURCE_DIR}/include)

if(BUILD_SHARED_LIBS)
add_definitions(-DBUILD_SHARED_LIBS)
endif()

add_subdirectory(uri)
add_subdirectory(http)

Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/http/client_constructor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP 1.0 Client Constructor Test
#include <network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/http/client_get_different_port_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Client Get Different Port Test
#include <network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/http/client_get_streaming_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP 1.1 Get Streaming Test
#include <network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/http/client_get_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP 1.0 Get Test
#include <network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/http/client_get_timeout_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Client Get Timeout Test
#include <network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/http/request_base_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Request Storage Base Test
#include <network/protocol/http/request/request_base.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/http/request_linearize_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Request Linearize Test
#include <network/protocol/http/request.hpp>
#include <network/protocol/http/algorithms/linearize.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/http/request_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Request Test
#include <network/protocol/http/request.hpp>
#include <network/protocol/http/message/wrappers.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/http/response_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Client Response Test
#include <network/protocol/http/response.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
4 changes: 4 additions & 0 deletions libs/network/test/http/server_async_run_stop_concurrency.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
# define BOOST_TEST_NO_MAIN
#endif
#define BOOST_TEST_MODULE HTTP Asynchronous Server Tests

#include <network/include/http/server.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/http/server_constructor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Server Construtor Tests

#include <network/include/http/server.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/message_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE message test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/message_transform_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE message test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/uri/relative_uri_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE Relative URL Test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/uri/scheme_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE URI Scheme Test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/uri/uri_builder_stream_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE URI builder stream test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/uri/uri_builder_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE URI builder test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/uri/uri_encoding_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE URI encoding test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/uri/uri_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt of copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE URI Test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletions libs/network/test/utils_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE utils thread pool test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down