From: Chow Loong Jin <hyperair@debian.org>
Date: Sat, 9 Dec 2023 17:17:42 +0800
Subject: Upgrade to catch2 v3

---
 tests/CMakeLists.txt | 6 +++---
 tests/catch_main.hpp | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 6e2faec..398c898 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,4 +1,4 @@
-find_package(Catch2 2.9 REQUIRED)
+find_package(Catch2 3.0 REQUIRED)
 
 include(Catch)
 
@@ -16,7 +16,7 @@ file(TO_NATIVE_PATH "${TEST_DATA_DIR}" TEST_DATA_DIR)
 add_library(test_common INTERFACE)
 target_include_directories(test_common INTERFACE ${CMAKE_CURRENT_LIST_DIR})
 target_compile_definitions(test_common INTERFACE TEST_DATA_DIR=R"\(${TEST_DATA_DIR}\)" CATCH_CONFIG_FAST_COMPILE)
-target_link_libraries(test_common INTERFACE Catch2::Catch2 Boost::nowide)
+target_link_libraries(test_common INTERFACE Catch2::Catch2WithMain Boost::nowide)
 
 if (EMSCRIPTEN)
     target_link_libraries(test_common INTERFACE nodefs.js noderawfs.js)
@@ -30,4 +30,4 @@ endif()
 
 if (${PROJECT_NAME}_BUILD_COMPONENT_Convert)
     add_subdirectory(convert)
-endif ()
\ No newline at end of file
+endif ()
diff --git a/tests/catch_main.hpp b/tests/catch_main.hpp
index 513e2c3..1e7427c 100644
--- a/tests/catch_main.hpp
+++ b/tests/catch_main.hpp
@@ -3,6 +3,7 @@
 
 #define CATCH_CONFIG_EXTERNAL_INTERFACES
 #define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
+#include <iostream>
 
 #endif // CATCH_MAIN
