6#ifndef MIMICPP_ADAPTERS_CATCH2_HPP
7#define MIMICPP_ADAPTERS_CATCH2_HPP
11#if __has_include("mimic++/Reporting.hpp")
14#elif not defined(MIMICPP_VERSION)
15 #error "It appears that the test-adapter is not included in the mimic++ project or package." \
16 "If you plan to use it alongside the mimic++-amalgamated header, please ensure to include the adapter-header afterwards."
19#if __has_include(<catch2/catch_test_macros.hpp>)
20 #include <catch2/catch_test_macros.hpp>
22 #error "Unable to find catch2 includes."
25namespace mimicpp::reporting::detail::catch2
29#ifdef CATCH_CONFIG_PREFIX_ALL
38#ifdef CATCH_CONFIG_PREFIX_MESSAGES
55#ifdef CATCH_CONFIG_PREFIX_ALL
61 CATCH_CATCH_ANON(Catch::TestFailureException
const&)
63 send_warning(
"Fatal failure!");
88 &detail::catch2::send_success,
89 &detail::catch2::send_warning,
90 &detail::catch2::send_fail>;
95namespace mimicpp::reporting::detail::catch2
98 inline const ReporterInstaller<Catch2ReporterT> installer{};
101#ifdef MIMICPP_CONFIG_EXPERIMENTAL_CATCH2_MATCHER_INTEGRATION
103#include <catch2/matchers/catch_matchers_templated.hpp>
105template <
typename Matcher>
106 requires std::derived_from<Matcher, Catch::Matchers::MatcherGenericBase>
107 || std::derived_from<Matcher, Catch::Matchers::MatcherUntypedBase>
110 template <
typename T>
112 static constexpr bool matches(
const Matcher& matcher, T& value)
113 requires requires { { matcher.match(value) } -> std::convertible_to<bool>; }
115 return matcher.match(value);
A reporter, which creates text messages and reports them via the provided callbacks.
Definition BasicReporter.hpp:40
BasicReporter< &detail::catch2::send_success, &detail::catch2::send_warning, &detail::catch2::send_fail > Catch2ReporterT
Reporter for the integration into Catch2.
Definition Catch2.hpp:87
Definition BasicReporter.hpp:27
std::basic_string_view< CharT, CharTraitsT > StringViewT
Definition Fwd.hpp:392