Class FailureReporter¶
Defined in File Failure.hpp
Class Documentation¶
-
class FailureReporter¶
[source] Sink for mock failures; reports them through the test framework.
The default implementation forwards failures to the current test::Shell. Replace the reporter on a Support object via Support::set_mock_failure_standard_reporter() to intercept or silence mock failures in tests that verify the mock layer itself.
Public Functions
-
virtual void fail_test(Failure failure)¶
Report
failureand exit the current test.- Parameters:
failure – The failure to report.
-
virtual void report_failure(const Failure &failure)¶
Report
failurewithout exiting the test.- Parameters:
failure – The failure to report.
-
virtual test::Shell *get_test_to_fail()¶
[source] - Returns:
The Shell that will receive failures, or nullptr if none.
-
inline virtual void crash_on_failure(bool should_crash)¶
Control whether failures trigger a hard crash.
- Parameters:
should_crash – If true, crash the process on the next failure.
Protected Attributes
-
bool crash_on_failure_ = {false}¶
-
virtual void fail_test(Failure failure)¶