mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 22:05:39 +02:00
Add JSON reporter (#2706)
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user