diff options
-rw-r--r-- | googletest/src/gtest.cc | 7 | ||||
-rw-r--r-- | googletest/test/googletest-output-test-golden-lin.txt | 1 | ||||
-rwxr-xr-x | googletest/test/gtest_xml_output_unittest.py | 15 |
3 files changed, 15 insertions, 8 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 479b2ee3..46212e74 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -459,7 +459,12 @@ void AssertHelper::operator=(const Message& message) const { UnitTest::GetInstance()->AddTestPartResult( data_->type, data_->file, data_->line, AppendUserMessage(data_->message, message), - UnitTest::GetInstance()->impl()->CurrentOsStackTraceExceptTop(1) + // Suppress emission of the stack trace for GTEST_SKIP() since skipping is + // an intentional act by the developer rather than a failure requiring + // investigation. + data_->type != TestPartResult::kSkip + ? UnitTest::GetInstance()->impl()->CurrentOsStackTraceExceptTop(1) + : "" // Skips the stack frame for this function itself. ); // NOLINT } diff --git a/googletest/test/googletest-output-test-golden-lin.txt b/googletest/test/googletest-output-test-golden-lin.txt index 6ddf822f..e06856a2 100644 --- a/googletest/test/googletest-output-test-golden-lin.txt +++ b/googletest/test/googletest-output-test-golden-lin.txt @@ -970,7 +970,6 @@ googletest-output-test_.cc:#: Skipped [0;32m[----------] [m1 test from TestSuiteThatSkipsInSetUp googletest-output-test_.cc:#: Skipped Skip entire test suite -Stack trace: (omitted) [0;32m[ RUN ] [mTestSuiteThatSkipsInSetUp.ShouldNotRun googletest-output-test_.cc:#: Skipped diff --git a/googletest/test/gtest_xml_output_unittest.py b/googletest/test/gtest_xml_output_unittest.py index 422569e4..c3fea2c0 100755 --- a/googletest/test/gtest_xml_output_unittest.py +++ b/googletest/test/gtest_xml_output_unittest.py @@ -112,20 +112,23 @@ Invalid characters in brackets []%(stack)s]]></failure> </testsuite> <testsuite name="SkippedTest" tests="3" failures="1" disabled="0" skipped="2" errors="0" time="*" timestamp="*"> <testcase name="Skipped" status="run" file="gtest_xml_output_unittest_.cc" line="75" result="skipped" time="*" timestamp="*" classname="SkippedTest"> - <skipped message="gtest_xml_output_unittest_.cc:*
%(stack_entity)s"><![CDATA[gtest_xml_output_unittest_.cc:* -%(stack)s]]></skipped> + <skipped message="gtest_xml_output_unittest_.cc:*

"><![CDATA[gtest_xml_output_unittest_.cc:* + +]]></skipped> </testcase> <testcase name="SkippedWithMessage" file="gtest_xml_output_unittest_.cc" line="79" status="run" result="skipped" time="*" timestamp="*" classname="SkippedTest"> - <skipped message="gtest_xml_output_unittest_.cc:*
It is good practice to tell why you skip a test.%(stack_entity)s"><![CDATA[gtest_xml_output_unittest_.cc:* -It is good practice to tell why you skip a test.%(stack)s]]></skipped> + <skipped message="gtest_xml_output_unittest_.cc:*
It is good practice to tell why you skip a test.
"><![CDATA[gtest_xml_output_unittest_.cc:* +It is good practice to tell why you skip a test. +]]></skipped> </testcase> <testcase name="SkippedAfterFailure" file="gtest_xml_output_unittest_.cc" line="83" status="run" result="completed" time="*" timestamp="*" classname="SkippedTest"> <failure message="gtest_xml_output_unittest_.cc:*
Expected equality of these values:
 1
 2%(stack_entity)s" type=""><![CDATA[gtest_xml_output_unittest_.cc:* Expected equality of these values: 1 2%(stack)s]]></failure> - <skipped message="gtest_xml_output_unittest_.cc:*
It is good practice to tell why you skip a test.%(stack_entity)s"><![CDATA[gtest_xml_output_unittest_.cc:* -It is good practice to tell why you skip a test.%(stack)s]]></skipped> + <skipped message="gtest_xml_output_unittest_.cc:*
It is good practice to tell why you skip a test.
"><![CDATA[gtest_xml_output_unittest_.cc:* +It is good practice to tell why you skip a test. +]]></skipped> </testcase> </testsuite> |