Fetch catch2 from git repo

This commit is contained in:
badaix 2024-06-08 19:25:58 +02:00
parent a88ff9cfad
commit f44609a872
5 changed files with 16 additions and 25712 deletions

View file

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.14)
project(
snapcast

View file

@ -1,21 +1,16 @@
# Prepare "Catch" library for other executables
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
add_library(Catch INTERFACE)
target_include_directories(
Catch INTERFACE ${CATCH_INCLUDE_DIR} ${CMAKE_SOURCE_DIR} ${Boost_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR})
include(FetchContent)
set(TEST_LIBRARIES Catch)
if(ANDROID)
list(APPEND TEST_LIBRARIES log)
endif(ANDROID)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.6.0 # or a later release
)
list(APPEND TEST_LIBRARIES OpenSSL::Crypto OpenSSL::SSL)
FetchContent_MakeAvailable(Catch2)
# Make test executable
set(TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/test_main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/catch_amalgamated.cpp
${CMAKE_SOURCE_DIR}/common/jwt.cpp
${CMAKE_SOURCE_DIR}/common/base64.cpp
${CMAKE_SOURCE_DIR}/server/streamreader/control_error.cpp
@ -24,4 +19,10 @@ set(TEST_SOURCES
${CMAKE_SOURCE_DIR}/server/streamreader/stream_uri.cpp)
add_executable(snapcast_test ${TEST_SOURCES})
target_link_libraries(snapcast_test ${TEST_LIBRARIES})
if(ANDROID)
target_link_libraries(snapcast_test log)
endif(ANDROID)
target_link_libraries(snapcast_test PRIVATE OpenSSL::Crypto OpenSSL::SSL
Catch2::Catch2WithMain)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -20,8 +20,6 @@
#define NOMINMAX
#endif // NOMINMAX
// prototype/interface header file
// local headers
@ -33,7 +31,7 @@
#include "server/streamreader/stream_uri.hpp"
// 3rd party headers
#include "catch_amalgamated.hpp"
#include <catch2/catch_test_macros.hpp>
// standard headers
#include <regex>