Update Catch2 to v3
This commit is contained in:
committed by
mathieui
parent
c7a0ce553f
commit
5cb2802fd2
+4
-18
@@ -288,25 +288,11 @@ foreach(file ${source_all})
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
#
|
#
|
||||||
## Add a rule to download the catch unit test framework
|
## Catch unit test framework
|
||||||
#
|
#
|
||||||
include(ExternalProject)
|
find_package(Catch2)
|
||||||
ExternalProject_Add(catch
|
if(Catch2_FOUND)
|
||||||
GIT_REPOSITORY "https://codeberg.org/poezio/Catch.git"
|
target_link_libraries(test_suite Catch2::Catch2WithMain)
|
||||||
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)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ botan3-dev \
|
|||||||
util-linux-dev \
|
util-linux-dev \
|
||||||
libgcrypt-dev \
|
libgcrypt-dev \
|
||||||
postgresql-dev \
|
postgresql-dev \
|
||||||
|
catch2-3 \
|
||||||
valgrind \
|
valgrind \
|
||||||
py3-pip \
|
py3-pip \
|
||||||
py3-lxml \
|
py3-lxml \
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ libsystemd-dev \
|
|||||||
uuid-dev \
|
uuid-dev \
|
||||||
libgcrypt20-dev \
|
libgcrypt20-dev \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
|
libcatch2-dev \
|
||||||
valgrind \
|
valgrind \
|
||||||
libasan6 \
|
libasan6 \
|
||||||
libubsan1 \
|
libubsan1 \
|
||||||
@@ -28,4 +29,4 @@ python3-lxml \
|
|||||||
python3-slixmpp \
|
python3-slixmpp \
|
||||||
wget
|
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
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ postgresql-devel \
|
|||||||
lcov \
|
lcov \
|
||||||
libasan \
|
libasan \
|
||||||
libubsan \
|
libubsan \
|
||||||
|
catch \
|
||||||
valgrind \
|
valgrind \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
python3-lxml \
|
python3-lxml \
|
||||||
@@ -39,4 +40,4 @@ rpmdevtools \
|
|||||||
RUN pip3 install --break-system-packages slixmpp
|
RUN pip3 install --break-system-packages slixmpp
|
||||||
|
|
||||||
# Install oragono, for e2e tests
|
# 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
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <bridge/colors.hpp>
|
#include <bridge/colors.hpp>
|
||||||
#include <xmpp/xmpp_stanza.hpp>
|
#include <xmpp/xmpp_stanza.hpp>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
#include "io_tester.hpp"
|
#include "io_tester.hpp"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <biboumi.h>
|
#include <biboumi.h>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <utils/encoding.hpp>
|
#include <utils/encoding.hpp>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <irc/iid.hpp>
|
#include <irc/iid.hpp>
|
||||||
#include <irc/irc_user.hpp>
|
#include <irc/irc_user.hpp>
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
#include "io_tester.hpp"
|
#include "io_tester.hpp"
|
||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <irc/irc_message.hpp>
|
#include <irc/irc_message.hpp>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <xmpp/jid.hpp>
|
#include <xmpp/jid.hpp>
|
||||||
#include <biboumi.h>
|
#include <biboumi.h>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <logger/logger.hpp>
|
#include <logger/logger.hpp>
|
||||||
#include <config/config.hpp>
|
#include <config/config.hpp>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
#include <network/tls_policy.hpp>
|
#include <network/tls_policy.hpp>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
#define CATCH_CONFIG_MAIN
|
|
||||||
#include "catch.hpp"
|
|
||||||
+1
-15
@@ -1,21 +1,7 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <utils/timed_events.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:
|
* TODO, use a mock clock instead of relying on the real time with a sleep:
|
||||||
* it’s unreliable on heavy load.
|
* it’s unreliable on heavy load.
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <utils/tolower.hpp>
|
#include <utils/tolower.hpp>
|
||||||
#include <utils/revstr.hpp>
|
#include <utils/revstr.hpp>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <xmpp/xmpp_component.hpp>
|
#include <xmpp/xmpp_component.hpp>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "catch.hpp"
|
#include "catch2/catch_test_macros.hpp"
|
||||||
|
|
||||||
#include <xmpp/xmpp_parser.hpp>
|
#include <xmpp/xmpp_parser.hpp>
|
||||||
#include <xmpp/auth.hpp>
|
#include <xmpp/auth.hpp>
|
||||||
|
|||||||
Reference in New Issue
Block a user