Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Mar 2019 17:27:29 +0000 (UTC)
From:      Enji Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r345756 - projects/capsicum-test/contrib/googletest/googletest/src
Message-ID:  <201903311727.x2VHRTum087609@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903311727.x2VHRTum087609>