summaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authorGennadiy Civil <misterg@google.com>2019-04-03 17:15:16 -0400
committerGennadiy Civil <misterg@google.com>2019-04-03 17:15:16 -0400
commit1f3b098ef3afb1d186778d47ccecf9d188ef49b2 (patch)
treec21dcf94a8d23a214e8e0c520b54e2ca3815487e /googletest/src
parentc9e0aed90b5c90cf3f88413da1ef07d925f025e1 (diff)
parent67c75ff8baf4228e857c09d3aaacd3f1ddf53a8f (diff)
downloadgoogletest-1f3b098ef3afb1d186778d47ccecf9d188ef49b2.tar.gz
googletest-1f3b098ef3afb1d186778d47ccecf9d188ef49b2.zip
Merge pull request #2203 from ngie-eign:issue-2189
PiperOrigin-RevId: 241803437
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 37cedfb3..d4d3d035 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -5254,9 +5254,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_suite_count();
test_index++) {
GetMutableSuiteCase(test_index)->Run();
OpenPOWER on IntegriCloud