svn commit: r345756 - projects/capsicum-test/contrib/googletest/googletest/src
Enji Cooper
ngie at FreeBSD.org
Sun Mar 31 17:27:30 UTC 2019
Author: ngie
Date: Sun Mar 31 17:27:28 2019
New Revision: 345756
URL: https://svnweb.freebsd.org/changeset/base/345756
Log:
Import the missing hunk from r345740
This makes the proof-of-concept actually work.
Modified:
projects/capsicum-test/contrib/googletest/googletest/src/gtest.cc
Modified: projects/capsicum-test/contrib/googletest/googletest/src/gtest.cc
==============================================================================
--- projects/capsicum-test/contrib/googletest/googletest/src/gtest.cc Sun Mar 31 16:56:36 2019 (r345755)
+++ projects/capsicum-test/contrib/googletest/googletest/src/gtest.cc Sun Mar 31 17:27:28 2019 (r345756)
@@ -5243,9 +5243,23 @@ bool UnitTestImpl::RunAllTests() {
ForEach(environments_, SetUpEnvironment);
repeater->OnEnvironmentsSetUpEnd(*parent_);
- // Runs the tests only if there was no fatal failure during global
- // set-up.
- if (!Test::HasFatalFailure()) {
+ // Runs the tests only if there was no fatal failure or skip triggered
+ // during global set-up.
+ if (Test::IsSkipped()) {
+ // Emit diagnostics when global set-up calls skip, as it will not be
+ // emitted by default.
+ TestResult& test_result =
+ *internal::GetUnitTestImpl()->current_test_result();
+ for (int j = 0; j < test_result.total_part_count(); ++j) {
+ const TestPartResult& test_part_result =
+ test_result.GetTestPartResult(j);
+ if (test_part_result.type() == TestPartResult::kSkip) {
+ const std::string& result = test_part_result.message();
+ printf("%s\n", result.c_str());
+ }
+ }
+ fflush(stdout);
+ } else if (!Test::HasFatalFailure()) {
for (int test_index = 0; test_index < total_test_case_count();
test_index++) {
GetMutableTestCase(test_index)->Run();
More information about the svn-src-projects
mailing list