mimic++ v4
|
Contains reporting related symbols. More...
Topics | |
reports | |
Contains reports of mimic++ types. | |
test framework adapters | |
Reporter integrations for various third-party frameworks. | |
Classes | |
class | mimicpp::IReporter |
The reporter interface. More... | |
class | mimicpp::Error< Data > |
class | mimicpp::BasicReporter< successReporter, warningReporter, failReporter > |
A reporter, which creates text messages and reports them via the provided callbacks. More... | |
class | mimicpp::DefaultReporter |
The default reporter. More... | |
Typedefs | |
using | mimicpp::UnmatchedCallT = Error<std::tuple<CallReport, std::vector<MatchReport>>> |
using | mimicpp::UnfulfilledExpectationT = Error<ExpectationReport> |
Functions | |
template<std::derived_from< IReporter > T, typename... Args> requires std::constructible_from<T, Args...> | |
void | mimicpp::install_reporter (Args &&... args) |
Replaces the previous reporter with a newly constructed one. | |
Contains reporting related symbols.
Reporting is executed, when something notably has been detected by mimic++
; often it is expected, that the reporter reacts to such a report in a specific manner (e.g. aborting the test case). For example the DefaultReporter
simply throws exceptions on error reports, while other more specialized reporters handle such cases slightly different (but still abort the current test). These specialized Reporters are used to send reports to a specific destination (e.g. the utilized unit-test framework), which often provide more advanced mechanics for printing failed tests to the users.
Users may provide their own reporter implementation; e.g. if there is no reporter for the desired unit-test framework.
At any time there exists exactly one global reporter, which may be directly or indirectly exchanged by users. Reports are sent to the currently installed reporter via the report_xyz
free-functions. Most of those functions require, that reports are handled in a specific manner (e.g. report_no_matches
is expected to never return) and custom reporters must follow that specification, otherwise this will lead to undefined behavior. For further details, have a look at the specific function documentation.
using mimicpp::UnmatchedCallT = Error<std::tuple<CallReport, std::vector<MatchReport>>> |
void mimicpp::install_reporter | ( | Args &&... | args | ) |
Replaces the previous reporter with a newly constructed one.
T | The desired reporter type. |
Args | The constructor argument types for T . |
args | The constructor arguments. |
This function accesses the globally available reporter and replaces it with a new instance.