Update Catch2 to v2.13.9, resolving a build error with GCC 11#75
Update Catch2 to v2.13.9, resolving a build error with GCC 11#75jpetso wants to merge 1 commit intotplgy:masterfrom
Conversation
|
I think it's time to Catch2 v3. |
|
hitting this issue as well during distro packaging and we'd need support for catch v3. Is this project dead? |
Possibly, I'm still looking at incoming PR/issue activity but haven't really taken the time to modernize the surrounding build infrastructure such as tests and CMake. Sorry. Found it more important/rewarding to work on KDE software instead. But also, I'll review any pull requests so if you're willing to contribute a patch, it can go in on short notice. |
|
But also it's the Arch project leader personally, so maybe I can make an exception and take some time for this. Love your distro, have been using it on both my laptop and desktop for years! |
|
Hi, I'm sorry that this issue has still not seen any movement. As a workaround, consider building with |
|
I'd rather not drop tests. In general running tests in the actual Arch env are a nice safeguard that repeatedly safe us from potentially releasing unexpected breakage.
We'd very much appreciate it if we can keep tests.
|
|
@jpetso updating to catch2 v3 should be relatively simple (does the following work for you): --- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,11 +1,7 @@
-find_package(PkgConfig)
-if(PKG_CONFIG_FOUND)
- pkg_check_modules(CATCH2 catch2)
-endif()
+find_package(Catch2 CONFIG QUIET)
-if(CATCH2_FOUND)
+if(Catch2_FOUND)
message(STATUS "Found system Catch2, not using bundled version")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CATCH2_CFLAGS}")
else()
message(STATUS "Did NOT find system Catch2, instead using bundled version")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/catch/single_include)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 39fceba..10abce2 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -8,13 +8,13 @@ if(CATCH2_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CATCH2_CFLAGS}")
else()
message(STATUS "Did NOT find system Catch2, instead using bundled version")
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/catch/single_include)
+ add_subdirectory(catch)
endif()
add_compile_options(${CPPCODEC_PRIVATE_COMPILE_OPTIONS})
add_executable(test_cppcodec test_cppcodec.cpp)
-target_link_libraries(test_cppcodec cppcodec)
+target_link_libraries(test_cppcodec cppcodec Catch2::Catch2WithMain)
add_test(NAME cppcodec COMMAND test_cppcodec)
add_executable(benchmark_cppcodec benchmark_cppcodec.cpp)
diff --git a/test/catch b/test/catch
index 15cf3ca..b670de4 160000
--- a/test/catch
+++ b/test/catch
@@ -1 +1 @@
-Subproject commit 15cf3caaceb21172ea42a24e595a2eb58c3ec960
+Subproject commit b670de4fe12ac7c5e858b7de3a14fb4bd18c760e
diff --git a/test/test_cppcodec.cpp b/test/test_cppcodec.cpp
index d7e50bc..1d6662b 100644
--- a/test/test_cppcodec.cpp
+++ b/test/test_cppcodec.cpp
@@ -22,7 +22,7 @@
*/
#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
#include <cppcodec/base32_crockford.hpp>
#include <cppcodec/base32_hex.hpp>Reduction to minimal headers from catch_all.hpp: diff --git a/test/test_cppcodec.cpp b/test/test_cppcodec.cpp
index 1d6662b..0577fb9 100644
--- a/test/test_cppcodec.cpp
+++ b/test/test_cppcodec.cpp
@@ -22,7 +22,7 @@
*/
#define CATCH_CONFIG_MAIN
-#include <catch2/catch_all.hpp>
+#include <catch2/catch_test_macros.hpp>
#include <cppcodec/base32_crockford.hpp>
#include <cppcodec/base32_hex.hpp> |
Fixes #74