diff options
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. |