diff options
author | Abseil Team <absl-team@google.com> | 2021-03-11 15:57:48 (GMT) |
---|---|---|
committer | Andy Soffer <asoffer@google.com> | 2021-03-16 13:51:18 (GMT) |
commit | ac1d60c2b5ae62a06eca1d2c0f9d6dc92cda8711 (patch) | |
tree | 5c26175b8bf501df76da71ef4b9cf33a49cca959 /googletest/test/googletest-json-output-unittest.py | |
parent | 3bd41ab23f4c77b26892a5829f35df4e4edc2093 (diff) | |
download | googletest-ac1d60c2b5ae62a06eca1d2c0f9d6dc92cda8711.zip googletest-ac1d60c2b5ae62a06eca1d2c0f9d6dc92cda8711.tar.gz googletest-ac1d60c2b5ae62a06eca1d2c0f9d6dc92cda8711.tar.bz2 |
Googletest export
gtest: Output a canned test suite for environment 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: 362292322
Diffstat (limited to 'googletest/test/googletest-json-output-unittest.py')
-rw-r--r-- | googletest/test/googletest-json-output-unittest.py | 70 |
1 files changed, 57 insertions, 13 deletions
diff --git a/googletest/test/googletest-json-output-unittest.py b/googletest/test/googletest-json-output-unittest.py index e799d47..41c8565 100644 --- a/googletest/test/googletest-json-output-unittest.py +++ b/googletest/test/googletest-json-output-unittest.py @@ -612,15 +612,59 @@ EXPECTED_FILTERED = { }], } -EXPECTED_EMPTY = { - u'tests': 0, - u'failures': 0, - u'disabled': 0, - u'errors': 0, - u'time': u'*', - u'timestamp': u'*', - u'name': u'AllTests', - u'testsuites': [], +EXPECTED_NO_TEST = { + u'tests': + 0, + u'failures': + 0, + u'disabled': + 0, + u'errors': + 0, + u'time': + u'*', + u'timestamp': + u'*', + u'name': + u'AllTests', + u'testsuites': [{ + u'name': + u'NonTestSuiteFailure', + u'tests': + 1, + u'failures': + 1, + u'disabled': + 0, + u'skipped': + 0, + u'errors': + 0, + u'time': + u'*', + u'timestamp': + u'*', + u'testsuite': [{ + u'name': + u'', + u'status': + u'RUN', + u'result': + u'COMPLETED', + u'time': + u'*', + u'timestamp': + u'*', + u'classname': + u'', + u'failures': [{ + u'failure': u'gtest_no_test_unittest.cc:*\n' + u'Expected equality of these values:\n' + u' 1\n 2' + STACK_TRACE_TEMPLATE, + u'type': u'', + }] + }] + }], } GTEST_PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath(GTEST_PROGRAM_NAME) @@ -645,14 +689,14 @@ class GTestJsonOutputUnitTest(gtest_test_utils.TestCase): """ self._TestJsonOutput(GTEST_PROGRAM_NAME, EXPECTED_NON_EMPTY, 1) - def testEmptyJsonOutput(self): + def testNoTestJsonOutput(self): """Verifies JSON output for a Google Test binary without actual tests. - Runs a test program that generates an empty JSON output, and - tests that the JSON output is expected. + Runs a test program that generates an JSON output for a binary with no + tests, and tests that the JSON output is expected. """ - self._TestJsonOutput('gtest_no_test_unittest', EXPECTED_EMPTY, 0) + self._TestJsonOutput('gtest_no_test_unittest', EXPECTED_NO_TEST, 0) def testTimestampValue(self): """Checks whether the timestamp attribute in the JSON output is valid. |