diff --git a/googletest/test/googletest-json-output-unittest.py b/googletest/test/googletest-json-output-unittest.py index 15861f75cb..036b5b13ed 100644 --- a/googletest/test/googletest-json-output-unittest.py +++ b/googletest/test/googletest-json-output-unittest.py @@ -58,9 +58,9 @@ EXPECTED_NON_EMPTY = { u'tests': - 24, + 26, u'failures': - 4, + 5, u'disabled': 2, u'errors': @@ -158,9 +158,9 @@ u'name': u'SkippedTest', u'tests': - 1, + 3, u'failures': - 0, + 1, u'disabled': 0, u'errors': @@ -176,6 +176,26 @@ u'time': u'*', u'timestamp': u'*', 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': diff --git a/googletest/test/gtest_xml_outfiles_test.py b/googletest/test/gtest_xml_outfiles_test.py index e093f6f05e..ac66feb667 100755 --- a/googletest/test/gtest_xml_outfiles_test.py +++ b/googletest/test/gtest_xml_outfiles_test.py @@ -42,7 +42,7 @@ EXPECTED_XML_1 = """ - + @@ -56,7 +56,7 @@ EXPECTED_XML_2 = """ - + diff --git a/googletest/test/gtest_xml_output_unittest.py b/googletest/test/gtest_xml_output_unittest.py index 63b1af0b6c..32b6fdf272 100755 --- a/googletest/test/gtest_xml_output_unittest.py +++ b/googletest/test/gtest_xml_output_unittest.py @@ -65,11 +65,11 @@ sys.argv.remove(NO_STACKTRACE_SUPPORT_FLAG) EXPECTED_NON_EMPTY_XML = """ - - + + - + - + - + ]]>%(stack)s]]> - + - + - - + + + + + + + + + + + + - + @@ -135,7 +151,7 @@ - + @@ -152,22 +168,22 @@ - + - + - + - + - + """ % { @@ -177,7 +193,7 @@ EXPECTED_FILTERED_TEST_XML = """ - @@ -185,18 +201,18 @@ EXPECTED_SHARDED_TEST_XML = """ - + - - + + - + - - + + """ diff --git a/googletest/test/gtest_xml_output_unittest_.cc b/googletest/test/gtest_xml_output_unittest_.cc index c95fd66cfa..2b6634b5c6 100644 --- a/googletest/test/gtest_xml_output_unittest_.cc +++ b/googletest/test/gtest_xml_output_unittest_.cc @@ -74,6 +74,15 @@ TEST_F(SkippedTest, Skipped) { GTEST_SKIP(); } +TEST_F(SkippedTest, SkippedWithMessage) { + GTEST_SKIP() << "It is good practice to tell why you skip a test."; +} + +TEST_F(SkippedTest, SkippedAfterFailure) { + EXPECT_EQ(1, 2); + GTEST_SKIP() << "It is good practice to tell why you skip a test."; +} + TEST(MixedResultTest, Succeeds) { EXPECT_EQ(1, 1); ASSERT_EQ(1, 1); diff --git a/googletest/test/gtest_xml_test_utils.py b/googletest/test/gtest_xml_test_utils.py index 9914a49ec1..cae0bc0b9a 100755 --- a/googletest/test/gtest_xml_test_utils.py +++ b/googletest/test/gtest_xml_test_utils.py @@ -105,6 +105,7 @@ def AssertEquivalentNodes(self, expected_node, actual_node): 'testsuite': 'name', 'testcase': 'name', 'failure': 'message', + 'skipped': 'message', 'property': 'name', } @@ -179,7 +180,7 @@ def NormalizeXml(self, element): type_param = element.getAttributeNode('type_param') if type_param and type_param.value: type_param.value = '*' - elif element.tagName == 'failure': + elif element.tagName == 'failure' or element.tagName == 'skipped': source_line_pat = r'^.*[/\\](.*:)\d+\n' # Replaces the source line information with a normalized form. message = element.getAttributeNode('message')