Added Catch v3 support (#2661)

* Added Catch v3 support.

* Removed extra square brackets from some tests.
This commit is contained in:
Vitaly Zaitsev
2023-03-01 12:51:04 +01:00
committed by GitHub
parent 150ba9e6dd
commit 7f09c88817
12 changed files with 41 additions and 18011 deletions

View File

@@ -13,6 +13,20 @@ if(PkgConfig_FOUND)
pkg_check_modules(systemd libsystemd)
endif()
find_package(Catch2 3 QUIET)
if (Catch2_FOUND)
message(STATUS "Packaged version of Catch will be used.")
else()
message(STATUS "Bundled version of Catch will be downloaded and used.")
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.3.2
)
FetchContent_MakeAvailable(Catch2)
endif()
set(SPDLOG_UTESTS_SOURCES
test_file_helper.cpp
test_file_logging.cpp
@@ -53,6 +67,7 @@ function(spdlog_prepare_test test_target spdlog_lib)
if(systemd_FOUND)
target_link_libraries(${test_target} PRIVATE ${systemd_LIBRARIES})
endif()
target_link_libraries(${test_target} PRIVATE Catch2::Catch2WithMain)
if(SPDLOG_SANITIZE_ADDRESS)
spdlog_enable_sanitizer(${test_target})
endif()