6#ifndef MIMICPP_REPORTING_BASIC_REPORTER_HPP
7#define MIMICPP_REPORTING_BASIC_REPORTER_HPP
20#ifndef MIMICPP_DETAIL_IS_MODULE
35 std::invocable<StringT const&>
auto successReporter,
36 std::invocable<StringT const&>
auto warningReporter,
37 std::invocable<StringT const&>
auto failReporter>
61 if (0 == std::uncaught_exceptions())
69 if (0 == std::uncaught_exceptions())
78 std::exception_ptr
const exception)
override
84 void send_success(
StringT const& msg)
86 std::invoke(successReporter, msg);
89 void send_warning(
StringT const& msg)
91 std::invoke(warningReporter, msg);
95 void send_fail(
StringT const& msg)
98 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:40
void report_no_matches(CallReport call, std::vector< NoMatchReport > noMatchReports) override
Expects reports on all non-matching expectations. This is only called when no better options are avai...
Definition BasicReporter.hpp:43
void report_unfulfilled_expectation(const ExpectationReport expectationReport) override
Handles the report of an unfulfilled expectation.
Definition BasicReporter.hpp:59
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:75
void report_error(StringT const message) override
Handles general or unspecified errors.
Definition BasicReporter.hpp:67
void report_full_match(CallReport call, ExpectationReport expectationReport) noexcept override
Handles the report for a fully matching expectation.
Definition BasicReporter.hpp:54
void report_inapplicable_matches(CallReport call, std::vector< ExpectationReport > expectationReports) override
Handles reports for all inapplicable but otherwise matching expectations. This function is called onl...
Definition BasicReporter.hpp:49
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
Definition BasicReporter.hpp:27
StringT stringify_unhandled_exception(CallReport const &call, ExpectationReport const &expectationReport, std::exception_ptr const &exception)
Definition StringifyReports.hpp:466
StringT stringify_unfulfilled_expectation(ExpectationReport const &expectationReport)
Definition StringifyReports.hpp:450
StringT stringify_inapplicable_matches(CallReport const &call, std::span< ExpectationReport > expectations)
Definition StringifyReports.hpp:349
StringT stringify_no_matches(CallReport const &call, std::span< NoMatchReport > noMatchReports)
Definition StringifyReports.hpp:388
StringT stringify_full_match(CallReport const &call, ExpectationReport expectation)
Definition StringifyReports.hpp:315
void unreachable()
Invokes undefined behavior.
Definition C++23Backports.hpp:40
std::basic_string< CharT, CharTraitsT > StringT
Definition Fwd.hpp:391