Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/interfaces
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-09-12 00:00:47 +0200
committerMartin Hořeňovský2021-09-14 13:19:45 +0200
commit10fb93cce8cb878fdfe8faa118b531258db96a26 (patch)
tree41eadf4802932051def7770b52a4a7fe94260c80 /src/catch2/interfaces
parent4dcf8382c70c25a3ccfbe5d9e37276adf7c6058f (diff)
downloadcatch3-10fb93cce8cb878fdfe8faa118b531258db96a26.tar.gz
Add new reporter event called for each test case enter/exit
This means that e.g. for `TEST_CASE` with two sibling `SECTION`s the event will fire twice, because the `TEST_CASE` will be entered twice. Closes #2107 (the event mentioned there already exists, but this is its counterpart that we also want to provide to users)
Diffstat (limited to 'src/catch2/interfaces')
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp
index 09480f04..0056c8ad 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter.hpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp
@@ -177,7 +177,10 @@ namespace Catch {
virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0;
+ //! Called _once_ for each TEST_CASE, no matter how many times it is entered
virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0;
+ //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections)
+ virtual void testCasePartialStarting( TestCaseInfo const& testInfo, uint64_t partNumber ) = 0;
virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0;
virtual void benchmarkPreparing( StringRef ) {}
@@ -191,6 +194,9 @@ namespace Catch {
virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0;
virtual void sectionEnded( SectionStats const& sectionStats ) = 0;
+ //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections)
+ virtual void testCasePartialEnded(TestCaseStats const& testCaseStats, uint64_t partNumber ) = 0;
+ //! Called _once_ for each TEST_CASE, no matter how many times it is entered
virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0;
virtual void testRunEnded( TestRunStats const& testRunStats ) = 0;