summaryrefslogtreecommitdiffstats
path: root/googletest/test/googletest-json-output-unittest.py
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2024-12-26 23:30:16 (GMT)
committerCopybara-Service <copybara-worker@google.com>2024-12-26 23:30:52 (GMT)
commit7d76a231b0e29caf86e68d1df858308cd53b2a66 (patch)
treef8769711e307a57d3d351415d8c8ebb7da612ae7 /googletest/test/googletest-json-output-unittest.py
parente54519b09463cec3aea77a1739e02c97ca766da5 (diff)
downloadgoogletest-7d76a231b0e29caf86e68d1df858308cd53b2a66.zip
googletest-7d76a231b0e29caf86e68d1df858308cd53b2a66.tar.gz
googletest-7d76a231b0e29caf86e68d1df858308cd53b2a66.tar.bz2
gtest: Output a canned test case for test suite setup / teardown failures in XML/JSON
This surfaces useful information about the environment failure in a structured form. As we can see from the updated test, previously unsurfaced information is now present. PiperOrigin-RevId: 709892315 Change-Id: I2656294d50c33f995bef5c96195a66cff3c4b907
Diffstat (limited to 'googletest/test/googletest-json-output-unittest.py')
-rw-r--r--googletest/test/googletest-json-output-unittest.py95
1 files changed, 86 insertions, 9 deletions
diff --git a/googletest/test/googletest-json-output-unittest.py b/googletest/test/googletest-json-output-unittest.py
index d3338e3..270de05 100644
--- a/googletest/test/googletest-json-output-unittest.py
+++ b/googletest/test/googletest-json-output-unittest.py
@@ -57,7 +57,7 @@ else:
STACK_TRACE_TEMPLATE = '\n'
EXPECTED_NON_EMPTY = {
- 'tests': 26,
+ 'tests': 28,
'failures': 5,
'disabled': 2,
'errors': 0,
@@ -420,6 +420,83 @@ EXPECTED_NON_EMPTY = {
],
},
{
+ 'name': 'SetupFailTest',
+ 'tests': 1,
+ 'failures': 0,
+ 'disabled': 0,
+ 'errors': 0,
+ 'time': '*',
+ 'timestamp': '*',
+ 'testsuite': [
+ {
+ 'name': 'NoopPassingTest',
+ 'file': 'gtest_xml_output_unittest_.cc',
+ 'line': 168,
+ 'status': 'RUN',
+ 'result': 'SKIPPED',
+ 'timestamp': '*',
+ 'time': '*',
+ 'classname': 'SetupFailTest',
+ 'skipped': [
+ {'message': 'gtest_xml_output_unittest_.cc:*\n'}
+ ],
+ },
+ {
+ 'name': '',
+ 'status': 'RUN',
+ 'result': 'COMPLETED',
+ 'timestamp': '*',
+ 'time': '*',
+ 'classname': '',
+ 'failures': [{
+ 'failure': (
+ 'gtest_xml_output_unittest_.cc:*\nExpected equality'
+ ' of these values:\n 1\n 2'
+ + STACK_TRACE_TEMPLATE
+ ),
+ 'type': '',
+ }],
+ },
+ ],
+ },
+ {
+ 'name': 'TearDownFailTest',
+ 'tests': 1,
+ 'failures': 0,
+ 'disabled': 0,
+ 'errors': 0,
+ 'timestamp': '*',
+ 'time': '*',
+ 'testsuite': [
+ {
+ 'name': 'NoopPassingTest',
+ 'file': 'gtest_xml_output_unittest_.cc',
+ 'line': 175,
+ 'status': 'RUN',
+ 'result': 'COMPLETED',
+ 'timestamp': '*',
+ 'time': '*',
+ 'classname': 'TearDownFailTest',
+ },
+ {
+ 'name': '',
+ 'status': 'RUN',
+ 'result': 'COMPLETED',
+ 'timestamp': '*',
+ 'time': '*',
+ 'classname': '',
+ 'failures': [{
+ 'failure': (
+ 'gtest_xml_output_unittest_.cc:*\nExpected equality'
+ ' of these values:\n 1\n 2'
+ + STACK_TRACE_TEMPLATE
+ ),
+ 'type': '',
+ }],
+ },
+ ],
+ },
+ {
'name': 'TypedTest/0',
'tests': 1,
'failures': 0,
@@ -431,7 +508,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasTypeParamAttribute',
'type_param': 'int',
'file': 'gtest_xml_output_unittest_.cc',
- 'line': 173,
+ 'line': 189,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
@@ -451,7 +528,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasTypeParamAttribute',
'type_param': 'long',
'file': 'gtest_xml_output_unittest_.cc',
- 'line': 173,
+ 'line': 189,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
@@ -471,7 +548,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasTypeParamAttribute',
'type_param': 'int',
'file': 'gtest_xml_output_unittest_.cc',
- 'line': 180,
+ 'line': 196,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
@@ -491,7 +568,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasTypeParamAttribute',
'type_param': 'long',
'file': 'gtest_xml_output_unittest_.cc',
- 'line': 180,
+ 'line': 196,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
@@ -512,7 +589,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasValueParamAttribute/0',
'value_param': '33',
'file': 'gtest_xml_output_unittest_.cc',
- 'line': 164,
+ 'line': 180,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
@@ -523,7 +600,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasValueParamAttribute/1',
'value_param': '42',
'file': 'gtest_xml_output_unittest_.cc',
- 'line': 164,
+ 'line': 180,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
@@ -534,7 +611,7 @@ EXPECTED_NON_EMPTY = {
'name': 'AnotherTestThatHasValueParamAttribute/0',
'value_param': '33',
'file': 'gtest_xml_output_unittest_.cc',
- 'line': 165,
+ 'line': 181,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
@@ -545,7 +622,7 @@ EXPECTED_NON_EMPTY = {
'name': 'AnotherTestThatHasValueParamAttribute/1',
'value_param': '42',
'file': 'gtest_xml_output_unittest_.cc',
- 'line': 165,
+ 'line': 181,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',