6#ifndef MIMICPP_REPORTING_BASIC_REPORTER_HPP
7#define MIMICPP_REPORTING_BASIC_REPORTER_HPP
19#ifndef MIMICPP_DETAIL_IS_MODULE
34 std::invocable<StringT const&>
auto successReporter,
35 std::invocable<StringT const&>
auto warningReporter,
36 std::invocable<StringT const&>
auto failReporter>
60 if (0 == std::uncaught_exceptions())
68 if (0 == std::uncaught_exceptions())
77 std::exception_ptr
const exception)
override
83 void send_success(
StringT const& msg)
85 std::invoke(successReporter, msg);
88 void send_warning(
StringT const& msg)
90 std::invoke(warningReporter, msg);
94 void send_fail(
StringT const& msg)
97 std::invoke(failReporter, msg);
#define MIMICPP_DETAIL_MODULE_EXPORT
Definition Config.hpp:19
A reporter, which creates text messages and reports them via the provided callbacks.
Definition BasicReporter.hpp:39
void report_unhandled_exception(CallReport const call, ExpectationReport const expectationReport, std::exception_ptr const exception) override
Handles reports about unhandled exceptions during handle_call.
Definition BasicReporter.hpp:74
void report_unfulfilled_expectation(ExpectationReport const expectationReport) override
Handles the report of an unfulfilled expectation.
Definition BasicReporter.hpp:58
void report_error(StringT const message) override
Handles general or unspecified errors.
Definition BasicReporter.hpp:66
void report_inapplicable_matches(CallReport call, std::vector< MatchReport > reports) override
Handles reports for all inapplicable but otherwise matching expectations. This function is called onl...
Definition BasicReporter.hpp:48
void report_full_match(CallReport call, MatchReport report) noexcept override
Handles the report for a fully matching expectation.
Definition BasicReporter.hpp:53
void report_no_matches(CallReport call, std::vector< MatchReport > noMatchReports) override
Expects reports on all non-matching expectations. This is only called when no better options are avai...
Definition BasicReporter.hpp:42
Contains the extracted info from a typed call::Info.
Definition CallReport.hpp:43
Contains the extracted info from a typed expectation.
Definition ExpectationReport.hpp:85
Contains the expectation-report and the match-results to a specific call.
Definition MatchReport.hpp:22
Definition BasicReporter.hpp:26
StringT stringify_full_match(CallReport const &call, MatchReport match)
Definition StringifyReports.hpp:317
StringT stringify_unhandled_exception(CallReport const &call, ExpectationReport const &expectationReport, std::exception_ptr const &exception)
Definition StringifyReports.hpp:471
StringT stringify_unfulfilled_expectation(ExpectationReport const &expectationReport)
Definition StringifyReports.hpp:455
StringT stringify_inapplicable_matches(CallReport const &call, std::span< MatchReport > reports)
Definition StringifyReports.hpp:354
StringT stringify_no_matches(CallReport const &call, std::span< MatchReport > noMatchReports)
Definition StringifyReports.hpp:394
void unreachable()
Invokes undefined behavior.
Definition C++23Backports.hpp:40
std::basic_string< CharT, CharTraitsT > StringT
Definition Fwd.hpp:397