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:
Martin Hořeňovský 2020-07-04 17:45:30 +02:00
parent 250d9b9c72
commit 4565b826cf
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
14 changed files with 1420 additions and 18 deletions

View File

@ -52,7 +52,7 @@ namespace Catch {
currentTracker.addChild( tracker ); currentTracker.addChild( tracker );
} }
if( !ctx.completedCycle() && !tracker->isComplete() ) { if( !tracker->isComplete() ) {
tracker->open(); tracker->open();
} }
@ -66,8 +66,28 @@ namespace Catch {
} }
void close() override { void close() override {
TrackerBase::close(); TrackerBase::close();
// Generator interface only finds out if it has another item on atual move // If a generator has a child (it is followed by a section)
if (m_runState == CompletedSuccessfully && m_generator->next()) { // and none of its children have started, then we must wait
// until later to start consuming its values.
// This catches cases where `GENERATE` is placed between two
// `SECTION`s.
// **The check for m_children.empty cannot be removed**.
// doing so would break `GENERATE` _not_ followed by `SECTION`s.
const bool should_wait_for_child =
!m_children.empty() &&
std::find_if( m_children.begin(),
m_children.end(),
[]( TestCaseTracking::ITrackerPtr tracker ) {
return tracker->hasStarted();
} ) == m_children.end();
// This check is a bit tricky, because m_generator->next()
// has a side-effect, where it consumes generator's current
// value, but we do not want to invoke the side-effect if
// this generator is still waiting for any child to start.
if ( should_wait_for_child ||
( m_runState == CompletedSuccessfully &&
m_generator->next() ) ) {
m_children.clear(); m_children.clear();
m_runState = Executing; m_runState = Executing;
} }
@ -200,7 +220,6 @@ namespace Catch {
using namespace Generators; using namespace Generators;
GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext, GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext,
TestCaseTracking::NameAndLocation( static_cast<std::string>(generatorName), lineInfo ) ); TestCaseTracking::NameAndLocation( static_cast<std::string>(generatorName), lineInfo ) );
assert( tracker.isOpen() );
m_lastAssertionInfo.lineInfo = lineInfo; m_lastAssertionInfo.lineInfo = lineInfo;
return tracker; return tracker;
} }

View File

@ -186,7 +186,8 @@ namespace TestCaseTracking {
bool SectionTracker::isComplete() const { bool SectionTracker::isComplete() const {
bool complete = true; bool complete = true;
if ((m_filters.empty() || m_filters[0] == "") if (m_filters.empty()
|| m_filters[0] == ""
|| std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) { || std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) {
complete = TrackerBase::isComplete(); complete = TrackerBase::isComplete();
} }

View File

@ -55,6 +55,7 @@ namespace TestCaseTracking {
virtual bool isSuccessfullyCompleted() const = 0; virtual bool isSuccessfullyCompleted() const = 0;
virtual bool isOpen() const = 0; // Started but not complete virtual bool isOpen() const = 0; // Started but not complete
virtual bool hasChildren() const = 0; virtual bool hasChildren() const = 0;
virtual bool hasStarted() const = 0;
virtual ITracker& parent() = 0; virtual ITracker& parent() = 0;
@ -121,7 +122,9 @@ namespace TestCaseTracking {
bool isSuccessfullyCompleted() const override; bool isSuccessfullyCompleted() const override;
bool isOpen() const override; bool isOpen() const override;
bool hasChildren() const override; bool hasChildren() const override;
bool hasStarted() const override {
return m_runState != NotStarted;
}
void addChild( ITrackerPtr const& child ) override; void addChild( ITrackerPtr const& child ) override;

View File

@ -16,6 +16,11 @@ Nor would this
:test-result: PASS #1912 -- test spec parser handles escaping :test-result: PASS #1912 -- test spec parser handles escaping
:test-result: PASS #1913 - GENERATE inside a for loop should not keep recreating the generator :test-result: PASS #1913 - GENERATE inside a for loop should not keep recreating the generator
:test-result: PASS #1913 - GENERATEs can share a line :test-result: PASS #1913 - GENERATEs can share a line
:test-result: PASS #1938 - GENERATE after a section
:test-result: PASS #1938 - Section followed by flat generate
:test-result: PASS #1938 - flat generate
:test-result: PASS #1938 - mixed sections and generates
:test-result: PASS #1938 - nested generate
:test-result: PASS #1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0 :test-result: PASS #1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0
:test-result: PASS #1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0 :test-result: PASS #1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0
:test-result: PASS #1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0 :test-result: PASS #1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0

View File

@ -35,6 +35,48 @@ Generators.tests.cpp:<line number>: passed: i != j for: 1 != 3
Generators.tests.cpp:<line number>: passed: i != j for: 1 != 4 Generators.tests.cpp:<line number>: passed: i != j for: 1 != 4
Generators.tests.cpp:<line number>: passed: i != j for: 2 != 3 Generators.tests.cpp:<line number>: passed: i != j for: 2 != 3
Generators.tests.cpp:<line number>: passed: i != j for: 2 != 4 Generators.tests.cpp:<line number>: passed: i != j for: 2 != 4
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'A'
PartTracker.tests.cpp:<line number>: passed: m for: 1
PartTracker.tests.cpp:<line number>: passed: m for: 2
PartTracker.tests.cpp:<line number>: passed: m for: 3
PartTracker.tests.cpp:<line number>: passed: 1
PartTracker.tests.cpp:<line number>: passed: m for: 2
PartTracker.tests.cpp:<line number>: passed: m for: 3
PartTracker.tests.cpp:<line number>: passed: m for: 1
PartTracker.tests.cpp:<line number>: passed: m for: 2
PartTracker.tests.cpp:<line number>: passed: m for: 3
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'A'
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 3' and 'k := 5'
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B'
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 3' and 'k := 6'
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B'
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 4' and 'k := 5'
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 4' and 'k := 6'
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'A'
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 3' and 'k := 5'
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B'
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 3' and 'k := 6'
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B'
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 4' and 'k := 5'
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 4' and 'k := 6'
PartTracker.tests.cpp:<line number>: passed: m for: 1
PartTracker.tests.cpp:<line number>: passed: n for: 1
PartTracker.tests.cpp:<line number>: passed: m for: 1
PartTracker.tests.cpp:<line number>: passed: n for: 2
PartTracker.tests.cpp:<line number>: passed: m for: 1
PartTracker.tests.cpp:<line number>: passed: n for: 3
PartTracker.tests.cpp:<line number>: passed: m for: 2
PartTracker.tests.cpp:<line number>: passed: n for: 1
PartTracker.tests.cpp:<line number>: passed: m for: 2
PartTracker.tests.cpp:<line number>: passed: n for: 2
PartTracker.tests.cpp:<line number>: passed: m for: 2
PartTracker.tests.cpp:<line number>: passed: n for: 3
PartTracker.tests.cpp:<line number>: passed: m for: 3
PartTracker.tests.cpp:<line number>: passed: n for: 1
PartTracker.tests.cpp:<line number>: passed: m for: 3
PartTracker.tests.cpp:<line number>: passed: n for: 2
PartTracker.tests.cpp:<line number>: passed: m for: 3
PartTracker.tests.cpp:<line number>: passed: n for: 3
Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed:

View File

@ -1380,6 +1380,6 @@ due to unexpected exception with message:
Why would you throw a std::string? Why would you throw a std::string?
=============================================================================== ===============================================================================
test cases: 343 | 269 passed | 70 failed | 4 failed as expected test cases: 348 | 274 passed | 70 failed | 4 failed as expected
assertions: 1941 | 1789 passed | 131 failed | 21 failed as expected assertions: 1983 | 1831 passed | 131 failed | 21 failed as expected

View File

@ -302,6 +302,424 @@ Generators.tests.cpp:<line number>: PASSED:
with expansion: with expansion:
2 != 4 2 != 4
-------------------------------------------------------------------------------
#1938 - GENERATE after a section
A
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
A
-------------------------------------------------------------------------------
#1938 - GENERATE after a section
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
1
-------------------------------------------------------------------------------
#1938 - GENERATE after a section
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - GENERATE after a section
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
-------------------------------------------------------------------------------
#1938 - Section followed by flat generate
A
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( 1 )
-------------------------------------------------------------------------------
#1938 - Section followed by flat generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - Section followed by flat generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
-------------------------------------------------------------------------------
#1938 - flat generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
1
-------------------------------------------------------------------------------
#1938 - flat generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - flat generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
A
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
A
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 1
j := 3
k := 5
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
B
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 1
j := 3
k := 6
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
B
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 1
j := 4
k := 5
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 1
j := 4
k := 6
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
A
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
A
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 2
j := 3
k := 5
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
B
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 2
j := 3
k := 6
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
B
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 2
j := 4
k := 5
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 2
j := 4
k := 6
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
1
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
1
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
1
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
1
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
3
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
1
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
3
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
1
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
3
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0 #1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -15194,6 +15612,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED: Misc.tests.cpp:<line number>: PASSED:
=============================================================================== ===============================================================================
test cases: 343 | 253 passed | 86 failed | 4 failed as expected test cases: 348 | 258 passed | 86 failed | 4 failed as expected
assertions: 1958 | 1789 passed | 148 failed | 21 failed as expected assertions: 2000 | 1831 passed | 148 failed | 21 failed as expected

View File

@ -302,6 +302,424 @@ Generators.tests.cpp:<line number>: PASSED:
with expansion: with expansion:
2 != 4 2 != 4
-------------------------------------------------------------------------------
#1938 - GENERATE after a section
A
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
A
-------------------------------------------------------------------------------
#1938 - GENERATE after a section
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
1
-------------------------------------------------------------------------------
#1938 - GENERATE after a section
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - GENERATE after a section
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
-------------------------------------------------------------------------------
#1938 - Section followed by flat generate
A
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( 1 )
-------------------------------------------------------------------------------
#1938 - Section followed by flat generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - Section followed by flat generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
-------------------------------------------------------------------------------
#1938 - flat generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
1
-------------------------------------------------------------------------------
#1938 - flat generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - flat generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
A
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
A
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 1
j := 3
k := 5
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
B
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 1
j := 3
k := 6
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
B
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 1
j := 4
k := 5
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 1
j := 4
k := 6
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
A
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
A
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 2
j := 3
k := 5
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
B
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 2
j := 3
k := 6
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
B
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with message:
B
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 2
j := 4
k := 5
-------------------------------------------------------------------------------
#1938 - mixed sections and generates
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
with messages:
i := 2
j := 4
k := 6
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
1
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
1
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
1
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
1
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
3
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
1
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
2
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
3
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
1
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
2
-------------------------------------------------------------------------------
#1938 - nested generate
-------------------------------------------------------------------------------
PartTracker.tests.cpp:<line number>
...............................................................................
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( m )
with expansion:
3
PartTracker.tests.cpp:<line number>: PASSED:
REQUIRE( n )
with expansion:
3
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0 #1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -506,6 +924,6 @@ Condition.tests.cpp:<line number>: FAILED:
CHECK( true != true ) CHECK( true != true )
=============================================================================== ===============================================================================
test cases: 26 | 21 passed | 3 failed | 2 failed as expected test cases: 31 | 26 passed | 3 failed | 2 failed as expected
assertions: 57 | 50 passed | 4 failed | 3 failed as expected assertions: 99 | 92 passed | 4 failed | 3 failed as expected

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact <testsuitesloose text artifact
> >
<testsuite name="<exe-name>" errors="17" failures="132" tests="1959" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <testsuite name="<exe-name>" errors="17" failures="132" tests="2001" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties> <properties>
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/>
<property name="random-seed" value="1"/> <property name="random-seed" value="1"/>
@ -35,6 +35,15 @@ Nor would this
<testcase classname="<exe-name>.global" name="#1912 -- test spec parser handles escaping/backslash in test name" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1912 -- test spec parser handles escaping/backslash in test name" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1913 - GENERATE inside a for loop should not keep recreating the generator" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1913 - GENERATE inside a for loop should not keep recreating the generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1913 - GENERATEs can share a line" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1913 - GENERATEs can share a line" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1938 - GENERATE after a section/A" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1938 - GENERATE after a section/B" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1938 - Section followed by flat generate" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1938 - Section followed by flat generate/A" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1938 - flat generate" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1938 - mixed sections and generates" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1938 - mixed sections and generates/A" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1938 - mixed sections and generates/B" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1938 - nested generate" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" time="{duration}" status="run"/>

View File

@ -122,6 +122,15 @@
<testCase name="weighted_average_quantile" duration="{duration}"/> <testCase name="weighted_average_quantile" duration="{duration}"/>
</file> </file>
<file path="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp"> <file path="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp">
<testCase name="#1938 - GENERATE after a section/A" duration="{duration}"/>
<testCase name="#1938 - GENERATE after a section/B" duration="{duration}"/>
<testCase name="#1938 - Section followed by flat generate" duration="{duration}"/>
<testCase name="#1938 - Section followed by flat generate/A" duration="{duration}"/>
<testCase name="#1938 - flat generate" duration="{duration}"/>
<testCase name="#1938 - mixed sections and generates" duration="{duration}"/>
<testCase name="#1938 - mixed sections and generates/A" duration="{duration}"/>
<testCase name="#1938 - mixed sections and generates/B" duration="{duration}"/>
<testCase name="#1938 - nested generate" duration="{duration}"/>
<testCase name="Tracker" duration="{duration}"/> <testCase name="Tracker" duration="{duration}"/>
<testCase name="Tracker/successfully close one section" duration="{duration}"/> <testCase name="Tracker/successfully close one section" duration="{duration}"/>
<testCase name="Tracker/fail one section" duration="{duration}"/> <testCase name="Tracker/fail one section" duration="{duration}"/>

View File

@ -68,6 +68,90 @@ ok {test-number} - i != j for: 1 != 4
ok {test-number} - i != j for: 2 != 3 ok {test-number} - i != j for: 2 != 3
# #1913 - GENERATEs can share a line # #1913 - GENERATEs can share a line
ok {test-number} - i != j for: 2 != 4 ok {test-number} - i != j for: 2 != 4
# #1938 - GENERATE after a section
ok {test-number} - with 1 message: 'A'
# #1938 - GENERATE after a section
ok {test-number} - m for: 1
# #1938 - GENERATE after a section
ok {test-number} - m for: 2
# #1938 - GENERATE after a section
ok {test-number} - m for: 3
# #1938 - Section followed by flat generate
ok {test-number} - 1
# #1938 - Section followed by flat generate
ok {test-number} - m for: 2
# #1938 - Section followed by flat generate
ok {test-number} - m for: 3
# #1938 - flat generate
ok {test-number} - m for: 1
# #1938 - flat generate
ok {test-number} - m for: 2
# #1938 - flat generate
ok {test-number} - m for: 3
# #1938 - mixed sections and generates
ok {test-number} - with 1 message: 'A'
# #1938 - mixed sections and generates
ok {test-number} - with 3 messages: 'i := 1' and 'j := 3' and 'k := 5'
# #1938 - mixed sections and generates
ok {test-number} - with 1 message: 'B'
# #1938 - mixed sections and generates
ok {test-number} - with 3 messages: 'i := 1' and 'j := 3' and 'k := 6'
# #1938 - mixed sections and generates
ok {test-number} - with 1 message: 'B'
# #1938 - mixed sections and generates
ok {test-number} - with 3 messages: 'i := 1' and 'j := 4' and 'k := 5'
# #1938 - mixed sections and generates
ok {test-number} - with 3 messages: 'i := 1' and 'j := 4' and 'k := 6'
# #1938 - mixed sections and generates
ok {test-number} - with 1 message: 'A'
# #1938 - mixed sections and generates
ok {test-number} - with 3 messages: 'i := 2' and 'j := 3' and 'k := 5'
# #1938 - mixed sections and generates
ok {test-number} - with 1 message: 'B'
# #1938 - mixed sections and generates
ok {test-number} - with 3 messages: 'i := 2' and 'j := 3' and 'k := 6'
# #1938 - mixed sections and generates
ok {test-number} - with 1 message: 'B'
# #1938 - mixed sections and generates
ok {test-number} - with 3 messages: 'i := 2' and 'j := 4' and 'k := 5'
# #1938 - mixed sections and generates
ok {test-number} - with 3 messages: 'i := 2' and 'j := 4' and 'k := 6'
# #1938 - nested generate
ok {test-number} - m for: 1
# #1938 - nested generate
ok {test-number} - n for: 1
# #1938 - nested generate
ok {test-number} - m for: 1
# #1938 - nested generate
ok {test-number} - n for: 2
# #1938 - nested generate
ok {test-number} - m for: 1
# #1938 - nested generate
ok {test-number} - n for: 3
# #1938 - nested generate
ok {test-number} - m for: 2
# #1938 - nested generate
ok {test-number} - n for: 1
# #1938 - nested generate
ok {test-number} - m for: 2
# #1938 - nested generate
ok {test-number} - n for: 2
# #1938 - nested generate
ok {test-number} - m for: 2
# #1938 - nested generate
ok {test-number} - n for: 3
# #1938 - nested generate
ok {test-number} - m for: 3
# #1938 - nested generate
ok {test-number} - n for: 1
# #1938 - nested generate
ok {test-number} - m for: 3
# #1938 - nested generate
ok {test-number} - n for: 2
# #1938 - nested generate
ok {test-number} - m for: 3
# #1938 - nested generate
ok {test-number} - n for: 3
# #1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0 # #1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0
ok {test-number} - ok {test-number} -
# #1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0 # #1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0
@ -3908,5 +3992,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} - ok {test-number} -
# xmlentitycheck # xmlentitycheck
ok {test-number} - ok {test-number} -
1..1950 1..1992

View File

@ -34,6 +34,16 @@ Tricky.tests.cpp:<line number>|nexplicit failure with message:|n "1514"']
##teamcity[testFinished name='#1913 - GENERATE inside a for loop should not keep recreating the generator' duration="{duration}"] ##teamcity[testFinished name='#1913 - GENERATE inside a for loop should not keep recreating the generator' duration="{duration}"]
##teamcity[testStarted name='#1913 - GENERATEs can share a line'] ##teamcity[testStarted name='#1913 - GENERATEs can share a line']
##teamcity[testFinished name='#1913 - GENERATEs can share a line' duration="{duration}"] ##teamcity[testFinished name='#1913 - GENERATEs can share a line' duration="{duration}"]
##teamcity[testStarted name='#1938 - GENERATE after a section']
##teamcity[testFinished name='#1938 - GENERATE after a section' duration="{duration}"]
##teamcity[testStarted name='#1938 - Section followed by flat generate']
##teamcity[testFinished name='#1938 - Section followed by flat generate' duration="{duration}"]
##teamcity[testStarted name='#1938 - flat generate']
##teamcity[testFinished name='#1938 - flat generate' duration="{duration}"]
##teamcity[testStarted name='#1938 - mixed sections and generates']
##teamcity[testFinished name='#1938 - mixed sections and generates' duration="{duration}"]
##teamcity[testStarted name='#1938 - nested generate']
##teamcity[testFinished name='#1938 - nested generate' duration="{duration}"]
##teamcity[testStarted name='#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0'] ##teamcity[testStarted name='#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0']
##teamcity[testFinished name='#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0' duration="{duration}"] ##teamcity[testFinished name='#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0' duration="{duration}"]
##teamcity[testStarted name='#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0'] ##teamcity[testStarted name='#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0']

View File

@ -305,6 +305,342 @@ Nor would this
</Expression> </Expression>
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </TestCase>
<TestCase name="#1938 - GENERATE after a section" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
1
</Expanded>
</Expression>
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
2
</Expanded>
</Expression>
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
3
</Expanded>
</Expression>
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="#1938 - Section followed by flat generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
1
</Original>
<Expanded>
1
</Expanded>
</Expression>
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
2
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
3
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="#1938 - flat generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
1
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
2
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
3
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="#1938 - mixed sections and generates" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<Info>
i := 1
</Info>
<Info>
j := 3
</Info>
<Info>
k := 5
</Info>
<Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<Info>
i := 1
</Info>
<Info>
j := 3
</Info>
<Info>
k := 6
</Info>
<Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<Info>
i := 1
</Info>
<Info>
j := 4
</Info>
<Info>
k := 5
</Info>
<Info>
i := 1
</Info>
<Info>
j := 4
</Info>
<Info>
k := 6
</Info>
<Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<Info>
i := 2
</Info>
<Info>
j := 3
</Info>
<Info>
k := 5
</Info>
<Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<Info>
i := 2
</Info>
<Info>
j := 3
</Info>
<Info>
k := 6
</Info>
<Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<OverallResults successes="1" failures="0" expectedFailures="0"/>
</Section>
<Info>
i := 2
</Info>
<Info>
j := 4
</Info>
<Info>
k := 5
</Info>
<Info>
i := 2
</Info>
<Info>
j := 4
</Info>
<Info>
k := 6
</Info>
<OverallResult success="true"/>
</TestCase>
<TestCase name="#1938 - nested generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
1
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
n
</Original>
<Expanded>
1
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
1
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
n
</Original>
<Expanded>
2
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
1
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
n
</Original>
<Expanded>
3
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
2
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
n
</Original>
<Expanded>
1
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
2
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
n
</Original>
<Expanded>
2
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
2
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
n
</Original>
<Expanded>
3
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
3
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
n
</Original>
<Expanded>
1
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
3
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
n
</Original>
<Expanded>
2
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
m
</Original>
<Expanded>
3
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
<Original>
n
</Original>
<Expanded>
3
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <TestCase name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </TestCase>
@ -18175,9 +18511,9 @@ loose text artifact
</Section> </Section>
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </TestCase>
<OverallResults successes="1789" failures="149" expectedFailures="21"/> <OverallResults successes="1831" failures="149" expectedFailures="21"/>
<OverallResultsCases successes="253" failures="86" expectedFailures="4"/> <OverallResultsCases successes="258" failures="86" expectedFailures="4"/>
</Group> </Group>
<OverallResults successes="1789" failures="148" expectedFailures="21"/> <OverallResults successes="1831" failures="148" expectedFailures="21"/>
<OverallResultsCases successes="253" failures="86" expectedFailures="4"/> <OverallResultsCases successes="258" failures="86" expectedFailures="4"/>
</Catch> </Catch>

View File

@ -4,6 +4,7 @@
*/ */
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <catch2/internal/catch_test_case_tracker.hpp> #include <catch2/internal/catch_test_case_tracker.hpp>
@ -201,3 +202,50 @@ TEST_CASE("#1670 regression check", "[.approvals][tracker]") {
SECTION("2") SUCCEED(); SECTION("2") SUCCEED();
} }
} }
// #1938 required a rework on how generator tracking works, so that `GENERATE`
// supports being sandwiched between two `SECTION`s. The following tests check
// various other scenarios through checking output in approval tests.
TEST_CASE("#1938 - GENERATE after a section", "[.][regression][generators]") {
SECTION("A") {
SUCCEED("A");
}
auto m = GENERATE(1, 2, 3);
SECTION("B") {
REQUIRE(m);
}
}
TEST_CASE("#1938 - flat generate", "[.][regression][generators]") {
auto m = GENERATE(1, 2, 3);
REQUIRE(m);
}
TEST_CASE("#1938 - nested generate", "[.][regression][generators]") {
auto m = GENERATE(1, 2, 3);
auto n = GENERATE(1, 2, 3);
REQUIRE(m);
REQUIRE(n);
}
TEST_CASE("#1938 - mixed sections and generates", "[.][regression][generators]") {
auto i = GENERATE(1, 2);
SECTION("A") {
SUCCEED("A");
}
auto j = GENERATE(3, 4);
SECTION("B") {
SUCCEED("B");
}
auto k = GENERATE(5, 6);
CAPTURE(i, j, k);
SUCCEED();
}
TEST_CASE("#1938 - Section followed by flat generate", "[.][regression][generators]") {
SECTION("A") {
REQUIRE(1);
}
auto m = GENERATE(2, 3);
REQUIRE(m);
}