Skip to content

Commit

Permalink
Add test showing literals and complex generators in one GENERATE
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Dec 10, 2023
1 parent d1d7414 commit c09e5fb
Show file tree
Hide file tree
Showing 18 changed files with 223 additions and 21 deletions.
1 change: 1 addition & 0 deletions tests/SelfTest/Baselines/automake.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Nor would this
:test-result: PASS Filter generator throws exception for empty generator
:test-result: PASS Floating point matchers: double
:test-result: PASS Floating point matchers: float
:test-result: PASS GENERATE can combine literals and generators
:test-result: PASS Generators -- adapters
:test-result: PASS Generators -- simple
:test-result: PASS Generators internals
Expand Down
1 change: 1 addition & 0 deletions tests/SelfTest/Baselines/automake.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
:test-result: PASS Filter generator throws exception for empty generator
:test-result: PASS Floating point matchers: double
:test-result: PASS Floating point matchers: float
:test-result: PASS GENERATE can combine literals and generators
:test-result: PASS Generators -- adapters
:test-result: PASS Generators -- simple
:test-result: PASS Generators internals
Expand Down
8 changes: 6 additions & 2 deletions tests/SelfTest/Baselines/compact.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ Matchers.tests.cpp:<line number>: passed: 1., !IsNaN() for: 1.0 not is NaN
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: filter([] (int) {return false; }, value(1)), Catch::GeneratorException
Generators.tests.cpp:<line number>: passed: i < 4 for: 1 < 4
Generators.tests.cpp:<line number>: passed: i < 4 for: 2 < 4
Expand Down Expand Up @@ -2683,7 +2687,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0
InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
test cases: 415 | 310 passed | 85 failed | 6 skipped | 14 failed as expected
assertions: 2254 | 2073 passed | 146 failed | 35 failed as expected
test cases: 416 | 311 passed | 85 failed | 6 skipped | 14 failed as expected
assertions: 2258 | 2077 passed | 146 failed | 35 failed as expected


8 changes: 6 additions & 2 deletions tests/SelfTest/Baselines/compact.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,10 @@ Matchers.tests.cpp:<line number>: passed: 1., !IsNaN() for: 1.0 not is NaN
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: filter([] (int) {return false; }, value(1)), Catch::GeneratorException
Generators.tests.cpp:<line number>: passed: i < 4 for: 1 < 4
Generators.tests.cpp:<line number>: passed: i < 4 for: 2 < 4
Expand Down Expand Up @@ -2672,7 +2676,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0
InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
test cases: 415 | 310 passed | 85 failed | 6 skipped | 14 failed as expected
assertions: 2254 | 2073 passed | 146 failed | 35 failed as expected
test cases: 416 | 311 passed | 85 failed | 6 skipped | 14 failed as expected
assertions: 2258 | 2077 passed | 146 failed | 35 failed as expected


4 changes: 2 additions & 2 deletions tests/SelfTest/Baselines/console.std.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,6 @@ due to unexpected exception with message:
Why would you throw a std::string?

===============================================================================
test cases: 415 | 324 passed | 70 failed | 7 skipped | 14 failed as expected
assertions: 2237 | 2073 passed | 129 failed | 35 failed as expected
test cases: 416 | 325 passed | 70 failed | 7 skipped | 14 failed as expected
assertions: 2241 | 2077 passed | 129 failed | 35 failed as expected

48 changes: 46 additions & 2 deletions tests/SelfTest/Baselines/console.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4889,6 +4889,50 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
1.0 not is NaN

-------------------------------------------------------------------------------
GENERATE can combine literals and generators
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................

Generators.tests.cpp:<line number>: PASSED:
REQUIRE( i % 2 == 0 )
with expansion:
0 == 0

-------------------------------------------------------------------------------
GENERATE can combine literals and generators
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................

Generators.tests.cpp:<line number>: PASSED:
REQUIRE( i % 2 == 0 )
with expansion:
0 == 0

-------------------------------------------------------------------------------
GENERATE can combine literals and generators
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................

Generators.tests.cpp:<line number>: PASSED:
REQUIRE( i % 2 == 0 )
with expansion:
0 == 0

-------------------------------------------------------------------------------
GENERATE can combine literals and generators
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................

Generators.tests.cpp:<line number>: PASSED:
REQUIRE( i % 2 == 0 )
with expansion:
0 == 0

-------------------------------------------------------------------------------
Generators -- adapters
Filtering by predicate
Expand Down Expand Up @@ -18691,6 +18735,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:

===============================================================================
test cases: 415 | 310 passed | 85 failed | 6 skipped | 14 failed as expected
assertions: 2254 | 2073 passed | 146 failed | 35 failed as expected
test cases: 416 | 311 passed | 85 failed | 6 skipped | 14 failed as expected
assertions: 2258 | 2077 passed | 146 failed | 35 failed as expected

48 changes: 46 additions & 2 deletions tests/SelfTest/Baselines/console.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4887,6 +4887,50 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
1.0 not is NaN

-------------------------------------------------------------------------------
GENERATE can combine literals and generators
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................

Generators.tests.cpp:<line number>: PASSED:
REQUIRE( i % 2 == 0 )
with expansion:
0 == 0

-------------------------------------------------------------------------------
GENERATE can combine literals and generators
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................

Generators.tests.cpp:<line number>: PASSED:
REQUIRE( i % 2 == 0 )
with expansion:
0 == 0

-------------------------------------------------------------------------------
GENERATE can combine literals and generators
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................

Generators.tests.cpp:<line number>: PASSED:
REQUIRE( i % 2 == 0 )
with expansion:
0 == 0

-------------------------------------------------------------------------------
GENERATE can combine literals and generators
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................

Generators.tests.cpp:<line number>: PASSED:
REQUIRE( i % 2 == 0 )
with expansion:
0 == 0

-------------------------------------------------------------------------------
Generators -- adapters
Filtering by predicate
Expand Down Expand Up @@ -18680,6 +18724,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:

===============================================================================
test cases: 415 | 310 passed | 85 failed | 6 skipped | 14 failed as expected
assertions: 2254 | 2073 passed | 146 failed | 35 failed as expected
test cases: 416 | 311 passed | 85 failed | 6 skipped | 14 failed as expected
assertions: 2258 | 2077 passed | 146 failed | 35 failed as expected

3 changes: 2 additions & 1 deletion tests/SelfTest/Baselines/junit.sw.approved.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
<testsuite name="<exe-name>" errors="17" failures="129" skipped="12" tests="2266" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="129" skipped="12" tests="2270" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
Expand Down Expand Up @@ -708,6 +708,7 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/Composed" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/IsNaN" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="GENERATE can combine literals and generators" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Basic usage" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Throws if there are no matching values" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Shortening a range" time="{duration}" status="run"/>
Expand Down
3 changes: 2 additions & 1 deletion tests/SelfTest/Baselines/junit.sw.multi.approved.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="<exe-name>" errors="17" failures="129" skipped="12" tests="2266" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="129" skipped="12" tests="2270" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
Expand Down Expand Up @@ -707,6 +707,7 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/Composed" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/IsNaN" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="GENERATE can combine literals and generators" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Basic usage" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Throws if there are no matching values" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Shortening a range" time="{duration}" status="run"/>
Expand Down
1 change: 1 addition & 0 deletions tests/SelfTest/Baselines/sonarqube.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ at Generators.tests.cpp:<line number>
<testCase name="Copy and then generate a range/from var and iterators" duration="{duration}"/>
<testCase name="Copy and then generate a range/From a temporary container" duration="{duration}"/>
<testCase name="Copy and then generate a range/Final validation" duration="{duration}"/>
<testCase name="GENERATE can combine literals and generators" duration="{duration}"/>
<testCase name="Generators -- adapters/Filtering by predicate/Basic usage" duration="{duration}"/>
<testCase name="Generators -- adapters/Filtering by predicate/Throws if there are no matching values" duration="{duration}"/>
<testCase name="Generators -- adapters/Shortening a range" duration="{duration}"/>
Expand Down
1 change: 1 addition & 0 deletions tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,7 @@ at Generators.tests.cpp:<line number>
<testCase name="Copy and then generate a range/from var and iterators" duration="{duration}"/>
<testCase name="Copy and then generate a range/From a temporary container" duration="{duration}"/>
<testCase name="Copy and then generate a range/Final validation" duration="{duration}"/>
<testCase name="GENERATE can combine literals and generators" duration="{duration}"/>
<testCase name="Generators -- adapters/Filtering by predicate/Basic usage" duration="{duration}"/>
<testCase name="Generators -- adapters/Filtering by predicate/Throws if there are no matching values" duration="{duration}"/>
<testCase name="Generators -- adapters/Shortening a range" duration="{duration}"/>
Expand Down
10 changes: 9 additions & 1 deletion tests/SelfTest/Baselines/tap.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,14 @@ ok {test-number} - WithinRel( 1.f, -0.2f ), std::domain_error
ok {test-number} - WithinRel( 1.f, 1.f ), std::domain_error
# Floating point matchers: float
ok {test-number} - 1., !IsNaN() for: 1.0 not is NaN
# GENERATE can combine literals and generators
ok {test-number} - i % 2 == 0 for: 0 == 0
# GENERATE can combine literals and generators
ok {test-number} - i % 2 == 0 for: 0 == 0
# GENERATE can combine literals and generators
ok {test-number} - i % 2 == 0 for: 0 == 0
# GENERATE can combine literals and generators
ok {test-number} - i % 2 == 0 for: 0 == 0
# Generators -- adapters
ok {test-number} - i % 2 == 0 for: 0 == 0
# Generators -- adapters
Expand Down Expand Up @@ -4537,5 +4545,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
1..2266
1..2270

10 changes: 9 additions & 1 deletion tests/SelfTest/Baselines/tap.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,14 @@ ok {test-number} - WithinRel( 1.f, -0.2f ), std::domain_error
ok {test-number} - WithinRel( 1.f, 1.f ), std::domain_error
# Floating point matchers: float
ok {test-number} - 1., !IsNaN() for: 1.0 not is NaN
# GENERATE can combine literals and generators
ok {test-number} - i % 2 == 0 for: 0 == 0
# GENERATE can combine literals and generators
ok {test-number} - i % 2 == 0 for: 0 == 0
# GENERATE can combine literals and generators
ok {test-number} - i % 2 == 0 for: 0 == 0
# GENERATE can combine literals and generators
ok {test-number} - i % 2 == 0 for: 0 == 0
# Generators -- adapters
ok {test-number} - i % 2 == 0 for: 0 == 0
# Generators -- adapters
Expand Down Expand Up @@ -4526,5 +4534,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
1..2266
1..2270

2 changes: 2 additions & 0 deletions tests/SelfTest/Baselines/teamcity.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@
##teamcity[testFinished name='Floating point matchers: double' duration="{duration}"]
##teamcity[testStarted name='Floating point matchers: float']
##teamcity[testFinished name='Floating point matchers: float' duration="{duration}"]
##teamcity[testStarted name='GENERATE can combine literals and generators']
##teamcity[testFinished name='GENERATE can combine literals and generators' duration="{duration}"]
##teamcity[testStarted name='Generators -- adapters']
##teamcity[testFinished name='Generators -- adapters' duration="{duration}"]
##teamcity[testStarted name='Generators -- simple']
Expand Down
2 changes: 2 additions & 0 deletions tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@
##teamcity[testFinished name='Floating point matchers: double' duration="{duration}"]
##teamcity[testStarted name='Floating point matchers: float']
##teamcity[testFinished name='Floating point matchers: float' duration="{duration}"]
##teamcity[testStarted name='GENERATE can combine literals and generators']
##teamcity[testFinished name='GENERATE can combine literals and generators' duration="{duration}"]
##teamcity[testStarted name='Generators -- adapters']
##teamcity[testFinished name='Generators -- adapters' duration="{duration}"]
##teamcity[testStarted name='Generators -- simple']
Expand Down
41 changes: 38 additions & 3 deletions tests/SelfTest/Baselines/xml.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ Nor would this
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="#2615 - Throwing in constructor generator fails test case but does not abort" tags="[!shouldfail]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<TestCase name="#2615 - Throwing in constructor generator fails test case but does not abort" tags="[!shouldfail][generators][regression]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Exception filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
failure to init
</Exception>
Expand Down Expand Up @@ -5583,6 +5583,41 @@ C
</Section>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="GENERATE can combine literals and generators" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
i % 2 == 0
</Original>
<Expanded>
0 == 0
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
i % 2 == 0
</Original>
<Expanded>
0 == 0
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
i % 2 == 0
</Original>
<Expanded>
0 == 0
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
i % 2 == 0
</Original>
<Expanded>
0 == 0
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Generators -- adapters" tags="[generators][generic]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
Expand Down Expand Up @@ -21653,6 +21688,6 @@ b1!
</Section>
<OverallResult success="true" skips="0"/>
</TestCase>
<OverallResults successes="2073" failures="146" expectedFailures="35" skips="12"/>
<OverallResultsCases successes="310" failures="85" expectedFailures="14" skips="6"/>
<OverallResults successes="2077" failures="146" expectedFailures="35" skips="12"/>
<OverallResultsCases successes="311" failures="85" expectedFailures="14" skips="6"/>
</Catch2TestRun>
Loading

0 comments on commit c09e5fb

Please sign in to comment.