Merge pull request #84 from kotopesutility/develop

Fixed building for catch2 (>=3.0)
This commit is contained in:
Frank Pagliughi
2023-06-14 14:49:07 -04:00
committed by GitHub
16 changed files with 25 additions and 14 deletions

View File

@@ -39,6 +39,11 @@
set(UNIT_TEST_DIR ${PROJECT_SOURCE_DIR})
find_package(Catch2 REQUIRED)
if (Catch2_VERSION VERSION_LESS "3.0")
add_definitions(-DCATCH2_V2)
message(WARNING "catch2 version is less than in upstream")
endif()
# --- For apps that use threads ---
set(THREADS_PREFER_PTHREAD_FLAG ON)
@@ -80,6 +85,7 @@ target_include_directories(unit_tests
${SOCKPP_INCLUDE_DIR}
PRIVATE
${SOCKPP_GENERATED_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}
)
set_target_properties(unit_tests PROPERTIES

View File

@@ -0,0 +1,5 @@
#ifdef CATCH2_V2
#include "catch2/catch.hpp"
#else
#include "catch2/catch_all.hpp"
#endif

View File

@@ -40,7 +40,7 @@
#include "sockpp/acceptor.h"
#include "sockpp/inet_address.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -39,7 +39,7 @@
//
#include "sockpp/can_address.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -40,7 +40,7 @@
#include "sockpp/connector.h"
#include "sockpp/sock_address.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -40,7 +40,7 @@
#include "sockpp/datagram_socket.h"
#include "sockpp/inet_address.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -39,7 +39,7 @@
//
#include "sockpp/inet6_address.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -39,7 +39,7 @@
//
#include "sockpp/inet_address.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -38,7 +38,7 @@
//
#include "sockpp/result.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
using namespace sockpp;

View File

@@ -40,7 +40,7 @@
#include "sockpp/socket.h"
#include "sockpp/inet_address.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -40,7 +40,7 @@
#include "sockpp/stream_socket.h"
#include "sockpp/inet_address.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -41,7 +41,7 @@
#include "sockpp/tcp_socket.h"
#include "sockpp/tcp_connector.h"
#include "sockpp/tcp_acceptor.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -39,7 +39,7 @@
//
#include "sockpp/unix_address.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -39,7 +39,7 @@
//
#include "sockpp/unix_dgram_socket.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -39,7 +39,7 @@
//
#include "sockpp/unix_stream_socket.h"
#include "catch2/catch.hpp"
#include <catch2_version.h>
#include <string>
using namespace sockpp;

View File

@@ -56,7 +56,7 @@
#endif
#define CATCH_CONFIG_RUNNER
#include "catch2/catch.hpp"
#include <catch2_version.h>
int main(int argc, char* argv[])
{