Update Catch2 to v3

This commit is contained in:
Luca Matei Pintilie
2025-10-12 17:45:58 +02:00
committed by mathieui
parent c7a0ce553f
commit 5cb2802fd2
19 changed files with 23 additions and 50 deletions
+4 -18
View File
@@ -288,25 +288,11 @@ foreach(file ${source_all})
endforeach()
#
## Add a rule to download the catch unit test framework
## Catch unit test framework
#
include(ExternalProject)
ExternalProject_Add(catch
GIT_REPOSITORY "https://codeberg.org/poezio/Catch.git"
GIT_TAG "v1.5.9"
PREFIX "external"
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
set_target_properties(catch PROPERTIES EXCLUDE_FROM_ALL TRUE)
ExternalProject_Get_Property(catch SOURCE_DIR)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/tests/catch.hpp)
target_include_directories(test_suite
PUBLIC "${SOURCE_DIR}/single_include/"
)
add_dependencies(test_suite catch)
find_package(Catch2)
if(Catch2_FOUND)
target_link_libraries(test_suite Catch2::Catch2WithMain)
endif()
#
+1
View File
@@ -20,6 +20,7 @@ botan3-dev \
util-linux-dev \
libgcrypt-dev \
postgresql-dev \
catch2-3 \
valgrind \
py3-pip \
py3-lxml \
+2 -1
View File
@@ -21,6 +21,7 @@ libsystemd-dev \
uuid-dev \
libgcrypt20-dev \
libpq-dev \
libcatch2-dev \
valgrind \
libasan6 \
libubsan1 \
@@ -28,4 +29,4 @@ python3-lxml \
python3-slixmpp \
wget
RUN wget "https://github.com/oragono/oragono/releases/download/v2.0.0/oragono-2.0.0-linux-x64.tar.gz" && tar xvf oragono-2.0.0-linux-x64.tar.gz && cp oragono-2.0.0-linux-x64/oragono /usr/local/bin
RUN wget "https://github.com/ergochat/ergo/releases/download/v2.0.0/oragono-2.0.0-linux-x64.tar.gz" && tar xvf oragono-2.0.0-linux-x64.tar.gz && cp oragono-2.0.0-linux-x64/oragono /usr/local/bin
+2 -1
View File
@@ -24,6 +24,7 @@ postgresql-devel \
lcov \
libasan \
libubsan \
catch \
valgrind \
python3-pip \
python3-lxml \
@@ -39,4 +40,4 @@ rpmdevtools \
RUN pip3 install --break-system-packages slixmpp
# Install oragono, for e2e tests
RUN wget "https://github.com/oragono/oragono/releases/download/v2.0.0/oragono-2.0.0-linux-x64.tar.gz" && tar xvf oragono-2.0.0-linux-x64.tar.gz && cp oragono-2.0.0-linux-x64/oragono /usr/local/bin
RUN wget "https://github.com/ergochat/ergo/releases/download/v2.0.0/oragono-2.0.0-linux-x64.tar.gz" && tar xvf oragono-2.0.0-linux-x64.tar.gz && cp oragono-2.0.0-linux-x64/oragono /usr/local/bin
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <bridge/colors.hpp>
#include <xmpp/xmpp_stanza.hpp>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include "io_tester.hpp"
#include <iostream>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <biboumi.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <utils/encoding.hpp>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <irc/iid.hpp>
#include <irc/irc_user.hpp>
+1 -1
View File
@@ -1,5 +1,5 @@
#include "io_tester.hpp"
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <iostream>
/**
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <irc/irc_message.hpp>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <xmpp/jid.hpp>
#include <biboumi.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <logger/logger.hpp>
#include <config/config.hpp>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <network/tls_policy.hpp>
#include <sstream>
-2
View File
@@ -1,2 +0,0 @@
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
+1 -15
View File
@@ -1,21 +1,7 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <utils/timed_events.hpp>
/**
* Let Catch know how to display std::chrono::duration values
*/
namespace Catch
{
template<typename Rep, typename Period> struct StringMaker<std::chrono::duration<Rep, Period>>
{
static std::string convert(const std::chrono::duration<Rep, Period>& value)
{
return std::to_string(std::chrono::duration_cast<std::chrono::milliseconds>(value).count()) + "ms";
}
};
}
/**
* TODO, use a mock clock instead of relying on the real time with a sleep:
* it’s unreliable on heavy load.
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <utils/tolower.hpp>
#include <utils/revstr.hpp>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <xmpp/xmpp_component.hpp>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "catch.hpp"
#include "catch2/catch_test_macros.hpp"
#include <xmpp/xmpp_parser.hpp>
#include <xmpp/auth.hpp>