Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Nov 13, 2023
1 parent 121ffa6 commit d4f6649
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 28 deletions.
6 changes: 3 additions & 3 deletions tests/SelfTest/Baselines/compact.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fak
"version": 1,
"metadata": {
"name": "",
"rng-seed": 1165749983,
"rng-seed": 955633564,
"catch2-version": "<version>"
},
"listings": {
Expand All @@ -1522,7 +1522,7 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fak
"version": 1,
"metadata": {
"name": "",
"rng-seed": 1746012198,
"rng-seed": 3990350118,
"catch2-version": "<version>"
},
"listings": {
Expand All @@ -1537,7 +1537,7 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fa
"version": 1,
"metadata": {
"name": "",
"rng-seed": 2024462101,
"rng-seed": 3456004280,
"catch2-version": "<version>"
},
"listings": {
Expand Down
6 changes: 3 additions & 3 deletions tests/SelfTest/Baselines/compact.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1503,7 +1503,7 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fak
"version": 1,
"metadata": {
"name": "",
"rng-seed": 3063158779,
"rng-seed": 3700371135,
"catch2-version": "<version>"
},
"listings": {
Expand All @@ -1520,7 +1520,7 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fak
"version": 1,
"metadata": {
"name": "",
"rng-seed": 4167192188,
"rng-seed": 2644048754,
"catch2-version": "<version>"
},
"listings": {
Expand All @@ -1535,7 +1535,7 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fa
"version": 1,
"metadata": {
"name": "",
"rng-seed": 2012246564,
"rng-seed": 961334686,
"catch2-version": "<version>"
},
"listings": {
Expand Down
6 changes: 3 additions & 3 deletions tests/SelfTest/Baselines/console.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10043,7 +10043,7 @@ with expansion:
"version": 1,
"metadata": {
"name": "",
"rng-seed": 433972047,
"rng-seed": 996408978,
"catch2-version": "<version>"
},
"listings": {
Expand Down Expand Up @@ -10083,7 +10083,7 @@ with expansion:
"version": 1,
"metadata": {
"name": "",
"rng-seed": 3022685148,
"rng-seed": 2735226002,
"catch2-version": "<version>"
},
"listings": {
Expand Down Expand Up @@ -10121,7 +10121,7 @@ with expansion:
"version": 1,
"metadata": {
"name": "",
"rng-seed": 1115827888,
"rng-seed": 1638325795,
"catch2-version": "<version>"
},
"listings": {
Expand Down
6 changes: 3 additions & 3 deletions tests/SelfTest/Baselines/console.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10041,7 +10041,7 @@ with expansion:
"version": 1,
"metadata": {
"name": "",
"rng-seed": 3063158779,
"rng-seed": 3700371135,
"catch2-version": "<version>"
},
"listings": {
Expand Down Expand Up @@ -10081,7 +10081,7 @@ with expansion:
"version": 1,
"metadata": {
"name": "",
"rng-seed": 4167192188,
"rng-seed": 2644048754,
"catch2-version": "<version>"
},
"listings": {
Expand Down Expand Up @@ -10119,7 +10119,7 @@ with expansion:
"version": 1,
"metadata": {
"name": "",
"rng-seed": 2012246564,
"rng-seed": 961334686,
"catch2-version": "<version>"
},
"listings": {
Expand Down
12 changes: 9 additions & 3 deletions tests/SelfTest/Baselines/default.sw.multi.approved.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
This would not be caught previously
Nor would this
<exe-name>: src/catch2/reporters/catch_reporter_json.cpp:103: virtual Catch::JsonReporter::~JsonReporter(): Assertion `m_writers.size() == 1 && "Only the top level object should be open"' failed.
terminate called after throwing an instance of 'std::domain_error'
what(): A partial test case has not ended
A string sent directly to stdout
A string sent directly to stderr
A string sent to stderr via clog
Message from section one
Message from section two
loose text artifact
a!
b1!
!
6 changes: 3 additions & 3 deletions tests/SelfTest/Baselines/tap.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2521,15 +2521,15 @@ ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && Cont
# Reporter's write listings to provided stream
ok {test-number} - !(factories.empty()) for: !false
# Reporter's write listings to provided stream
ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 666503459, "catch2-version": "<version>" }, "listings": { "tags": [ { "aliases": [ "fakeTag" ], "count": 1 } ]" contains: "fakeTag" with 1 message: 'Tested reporter: JSON'
ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 609908209, "catch2-version": "<version>" }, "listings": { "tags": [ { "aliases": [ "fakeTag" ], "count": 1 } ]" contains: "fakeTag" with 1 message: 'Tested reporter: JSON'
# Reporter's write listings to provided stream
ok {test-number} - !(factories.empty()) for: !false
# Reporter's write listings to provided stream
ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 4229138389, "catch2-version": "<version>" }, "listings": { "reporters": [ { "name": "fake reporter", "description": "fake description" } ]" contains: "fake reporter" with 1 message: 'Tested reporter: JSON'
ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 4139789178, "catch2-version": "<version>" }, "listings": { "reporters": [ { "name": "fake reporter", "description": "fake description" } ]" contains: "fake reporter" with 1 message: 'Tested reporter: JSON'
# Reporter's write listings to provided stream
ok {test-number} - !(factories.empty()) for: !false
# Reporter's write listings to provided stream
ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 1573494800, "catch2-version": "<version>" }, "listings": { "tests": [ { "name": "fake test name", "class-name": "", "tags": [ "fakeTestTag" ], "source-location": { "filename": "fake-file.cpp", "line": 123456789 } } ]" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: JSON'
ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 2075683012, "catch2-version": "<version>" }, "listings": { "tests": [ { "name": "fake test name", "class-name": "", "tags": [ "fakeTestTag" ], "source-location": { "filename": "fake-file.cpp", "line": 123456789 } } ]" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: JSON'
# Reporter's write listings to provided stream
ok {test-number} - !(factories.empty()) for: !false
# Reporter's write listings to provided stream
Expand Down
6 changes: 3 additions & 3 deletions tests/SelfTest/Baselines/tap.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2519,15 +2519,15 @@ ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && Cont
# Reporter's write listings to provided stream
ok {test-number} - !(factories.empty()) for: !false
# Reporter's write listings to provided stream
ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 3063158779, "catch2-version": "<version>" }, "listings": { "tags": [ { "aliases": [ "fakeTag" ], "count": 1 } ]" contains: "fakeTag" with 1 message: 'Tested reporter: JSON'
ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 3700371135, "catch2-version": "<version>" }, "listings": { "tags": [ { "aliases": [ "fakeTag" ], "count": 1 } ]" contains: "fakeTag" with 1 message: 'Tested reporter: JSON'
# Reporter's write listings to provided stream
ok {test-number} - !(factories.empty()) for: !false
# Reporter's write listings to provided stream
ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 4167192188, "catch2-version": "<version>" }, "listings": { "reporters": [ { "name": "fake reporter", "description": "fake description" } ]" contains: "fake reporter" with 1 message: 'Tested reporter: JSON'
ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 2644048754, "catch2-version": "<version>" }, "listings": { "reporters": [ { "name": "fake reporter", "description": "fake description" } ]" contains: "fake reporter" with 1 message: 'Tested reporter: JSON'
# Reporter's write listings to provided stream
ok {test-number} - !(factories.empty()) for: !false
# Reporter's write listings to provided stream
ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 2012246564, "catch2-version": "<version>" }, "listings": { "tests": [ { "name": "fake test name", "class-name": "", "tags": [ "fakeTestTag" ], "source-location": { "filename": "fake-file.cpp", "line": 123456789 } } ]" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: JSON'
ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "{ "version": 1, "metadata": { "name": "", "rng-seed": 961334686, "catch2-version": "<version>" }, "listings": { "tests": [ { "name": "fake test name", "class-name": "", "tags": [ "fakeTestTag" ], "source-location": { "filename": "fake-file.cpp", "line": 123456789 } } ]" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: JSON'
# Reporter's write listings to provided stream
ok {test-number} - !(factories.empty()) for: !false
# Reporter's write listings to provided stream
Expand Down
6 changes: 3 additions & 3 deletions tests/SelfTest/Baselines/xml.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11969,7 +11969,7 @@ C
"version": 1,
"metadata": {
"name": "",
"rng-seed": 1034695662,
"rng-seed": 1154102175,
"catch2-version": "<version>"
},
"listings": {
Expand Down Expand Up @@ -12006,7 +12006,7 @@ C
"version": 1,
"metadata": {
"name": "",
"rng-seed": 1858798674,
"rng-seed": 717735990,
"catch2-version": "<version>"
},
"listings": {
Expand Down Expand Up @@ -12041,7 +12041,7 @@ C
"version": 1,
"metadata": {
"name": "",
"rng-seed": 3265885656,
"rng-seed": 187385692,
"catch2-version": "<version>"
},
"listings": {
Expand Down
6 changes: 3 additions & 3 deletions tests/SelfTest/Baselines/xml.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11969,7 +11969,7 @@ C
"version": 1,
"metadata": {
"name": "",
"rng-seed": 3063158779,
"rng-seed": 3700371135,
"catch2-version": "<version>"
},
"listings": {
Expand Down Expand Up @@ -12006,7 +12006,7 @@ C
"version": 1,
"metadata": {
"name": "",
"rng-seed": 4167192188,
"rng-seed": 2644048754,
"catch2-version": "<version>"
},
"listings": {
Expand Down Expand Up @@ -12041,7 +12041,7 @@ C
"version": 1,
"metadata": {
"name": "",
"rng-seed": 2012246564,
"rng-seed": 961334686,
"catch2-version": "<version>"
},
"listings": {
Expand Down
4 changes: 3 additions & 1 deletion tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) {
auto sstream = Catch::Detail::make_unique<StringIStream>();
auto& sstreamRef = *sstream.get();

Catch::Config config( Catch::ConfigData{} );
Catch::ConfigData cfg_data;
cfg_data.rngSeed = 1234;
Catch::Config config( cfg_data );
auto reporter = factory.second->create( Catch::ReporterConfig{
&config, CATCH_MOVE( sstream ), Catch::ColourMode::None, {} } );

Expand Down

0 comments on commit d4f6649

Please sign in to comment.