mimic++ v10.0.1
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"
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(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
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;
146 };
147
151
164}
165
166#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_error(StringT message)=0
Handles general or unspecified errors.
virtual void report_full_match(CallReport call, MatchReport match) noexcept=0
Handles the report for a fully matching expectation.
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...
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.
IReporter(const IReporter &)=default
virtual ~IReporter()=default
Defaulted virtual destructor.
IReporter(IReporter &&)=default
IReporter & operator=(IReporter &&)=default
IReporter & operator=(const IReporter &)=default
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...
Contains the expectation-report and the match-results to a specific call.
Definition MatchReport.hpp:22
Definition Call.hpp:24
Definition BasicReporter.hpp:26
std::basic_string< CharT, CharTraitsT > StringT
Definition Fwd.hpp:397