Modify generator tracking to allow GENERATEs between SECTIONs
This means that code such as ```cpp TEST_CASE() { SECTION("first") { SUCCEED(); } auto _ = GENERATE(1, 2); SECTION("second") { SUCCEED(); } } ``` will run and report 3 assertions, 1 from section "first" and 2 from section "second". This also applies for greater and potentially more confusing nesting, but fundamentally it is up to the user to avoid overly complex and confusing nestings, just as with `SECTION`s. The old behaviour of `GENERATE` as first thing in a `TEST_CASE`, `GENERATE` not followed by a `SECTION`, etc etc should be unchanged. Closes #1938
This commit is contained in:
parent
250d9b9c72
commit
4565b826cf
14 changed files with 1420 additions and 18 deletions
|
@ -55,6 +55,7 @@ namespace TestCaseTracking {
|
|||
virtual bool isSuccessfullyCompleted() const = 0;
|
||||
virtual bool isOpen() const = 0; // Started but not complete
|
||||
virtual bool hasChildren() const = 0;
|
||||
virtual bool hasStarted() const = 0;
|
||||
|
||||
virtual ITracker& parent() = 0;
|
||||
|
||||
|
@ -121,7 +122,9 @@ namespace TestCaseTracking {
|
|||
bool isSuccessfullyCompleted() const override;
|
||||
bool isOpen() const override;
|
||||
bool hasChildren() const override;
|
||||
|
||||
bool hasStarted() const override {
|
||||
return m_runState != NotStarted;
|
||||
}
|
||||
|
||||
void addChild( ITrackerPtr const& child ) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue