mimic++ v9.2.1
Loading...
Searching...
No Matches
IReporter.hpp
Go to the documentation of this file.
1// Copyright Dominic (DNKpp) Koepke 2024 - 2025.
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"
14
15#ifndef MIMICPP_DETAIL_IS_MODULE
16 #include <exception>
17 #include <vector>
18#endif
19
21{
45
51 {
52 public:
56 virtual ~IReporter() = default;
57
70 [[noreturn]]
71 virtual void report_no_matches(
73 std::vector<NoMatchReport> noMatchReports) = 0;
74
87 [[noreturn]]
90 std::vector<ExpectationReport> expectationReports) = 0;
91
100 virtual void report_full_match(
102 ExpectationReport expectationReport) noexcept = 0;
103
117 ExpectationReport expectationReport) = 0;
118
129 virtual void report_error(StringT message) = 0;
130
142 ExpectationReport expectationReport,
143 std::exception_ptr exception) = 0;
144
145 protected:
146 [[nodiscard]]
147 IReporter() = default;
148
149 IReporter(const IReporter&) = default;
150 IReporter& operator=(const IReporter&) = default;
151 IReporter(IReporter&&) = default;
153 };
154
158
171}
172
173#endif
#define MIMICPP_DETAIL_MODULE_EXPORT
Definition Config.hpp:19
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
virtual void report_full_match(CallReport call, ExpectationReport expectationReport) noexcept=0
Handles the report for a fully matching expectation.
virtual void report_error(StringT message)=0
Handles general or unspecified errors.
virtual void report_no_matches(CallReport call, std::vector< NoMatchReport > noMatchReports)=0
Expects reports on all non-matching expectations. This is only called when no better options are avai...
virtual void report_unfulfilled_expectation(ExpectationReport expectationReport)=0
Handles the report of an unfulfilled expectation.
virtual void report_unhandled_exception(CallReport call, ExpectationReport expectationReport, std::exception_ptr exception)=0
Handles reports about unhandled exceptions during handle_call.
virtual void report_inapplicable_matches(CallReport call, std::vector< ExpectationReport > expectationReports)=0
Handles reports for all inapplicable but otherwise matching expectations. This function is called onl...
IReporter(const IReporter &)=default
virtual ~IReporter()=default
Defaulted virtual destructor.
IReporter(IReporter &&)=default
IReporter & operator=(IReporter &&)=default
IReporter & operator=(const IReporter &)=default
Definition Call.hpp:24
Definition BasicReporter.hpp:27
std::basic_string< CharT, CharTraitsT > StringT
Definition Fwd.hpp:391