Class EventListenerBase

Inheritance Relationships

Base Type

Class Documentation

class EventListenerBase : public Catch::IEventListener

Base class to simplify implementing listeners.

Provides empty default implementation for all IEventListener member functions, so that a listener implementation can pick which member functions it actually cares about.

Public Functions

virtual void reportInvalidTestSpec(StringRef unmatchedSpec) override

Called for all invalid test specs from the cli.

virtual void fatalErrorEncountered(StringRef error) override

Called if a fatal error (signal/structured exception) occurred.

virtual void benchmarkPreparing(StringRef name) override

Called when user-code is being probed before the actual benchmark runs.

virtual void benchmarkStarting(BenchmarkInfo const &benchmarkInfo) override

Called after probe but before the user-code is being benchmarked.

virtual void benchmarkEnded(BenchmarkStats<> const &benchmarkStats) override

Called with the benchmark results if benchmark successfully finishes.

virtual void benchmarkFailed(StringRef error) override

Called if running the benchmarks fails for any reason.

virtual void assertionStarting(AssertionInfo const &assertionInfo) override

Called before assertion success/failure is evaluated.

virtual void assertionEnded(AssertionStats const &assertionStats) override

Called after assertion was fully evaluated.

virtual void listReporters(std::vector<ReporterDescription> const &descriptions) override

Writes out information about provided reporters using reporter-specific format.

virtual void listListeners(std::vector<ListenerDescription> const &descriptions) override

Writes out the provided listeners descriptions using reporter-specific format.

virtual void listTests(std::vector<TestCaseHandle> const &tests) override

Writes out information about provided tests using reporter-specific format.

virtual void listTags(std::vector<TagInfo> const &tagInfos) override

Writes out information about the provided tags using reporter-specific format.

virtual void noMatchingTestCases(StringRef unmatchedSpec) override

Called when no test cases match provided test spec.

virtual void testRunStarting(TestRunInfo const &testRunInfo) override

Called once in a testing run before tests are started

Not called if tests won’t be run (e.g. only listing will happen)

virtual void testCaseStarting(TestCaseInfo const &testInfo) override

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testCasePartialStarting(TestCaseInfo const &testInfo, uint64_t partNumber) override

Called every time a TEST_CASE is entered, including repeats (due to sections)

virtual void sectionStarting(SectionInfo const &sectionInfo) override

Called when a SECTION is being entered. Not called for skipped sections.

virtual void sectionEnded(SectionStats const &sectionStats) override

Called after a SECTION has finished running.

virtual void testCasePartialEnded(TestCaseStats const &testCaseStats, uint64_t partNumber) override

Called every time a TEST_CASE is entered, including repeats (due to sections)

virtual void testCaseEnded(TestCaseStats const &testCaseStats) override

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testRunEnded(TestRunStats const &testRunStats) override

Called once after all tests in a testing run are finished

Not called if tests weren’t run (e.g. only listings happened)

virtual void skipTest(TestCaseInfo const &testInfo) override

Called with test cases that are skipped due to the test run aborting. NOT called for test cases that are explicitly skipped using the SKIP macro.

Deprecated - will be removed in the next major release.

inline IEventListener(IConfig const *config)