Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest
diff options
context:
space:
mode:
authorBeartama2023-11-14 23:52:15 +0200
committerGitHub2023-11-14 22:52:15 +0100
commit7bf136b501fef3e189b45091e8a4757a5eaef31f (patch)
treefe788efc997f7f4ed26fbe5d564d8d40df83c938 /tests/SelfTest
parent2c68a0d05f4fa8fb79cd43824f69568eb3954d4c (diff)
downloadcatch3-7bf136b501fef3e189b45091e8a4757a5eaef31f.tar.gz
Add JSON reporter (#2706)
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
Diffstat (limited to 'tests/SelfTest')
-rw-r--r--tests/SelfTest/Baselines/automake.sw.approved.txt1
-rw-r--r--tests/SelfTest/Baselines/automake.sw.multi.approved.txt1
-rw-r--r--tests/SelfTest/Baselines/compact.sw.approved.txt135
-rw-r--r--tests/SelfTest/Baselines/compact.sw.multi.approved.txt135
-rw-r--r--tests/SelfTest/Baselines/console.std.approved.txt4
-rw-r--r--tests/SelfTest/Baselines/console.sw.approved.txt316
-rw-r--r--tests/SelfTest/Baselines/console.sw.multi.approved.txt316
-rw-r--r--tests/SelfTest/Baselines/junit.sw.approved.txt15
-rw-r--r--tests/SelfTest/Baselines/junit.sw.multi.approved.txt15
-rw-r--r--tests/SelfTest/Baselines/sonarqube.sw.approved.txt15
-rw-r--r--tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt15
-rw-r--r--tests/SelfTest/Baselines/tap.sw.approved.txt34
-rw-r--r--tests/SelfTest/Baselines/tap.sw.multi.approved.txt34
-rw-r--r--tests/SelfTest/Baselines/teamcity.sw.approved.txt2
-rw-r--r--tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt2
-rw-r--r--tests/SelfTest/Baselines/xml.sw.approved.txt298
-rw-r--r--tests/SelfTest/Baselines/xml.sw.multi.approved.txt298
-rw-r--r--tests/SelfTest/IntrospectiveTests/Json.tests.cpp116
-rw-r--r--tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp4
19 files changed, 1737 insertions, 19 deletions
diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt
index 6748c0ec..0f029e6d 100644
--- a/tests/SelfTest/Baselines/automake.sw.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.approved.txt
@@ -170,6 +170,7 @@ Nor would this
:test-result: XFAIL Incomplete AssertionHandler
:test-result: XFAIL Inequality checks that should fail
:test-result: PASS Inequality checks that should succeed
+:test-result: PASS JsonWriter
:test-result: PASS Lambdas in assertions
:test-result: PASS Less-than inequalities with different epsilons
:test-result: PASS ManuallyRegistered
diff --git a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
index a8bdcfa1..a3af0658 100644
--- a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
@@ -168,6 +168,7 @@
:test-result: XFAIL Incomplete AssertionHandler
:test-result: XFAIL Inequality checks that should fail
:test-result: PASS Inequality checks that should succeed
+:test-result: PASS JsonWriter
:test-result: PASS Lambdas in assertions
:test-result: PASS Less-than inequalities with different epsilons
:test-result: PASS ManuallyRegistered
diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt
index dafa08db..e78c989f 100644
--- a/tests/SelfTest/Baselines/compact.sw.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.approved.txt
@@ -979,6 +979,83 @@ Condition.tests.cpp:<line number>: passed: data.str_hello != "goodbye" for: "hel
Condition.tests.cpp:<line number>: passed: data.str_hello != "hell" for: "hello" != "hell"
Condition.tests.cpp:<line number>: passed: data.str_hello != "hello1" for: "hello" != "hello1"
Condition.tests.cpp:<line number>: passed: data.str_hello.size() != 6 for: 5 != 6
+Json.tests.cpp:<line number>: passed: stream.str() == "" for: "" == ""
+Json.tests.cpp:<line number>: passed: stream.str() == "{\n}" for: "{
+}"
+==
+"{
+}"
+Json.tests.cpp:<line number>: passed: stream.str(), ContainsSubstring( "\"int\": 1," ) && ContainsSubstring( "\"double\": 1.5," ) && ContainsSubstring( "\"true\": true," ) && ContainsSubstring( "\"false\": false," ) && ContainsSubstring( "\"string\": \"this is a string\"," ) && ContainsSubstring( "\"array\": [\n 1,\n 2\n ]\n}" ) for: "{
+ "int": 1,
+ "double": 1.5,
+ "true": true,
+ "false": false,
+ "string": "this is a string",
+ "array": [
+ 1,
+ 2
+ ]
+}" ( contains: ""int": 1," and contains: ""double": 1.5," and contains: ""true": true," and contains: ""false": false," and contains: ""string": "this is a string"," and contains: ""array": [
+ 1,
+ 2
+ ]
+}" )
+Json.tests.cpp:<line number>: passed: stream.str(), ContainsSubstring( "\"empty_object\": {\n }," ) && ContainsSubstring( "\"fully_object\": {\n \"key\": 1\n }" ) for: "{
+ "empty_object": {
+ },
+ "fully_object": {
+ "key": 1
+ }
+}" ( contains: ""empty_object": {
+ }," and contains: ""fully_object": {
+ "key": 1
+ }" )
+Json.tests.cpp:<line number>: passed: stream.str() == "[\n]" for: "[
+]"
+==
+"[
+]"
+Json.tests.cpp:<line number>: passed: stream.str() == "[\n 1,\n 1.5,\n true,\n false,\n \"this is a string\",\n {\n \"object\": 42\n },\n [\n \"array\",\n 42.5\n ]\n]" for: "[
+ 1,
+ 1.5,
+ true,
+ false,
+ "this is a string",
+ {
+ "object": 42
+ },
+ [
+ "array",
+ 42.5
+ ]
+]"
+==
+"[
+ 1,
+ 1.5,
+ true,
+ false,
+ "this is a string",
+ {
+ "object": 42
+ },
+ [
+ "array",
+ 42.5
+ ]
+]"
+Json.tests.cpp:<line number>: passed: stream.str() == "{\n}" for: "{
+}"
+==
+"{
+}"
+Json.tests.cpp:<line number>: passed: stream.str() == "[\n]" for: "[
+]"
+==
+"[
+]"
+Json.tests.cpp:<line number>: passed: stream.str() == "\"custom\"" for: ""custom"" == ""custom""
+Json.tests.cpp:<line number>: passed: stream.str() == "\"\\\"\"" for: ""\""" == ""\"""
Compilation.tests.cpp:<line number>: passed: []() { return true; }() for: true
Approx.tests.cpp:<line number>: passed: d <= Approx( 1.24 ) for: 1.23 <= Approx( 1.24 )
Approx.tests.cpp:<line number>: passed: d <= Approx( 1.23 ) for: 1.23 <= Approx( 1.23 )
@@ -1343,6 +1420,60 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fa
" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console'
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
+Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "{
+ "version": 1,
+ "metadata": {
+ "name": "",
+ "rng-seed": 1234,
+ "catch2-version": "<version>"
+ },
+ "listings": {
+ "tags": [
+ {
+ "aliases": [
+ "fakeTag"
+ ],
+ "count": 1
+ }
+ ]" contains: "fakeTag" with 1 message: 'Tested reporter: JSON'
+Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
+Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "{
+ "version": 1,
+ "metadata": {
+ "name": "",
+ "rng-seed": 1234,
+ "catch2-version": "<version>"
+ },
+ "listings": {
+ "reporters": [
+ {
+ "name": "fake reporter",
+ "description": "fake description"
+ }
+ ]" contains: "fake reporter" with 1 message: 'Tested reporter: JSON'
+Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
+Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "{
+ "version": 1,
+ "metadata": {
+ "name": "",
+ "rng-seed": 1234,
+ "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'
+Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?>
All available tags:
1 [fakeTag]
@@ -2544,7 +2675,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: 413 | 308 passed | 85 failed | 6 skipped | 14 failed as expected
-assertions: 2230 | 2049 passed | 146 failed | 35 failed as expected
+test cases: 414 | 309 passed | 85 failed | 6 skipped | 14 failed as expected
+assertions: 2246 | 2065 passed | 146 failed | 35 failed as expected
diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
index 36debdb7..8f177e46 100644
--- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
@@ -977,6 +977,83 @@ Condition.tests.cpp:<line number>: passed: data.str_hello != "goodbye" for: "hel
Condition.tests.cpp:<line number>: passed: data.str_hello != "hell" for: "hello" != "hell"
Condition.tests.cpp:<line number>: passed: data.str_hello != "hello1" for: "hello" != "hello1"
Condition.tests.cpp:<line number>: passed: data.str_hello.size() != 6 for: 5 != 6
+Json.tests.cpp:<line number>: passed: stream.str() == "" for: "" == ""
+Json.tests.cpp:<line number>: passed: stream.str() == "{\n}" for: "{
+}"
+==
+"{
+}"
+Json.tests.cpp:<line number>: passed: stream.str(), ContainsSubstring( "\"int\": 1," ) && ContainsSubstring( "\"double\": 1.5," ) && ContainsSubstring( "\"true\": true," ) && ContainsSubstring( "\"false\": false," ) && ContainsSubstring( "\"string\": \"this is a string\"," ) && ContainsSubstring( "\"array\": [\n 1,\n 2\n ]\n}" ) for: "{
+ "int": 1,
+ "double": 1.5,
+ "true": true,
+ "false": false,
+ "string": "this is a string",
+ "array": [
+ 1,
+ 2
+ ]
+}" ( contains: ""int": 1," and contains: ""double": 1.5," and contains: ""true": true," and contains: ""false": false," and contains: ""string": "this is a string"," and contains: ""array": [
+ 1,
+ 2
+ ]
+}" )
+Json.tests.cpp:<line number>: passed: stream.str(), ContainsSubstring( "\"empty_object\": {\n }," ) && ContainsSubstring( "\"fully_object\": {\n \"key\": 1\n }" ) for: "{
+ "empty_object": {
+ },
+ "fully_object": {
+ "key": 1
+ }
+}" ( contains: ""empty_object": {
+ }," and contains: ""fully_object": {
+ "key": 1
+ }" )
+Json.tests.cpp:<line number>: passed: stream.str() == "[\n]" for: "[
+]"
+==
+"[
+]"
+Json.tests.cpp:<line number>: passed: stream.str() == "[\n 1,\n 1.5,\n true,\n false,\n \"this is a string\",\n {\n \"object\": 42\n },\n [\n \"array\",\n 42.5\n ]\n]" for: "[
+ 1,
+ 1.5,
+ true,
+ false,
+ "this is a string",
+ {
+ "object": 42
+ },
+ [
+ "array",
+ 42.5
+ ]
+]"
+==
+"[
+ 1,
+ 1.5,
+ true,
+ false,
+ "this is a string",
+ {
+ "object": 42
+ },
+ [
+ "array",
+ 42.5
+ ]
+]"
+Json.tests.cpp:<line number>: passed: stream.str() == "{\n}" for: "{
+}"
+==
+"{
+}"
+Json.tests.cpp:<line number>: passed: stream.str() == "[\n]" for: "[
+]"
+==
+"[
+]"
+Json.tests.cpp:<line number>: passed: stream.str() == "\"custom\"" for: ""custom"" == ""custom""
+Json.tests.cpp:<line number>: passed: stream.str() == "\"\\\"\"" for: ""\""" == ""\"""
Compilation.tests.cpp:<line number>: passed: []() { return true; }() for: true
Approx.tests.cpp:<line number>: passed: d <= Approx( 1.24 ) for: 1.23 <= Approx( 1.24 )
Approx.tests.cpp:<line number>: passed: d <= Approx( 1.23 ) for: 1.23 <= Approx( 1.23 )
@@ -1341,6 +1418,60 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fa
" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console'
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
+Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "{
+ "version": 1,
+ "metadata": {
+ "name": "",
+ "rng-seed": 1234,
+ "catch2-version": "<version>"
+ },
+ "listings": {
+ "tags": [
+ {
+ "aliases": [
+ "fakeTag"
+ ],
+ "count": 1
+ }
+ ]" contains: "fakeTag" with 1 message: 'Tested reporter: JSON'
+Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
+Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "{
+ "version": 1,
+ "metadata": {
+ "name": "",
+ "rng-seed": 1234,
+ "catch2-version": "<version>"
+ },
+ "listings": {
+ "reporters": [
+ {
+ "name": "fake reporter",
+ "description": "fake description"
+ }
+ ]" contains: "fake reporter" with 1 message: 'Tested reporter: JSON'
+Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
+Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "{
+ "version": 1,
+ "metadata": {
+ "name": "",
+ "rng-seed": 1234,
+ "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'
+Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?>
All available tags:
1 [fakeTag]
@@ -2533,7 +2664,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: 413 | 308 passed | 85 failed | 6 skipped | 14 failed as expected
-assertions: 2230 | 2049 passed | 146 failed | 35 failed as expected
+test cases: 414 | 309 passed | 85 failed | 6 skipped | 14 failed as expected
+assertions: 2246 | 2065 passed | 146 failed | 35 failed as expected
diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt
index 4ad25ed8..9aa0d038 100644
--- a/tests/SelfTest/Baselines/console.std.approved.txt
+++ b/tests/SelfTest/Baselines/console.std.approved.txt
@@ -1588,6 +1588,6 @@ due to unexpected exception with message:
Why would you throw a std::string?
===============================================================================
-test cases: 413 | 322 passed | 70 failed | 7 skipped | 14 failed as expected
-assertions: 2213 | 2049 passed | 129 failed | 35 failed as expected
+test cases: 414 | 323 passed | 70 failed | 7 skipped | 14 failed as expected
+assertions: 2229 | 2065 passed | 129 failed | 35 failed as expected
diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt
index d56e8c41..71cbbd27 100644
--- a/tests/SelfTest/Baselines/console.sw.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.approved.txt
@@ -7259,6 +7259,195 @@ with expansion:
5 != 6
-------------------------------------------------------------------------------
+JsonWriter
+ Newly constructed JsonWriter does nothing
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE( stream.str() == "" )
+with expansion:
+ "" == ""
+
+-------------------------------------------------------------------------------
+JsonWriter
+ Calling writeObject will create an empty pair of braces
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE( stream.str() == "{\n}" )
+with expansion:
+ "{
+ }"
+ ==
+ "{
+ }"
+
+-------------------------------------------------------------------------------
+JsonWriter
+ Calling writeObject with key will create an object to write the value
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE_THAT( stream.str(), ContainsSubstring( "\"int\": 1," ) && ContainsSubstring( "\"double\": 1.5," ) && ContainsSubstring( "\"true\": true," ) && ContainsSubstring( "\"false\": false," ) && ContainsSubstring( "\"string\": \"this is a string\"," ) && ContainsSubstring( "\"array\": [\n 1,\n 2\n ]\n}" ) )
+with expansion:
+ "{
+ "int": 1,
+ "double": 1.5,
+ "true": true,
+ "false": false,
+ "string": "this is a string",
+ "array": [
+ 1,
+ 2
+ ]
+ }" ( contains: ""int": 1," and contains: ""double": 1.5," and contains:
+ ""true": true," and contains: ""false": false," and contains: ""string":
+ "this is a string"," and contains: ""array": [
+ 1,
+ 2
+ ]
+ }" )
+
+-------------------------------------------------------------------------------
+JsonWriter
+ nesting objects
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE_THAT( stream.str(), ContainsSubstring( "\"empty_object\": {\n }," ) && ContainsSubstring( "\"fully_object\": {\n \"key\": 1\n }" ) )
+with expansion:
+ "{
+ "empty_object": {
+ },
+ "fully_object": {
+ "key": 1
+ }
+ }" ( contains: ""empty_object": {
+ }," and contains: ""fully_object": {
+ "key": 1
+ }" )
+
+-------------------------------------------------------------------------------
+JsonWriter
+ Calling writeArray will create an empty pair of braces
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE( stream.str() == "[\n]" )
+with expansion:
+ "[
+ ]"
+ ==
+ "[
+ ]"
+
+-------------------------------------------------------------------------------
+JsonWriter
+ Calling writeArray creates array to write the values to
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE( stream.str() == "[\n 1,\n 1.5,\n true,\n false,\n \"this is a string\",\n {\n \"object\": 42\n },\n [\n \"array\",\n 42.5\n ]\n]" )
+with expansion:
+ "[
+ 1,
+ 1.5,
+ true,
+ false,
+ "this is a string",
+ {
+ "object": 42
+ },
+ [
+ "array",
+ 42.5
+ ]
+ ]"
+ ==
+ "[
+ 1,
+ 1.5,
+ true,
+ false,
+ "this is a string",
+ {
+ "object": 42
+ },
+ [
+ "array",
+ 42.5
+ ]
+ ]"
+
+-------------------------------------------------------------------------------
+JsonWriter
+ Moved from JsonObjectWriter shall not insert superfluous brace
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE( stream.str() == "{\n}" )
+with expansion:
+ "{
+ }"
+ ==
+ "{
+ }"
+
+-------------------------------------------------------------------------------
+JsonWriter
+ Moved from JsonArrayWriter shall not insert superfluous bracket
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE( stream.str() == "[\n]" )
+with expansion:
+ "[
+ ]"
+ ==
+ "[
+ ]"
+
+-------------------------------------------------------------------------------
+JsonWriter
+ Custom class shall be quoted
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE( stream.str() == "\"custom\"" )
+with expansion:
+ ""custom"" == ""custom""
+
+-------------------------------------------------------------------------------
+JsonWriter
+ String with a quote shall be espaced
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE( stream.str() == "\"\\\"\"" )
+with expansion:
+ ""\""" == ""\"""
+
+-------------------------------------------------------------------------------
Lambdas in assertions
-------------------------------------------------------------------------------
Compilation.tests.cpp:<line number>
@@ -9763,6 +9952,129 @@ with expansion:
-------------------------------------------------------------------------------
Reporter's write listings to provided stream
+ JSON reporter lists tags
+-------------------------------------------------------------------------------
+Reporters.tests.cpp:<line number>
+...............................................................................
+
+Reporters.tests.cpp:<line number>: PASSED:
+ REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) )
+with expansion:
+ "{
+ "version": 1,
+ "metadata": {
+ "name": "",
+ "rng-seed": 1234,
+ "catch2-version": "<version>"
+ },
+ "listings": {
+ "tags": [
+ {
+ "aliases": [
+ "fakeTag"
+ ],
+ "count": 1
+ }
+ ]" contains: "fakeTag"
+with message:
+ Tested reporter: JSON
+
+-------------------------------------------------------------------------------
+Reporter's write listings to provided stream
+-------------------------------------------------------------------------------
+Reporters.tests.cpp:<line number>
+...............................................................................
+
+Reporters.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( factories.empty() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+Reporter's write listings to provided stream
+ JSON reporter lists reporters
+-------------------------------------------------------------------------------
+Reporters.tests.cpp:<line number>
+...............................................................................
+
+Reporters.tests.cpp:<line number>: PASSED:
+ REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) )
+with expansion:
+ "{
+ "version": 1,
+ "metadata": {
+ "name": "",
+ "rng-seed": 1234,
+ "catch2-version": "<version>"
+ },
+ "listings": {
+ "reporters": [
+ {
+ "name": "fake reporter",
+ "description": "fake description"
+ }
+ ]" contains: "fake reporter"
+with message:
+ Tested reporter: JSON
+
+-------------------------------------------------------------------------------
+Reporter's write listings to provided stream
+-------------------------------------------------------------------------------
+Reporters.tests.cpp:<line number>
+...............................................................................
+
+Reporters.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( factories.empty() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+Reporter's write listings to provided stream
+ JSON reporter lists tests
+-------------------------------------------------------------------------------
+Reporters.tests.cpp:<line number>
+...............................................................................
+
+Reporters.tests.cpp:<line number>: PASSED:
+ REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) )
+with expansion:
+ "{
+ "version": 1,
+ "metadata": {
+ "name": "",
+ "rng-seed": 1234,
+ "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 message:
+ Tested reporter: JSON
+
+-------------------------------------------------------------------------------
+Reporter's write listings to provided stream
+-------------------------------------------------------------------------------
+Reporters.tests.cpp:<line number>
+...............................................................................
+
+Reporters.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( factories.empty() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+Reporter's write listings to provided stream
JUnit reporter lists tags
-------------------------------------------------------------------------------
Reporters.tests.cpp:<line number>
@@ -18283,6 +18595,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
-test cases: 413 | 308 passed | 85 failed | 6 skipped | 14 failed as expected
-assertions: 2230 | 2049 passed | 146 failed | 35 failed as expected
+test cases: 414 | 309 passed | 85 failed | 6 skipped | 14 failed as expected
+assertions: 2246 | 2065 passed | 146 failed | 35 failed as expected
diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
index be965932..ccb27333 100644
--- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
@@ -7257,6 +7257,195 @@ with expansion:
5 != 6
-------------------------------------------------------------------------------
+JsonWriter
+ Newly constructed JsonWriter does nothing
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE( stream.str() == "" )
+with expansion:
+ "" == ""
+
+-------------------------------------------------------------------------------
+JsonWriter
+ Calling writeObject will create an empty pair of braces
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE( stream.str() == "{\n}" )
+with expansion:
+ "{
+ }"
+ ==
+ "{
+ }"
+
+-------------------------------------------------------------------------------
+JsonWriter
+ Calling writeObject with key will create an object to write the value
+-------------------------------------------------------------------------------
+Json.tests.cpp:<line number>
+...............................................................................
+
+Json.tests.cpp:<line number>: PASSED:
+ REQUIRE_THAT( stream.str(), ContainsSubstring( "\"int\": 1," ) && ContainsSubstring( "\"double\": 1.5," ) && ContainsSubstring( "\"true\": true," ) && ContainsSubstring( "\"false\": false," ) && ContainsSubstring( "\"string\": \"this is a string\"," ) && ContainsSubstring( "\"array\": [\n 1,\n 2\n ]\n}" ) )
+with expansion:
+ "{
+ "int": 1,
+ "double": 1.5,
+ "true": true,
+ "false": false,
+ "string": "this is a string",
+ "array": [
+ 1,
+ 2
+ ]
+ }" ( contains: ""int": 1," and contains: ""double": 1.5," and contains:
+ ""true": true," and contains: ""false": false," and contains: ""string":
+ "this is a string"," and contains: ""array": [
+ 1,
+ 2
+ ]
+ }" )
+
+-------------------------------------------------------------------------------
+JsonWriter
+ nesting objects</