diff --git a/src/stubgenerator/CMakeLists.txt b/src/stubgenerator/CMakeLists.txt index 2f4d3ef5..cef5e331 100644 --- a/src/stubgenerator/CMakeLists.txt +++ b/src/stubgenerator/CMakeLists.txt @@ -1,7 +1,6 @@ file(GLOB_RECURSE jsonrpcstub_source *.cpp) file(GLOB_RECURSE libstubgen_source *.cpp) -list(REMOVE_ITEM libstubgen_source main.cpp) - +list(REMOVE_ITEM libstubgen_source "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp") find_package(Argtable REQUIRED) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index bf2ed964..6459e3d2 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -13,6 +13,8 @@ file(COPY ${test_specs} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) set(testlibs ${Boost_LIBRARIES} jsonrpccommon jsonrpcclient jsonrpcserver) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src) +#add_definitions(-DBOOST_TEST_DYN_LINK) + IF(HTTP_CLIENT AND HTTP_SERVER) add_definitions(-DHTTP_TESTING) ENDIF() diff --git a/src/test/main.cpp b/src/test/main.cpp new file mode 100644 index 00000000..fdf4b6b1 --- /dev/null +++ b/src/test/main.cpp @@ -0,0 +1,13 @@ +/************************************************************************* + * libjson-rpc-cpp + ************************************************************************* + * @file main.cpp + * @date 1/21/2015 + * @author Peter Spiess-Knafl + * @license See attached LICENSE.txt + ************************************************************************/ + +#define BOOST_TEST_MODULE "libjson-rpc-cpp test suite" +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MAIN +#include diff --git a/src/test/test_client.cpp b/src/test/test_client.cpp index 8f8b1efe..6626deb1 100644 --- a/src/test/test_client.cpp +++ b/src/test/test_client.cpp @@ -7,9 +7,6 @@ * @license See attached LICENSE.txt ************************************************************************/ -#define BOOST_TEST_DYN_LINK -#define BOOST_TEST_MODULE client - #include #include #include "mockclientconnector.h" diff --git a/src/test/test_common.cpp b/src/test/test_common.cpp index e9bab62d..3c24c8f4 100644 --- a/src/test/test_common.cpp +++ b/src/test/test_common.cpp @@ -13,9 +13,6 @@ #include #include -#define BOOST_DYN_LINK -#define BOOST_TEST_MODULE - using namespace jsonrpc; using namespace std; diff --git a/src/test/test_connector_http.cpp b/src/test/test_connector_http.cpp index 87f73b30..44b18944 100644 --- a/src/test/test_connector_http.cpp +++ b/src/test/test_connector_http.cpp @@ -7,10 +7,8 @@ * @license See attached LICENSE.txt ************************************************************************/ -#include - #ifdef HTTP_TESTING -#define BOOST_TEST_MODULE connector_http +#include #include #include diff --git a/src/test/test_integration.cpp b/src/test/test_integration.cpp index 1413dcb6..35deb725 100644 --- a/src/test/test_integration.cpp +++ b/src/test/test_integration.cpp @@ -7,11 +7,9 @@ * @license See attached LICENSE.txt ************************************************************************/ -#include #ifdef INTEGRATION_TESTING -#define BOOST_TEST_MODULE integration - +#include #include #include diff --git a/src/test/test_server.cpp b/src/test/test_server.cpp index 9947bcf0..3db63964 100644 --- a/src/test/test_server.cpp +++ b/src/test/test_server.cpp @@ -11,9 +11,6 @@ #include "testserver.h" #include "mockserverconnector.h" -#define BOOST_TEST_DYN_LINK -#define BOOST_TEST_MODULE server - using namespace jsonrpc; using namespace std; diff --git a/src/test/test_stubgenerator.cpp b/src/test/test_stubgenerator.cpp index 4a63de8f..dbc42fdb 100644 --- a/src/test/test_stubgenerator.cpp +++ b/src/test/test_stubgenerator.cpp @@ -7,10 +7,8 @@ * @license See attached LICENSE.txt ************************************************************************/ -#include - #ifdef STUBGEN_TESTING -#define BOOST_TEST_MODULE stubgenerator +#include #include #include