"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "googletest/test/googletest-json-output-unittest.py" between
googletest-release-1.10.0.tar.gz and googletest-release-1.11.0.tar.gz

About: GoogleTest is Google's (unit) testing and mocking framework for C++ tests.

googletest-json-output-unittest.py  (googletest-release-1.10.0):googletest-json-output-unittest.py  (googletest-release-1.11.0)
skipping to change at line 61 skipping to change at line 61
SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv
if SUPPORTS_STACK_TRACES: if SUPPORTS_STACK_TRACES:
STACK_TRACE_TEMPLATE = '\nStack trace:\n*' STACK_TRACE_TEMPLATE = '\nStack trace:\n*'
else: else:
STACK_TRACE_TEMPLATE = '' STACK_TRACE_TEMPLATE = ''
EXPECTED_NON_EMPTY = { EXPECTED_NON_EMPTY = {
u'tests': u'tests':
24, 26,
u'failures': u'failures':
4, 5,
u'disabled': u'disabled':
2, 2,
u'errors': u'errors':
0, 0,
u'timestamp': u'timestamp':
u'*', u'*',
u'time': u'time':
u'*', u'*',
u'ad_hoc_property': u'ad_hoc_property':
u'42', u'42',
skipping to change at line 161 skipping to change at line 161
u'status': u'NOTRUN', u'status': u'NOTRUN',
u'result': u'SUPPRESSED', u'result': u'SUPPRESSED',
u'time': u'*', u'time': u'*',
u'timestamp': u'*', u'timestamp': u'*',
u'classname': u'DisabledTest' u'classname': u'DisabledTest'
}] }]
}, { }, {
u'name': u'name':
u'SkippedTest', u'SkippedTest',
u'tests': u'tests':
1, 3,
u'failures': u'failures':
0, 1,
u'disabled': u'disabled':
0, 0,
u'errors': u'errors':
0, 0,
u'time': u'time':
u'*', u'*',
u'timestamp': u'timestamp':
u'*', u'*',
u'testsuite': [{ u'testsuite': [{
u'name': u'Skipped', u'name': u'Skipped',
u'status': u'RUN', u'status': u'RUN',
u'result': u'SKIPPED', u'result': u'SKIPPED',
u'time': u'*', u'time': u'*',
u'timestamp': u'*', u'timestamp': u'*',
u'classname': u'SkippedTest' u'classname': u'SkippedTest'
}, {
u'name': u'SkippedWithMessage',
u'status': u'RUN',
u'result': u'SKIPPED',
u'time': u'*',
u'timestamp': u'*',
u'classname': u'SkippedTest'
}, {
u'name':
u'SkippedAfterFailure',
u'status':
u'RUN',
u'result':
u'COMPLETED',
u'time':
u'*',
u'timestamp':
u'*',
u'classname':
u'SkippedTest',
u'failures': [{
u'failure': u'gtest_xml_output_unittest_.cc:*\n'
u'Expected equality of these values:\n'
u' 1\n 2' + STACK_TRACE_TEMPLATE,
u'type': u''
}]
}] }]
}, { }, {
u'name': u'name':
u'MixedResultTest', u'MixedResultTest',
u'tests': u'tests':
3, 3,
u'failures': u'failures':
1, 1,
u'disabled': u'disabled':
1, 1,
skipping to change at line 589 skipping to change at line 615
u'name': u'Succeeds', u'name': u'Succeeds',
u'status': u'RUN', u'status': u'RUN',
u'result': u'COMPLETED', u'result': u'COMPLETED',
u'time': u'*', u'time': u'*',
u'timestamp': u'*', u'timestamp': u'*',
u'classname': u'SuccessfulTest', u'classname': u'SuccessfulTest',
}] }]
}], }],
} }
EXPECTED_EMPTY = { EXPECTED_NO_TEST = {
u'tests': 0, u'tests':
u'failures': 0, 0,
u'disabled': 0, u'failures':
u'errors': 0, 0,
u'time': u'*', u'disabled':
u'timestamp': u'*', 0,
u'name': u'AllTests', u'errors':
u'testsuites': [], 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) GTEST_PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath(GTEST_PROGRAM_NAME)
SUPPORTS_TYPED_TESTS = 'TypedTest' in gtest_test_utils.Subprocess( SUPPORTS_TYPED_TESTS = 'TypedTest' in gtest_test_utils.Subprocess(
[GTEST_PROGRAM_PATH, GTEST_LIST_TESTS_FLAG], capture_stderr=False).output [GTEST_PROGRAM_PATH, GTEST_LIST_TESTS_FLAG], capture_stderr=False).output
class GTestJsonOutputUnitTest(gtest_test_utils.TestCase): class GTestJsonOutputUnitTest(gtest_test_utils.TestCase):
"""Unit test for Google Test's JSON output functionality. """Unit test for Google Test's JSON output functionality.
""" """
skipping to change at line 621 skipping to change at line 691
if SUPPORTS_TYPED_TESTS: if SUPPORTS_TYPED_TESTS:
def testNonEmptyJsonOutput(self): def testNonEmptyJsonOutput(self):
"""Verifies JSON output for a Google Test binary with non-empty output. """Verifies JSON output for a Google Test binary with non-empty output.
Runs a test program that generates a non-empty JSON output, and Runs a test program that generates a non-empty JSON output, and
tests that the JSON output is expected. tests that the JSON output is expected.
""" """
self._TestJsonOutput(GTEST_PROGRAM_NAME, EXPECTED_NON_EMPTY, 1) 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. """Verifies JSON output for a Google Test binary without actual tests.
Runs a test program that generates an empty JSON output, and Runs a test program that generates an JSON output for a binary with no
tests that the JSON output is expected. 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): def testTimestampValue(self):
"""Checks whether the timestamp attribute in the JSON output is valid. """Checks whether the timestamp attribute in the JSON output is valid.
Runs a test program that generates an empty JSON output, and checks if Runs a test program that generates an empty JSON output, and checks if
the timestamp attribute in the testsuites tag is valid. the timestamp attribute in the testsuites tag is valid.
""" """
actual = self._GetJsonOutput('gtest_no_test_unittest', [], 0) actual = self._GetJsonOutput('gtest_no_test_unittest', [], 0)
date_time_str = actual['timestamp'] date_time_str = actual['timestamp']
# datetime.strptime() is only available in Python 2.5+ so we have to # datetime.strptime() is only available in Python 2.5+ so we have to
 End of changes. 9 change blocks. 
17 lines changed or deleted 87 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)