Add GENERATE_COPY and GENERATE_VAR capturing generator macros

This commit is contained in:
Martin Hořeňovský 2019-03-31 14:11:10 +02:00
parent b77cec05c0
commit 3816e99d0c
No known key found for this signature in database
GPG key ID: DE48307B8B0D381A
13 changed files with 450 additions and 55 deletions

View file

@ -637,6 +637,22 @@ Matchers.tests.cpp:<line number>: passed: testStringForMatching(), !Contains("di
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), !Contains("substring") for: "this string contains 'abc' as a substring" not contains: "substring"
Exception.tests.cpp:<line number>: passed: thisThrows(), "expected exception" for: "expected exception" equals: "expected exception"
Exception.tests.cpp:<line number>: failed: thisThrows(), "should fail" for: "expected exception" equals: "should fail"
Generators.tests.cpp:<line number>: passed: values > -6 for: 3 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 4 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 5 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 6 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: -5 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: -4 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 90 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 91 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 92 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 93 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 94 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 95 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 96 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 97 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 98 > -6
Generators.tests.cpp:<line number>: passed: values > -6 for: 99 > -6
Misc.tests.cpp:<line number>: warning: 'This one ran'
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'custom exception'
Tricky.tests.cpp:<line number>: passed: True for: {?}

View file

@ -1264,6 +1264,6 @@ due to unexpected exception with message:
Why would you throw a std::string?
===============================================================================
test cases: 256 | 190 passed | 62 failed | 4 failed as expected
assertions: 1403 | 1260 passed | 122 failed | 21 failed as expected
test cases: 257 | 191 passed | 62 failed | 4 failed as expected
assertions: 1419 | 1276 passed | 122 failed | 21 failed as expected

View file

@ -4697,6 +4697,182 @@ Exception.tests.cpp:<line number>: FAILED:
with expansion:
"expected exception" equals: "should fail"
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
3 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
4 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
5 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
6 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
-5 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
-4 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
90 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
91 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
92 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
93 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
94 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
95 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
96 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
97 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
98 > -6
-------------------------------------------------------------------------------
Nested generators and captured variables
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( values > -6 )
with expansion:
99 > -6
-------------------------------------------------------------------------------
Nice descriptive name
-------------------------------------------------------------------------------
@ -10936,6 +11112,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 256 | 175 passed | 77 failed | 4 failed as expected
assertions: 1419 | 1260 passed | 138 failed | 21 failed as expected
test cases: 257 | 176 passed | 77 failed | 4 failed as expected
assertions: 1435 | 1276 passed | 138 failed | 21 failed as expected

View file

@ -4,7 +4,7 @@
<property name="random-seed" value="1"/>
</properties>
loose text artifact
<testsuite name="<exe-name>" errors="17" failures="122" tests="1420" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="122" tests="1436" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/>
<testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}"/>
<testcase classname="<exe-name>.global" name="#1027" time="{duration}"/>
@ -454,6 +454,7 @@ Matchers.tests.cpp:<line number>
Exception.tests.cpp:<line number>
</failure>
</testcase>
<testcase classname="<exe-name>.global" name="Nested generators and captured variables" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Nice descriptive name" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Non-std exceptions can be translated" time="{duration}">
<error type="TEST_CASE">

View file

@ -5913,6 +5913,137 @@ Nor would this
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="Nested generators and captured variables" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
3 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
4 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
5 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
6 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
-5 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
-4 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
90 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
91 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
92 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
93 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
94 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
95 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
96 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
97 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
98 > -6
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
values > -6
</Original>
<Expanded>
99 > -6
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="Nice descriptive name" tags="[.][tag1][tag2][tag3]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
<Warning>
This one ran
@ -13257,7 +13388,7 @@ loose text artifact
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="1260" failures="139" expectedFailures="21"/>
<OverallResults successes="1276" failures="139" expectedFailures="21"/>
</Group>
<OverallResults successes="1260" failures="138" expectedFailures="21"/>
<OverallResults successes="1276" failures="138" expectedFailures="21"/>
</Catch>