mimic++
v10.0.1
Toggle main menu visibility
Loading...
Searching...
No Matches
IReporter.hpp
Go to the documentation of this file.
1
// Copyright Dominic (DNKpp) Koepke 2024 - 2026.
2
// Distributed under the Boost Software License, Version 1.0.
3
// (See accompanying file LICENSE_1_0.txt or copy at
4
// https://www.boost.org/LICENSE_1_0.txt)
5
6
#ifndef MIMICPP_REPORTING_IREPORTER_HPP
7
#define MIMICPP_REPORTING_IREPORTER_HPP
8
9
#pragma once
10
11
#include "
mimic++/Fwd.hpp
"
12
#include "
mimic++/config/Config.hpp
"
13
#include "
mimic++/reporting/Fwd.hpp
"
14
15
#ifndef MIMICPP_DETAIL_IS_MODULE
16
#include <exception>
17
#include <vector>
18
#endif
19
20
MIMICPP_DETAIL_MODULE_EXPORT
namespace
mimicpp::reporting
21
{
45
50
class
IReporter
51
{
52
public
:
56
virtual
~IReporter
() =
default
;
57
70
[[noreturn]]
71
virtual
void
report_no_matches
(
CallReport
call
, std::vector<MatchReport> noMatchReports) = 0;
72
85
[[noreturn]]
86
virtual
void
report_inapplicable_matches
(
CallReport
call
, std::vector<MatchReport> reports) = 0;
87
96
virtual
void
report_full_match
(
CallReport
call
,
MatchReport
match)
noexcept
= 0;
97
110
virtual
void
report_unfulfilled_expectation
(
ExpectationReport
expectationReport) = 0;
111
122
virtual
void
report_error
(
StringT
message) = 0;
123
133
virtual
void
report_unhandled_exception
(
134
CallReport
call
,
135
ExpectationReport
expectationReport,
136
std::exception_ptr exception) = 0;
137
138
protected
:
139
[[nodiscard]]
140
IReporter
() =
default
;
141
142
IReporter
(
const
IReporter
&) =
default
;
143
IReporter
&
operator=
(
const
IReporter
&) =
default
;
144
IReporter
(
IReporter
&&) =
default
;
145
IReporter
&
operator=
(
IReporter
&&) =
default
;
146
};
147
151
164
}
165
166
#endif
Config.hpp
MIMICPP_DETAIL_MODULE_EXPORT
#define MIMICPP_DETAIL_MODULE_EXPORT
Definition
Config.hpp:19
Fwd.hpp
mimicpp::reporting::CallReport
Contains the extracted info from a typed call::Info.
Definition
CallReport.hpp:43
mimicpp::reporting::ExpectationReport
Contains the extracted info from a typed expectation.
Definition
ExpectationReport.hpp:85
mimicpp::reporting::IReporter::report_error
virtual void report_error(StringT message)=0
Handles general or unspecified errors.
mimicpp::reporting::IReporter::report_full_match
virtual void report_full_match(CallReport call, MatchReport match) noexcept=0
Handles the report for a fully matching expectation.
mimicpp::reporting::IReporter::report_inapplicable_matches
virtual void report_inapplicable_matches(CallReport call, std::vector< MatchReport > reports)=0
Handles reports for all inapplicable but otherwise matching expectations. This function is called onl...
mimicpp::reporting::IReporter::report_unfulfilled_expectation
virtual void report_unfulfilled_expectation(ExpectationReport expectationReport)=0
Handles the report of an unfulfilled expectation.
mimicpp::reporting::IReporter::report_unhandled_exception
virtual void report_unhandled_exception(CallReport call, ExpectationReport expectationReport, std::exception_ptr exception)=0
Handles reports about unhandled exceptions during handle_call.
mimicpp::reporting::IReporter::IReporter
IReporter()=default
mimicpp::reporting::IReporter::IReporter
IReporter(const IReporter &)=default
mimicpp::reporting::IReporter::~IReporter
virtual ~IReporter()=default
Defaulted virtual destructor.
mimicpp::reporting::IReporter::IReporter
IReporter(IReporter &&)=default
mimicpp::reporting::IReporter::operator=
IReporter & operator=(IReporter &&)=default
mimicpp::reporting::IReporter::operator=
IReporter & operator=(const IReporter &)=default
mimicpp::reporting::IReporter::report_no_matches
virtual void report_no_matches(CallReport call, std::vector< MatchReport > noMatchReports)=0
Expects reports on all non-matching expectations. This is only called when no better options are avai...
mimicpp::reporting::MatchReport
Contains the expectation-report and the match-results to a specific call.
Definition
MatchReport.hpp:22
mimicpp::call
Definition
Call.hpp:24
mimicpp::reporting
Definition
BasicReporter.hpp:26
mimicpp::StringT
std::basic_string< CharT, CharTraitsT > StringT
Definition
Fwd.hpp:397
Fwd.hpp
mimic++
reporting
IReporter.hpp
Generated on
for mimic++ by
1.18.0