diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 9a3113548e..f063a60e9d 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -5342,14 +5342,14 @@ void UnitTest::AddTestPartResult(TestPartResult::Type result_type, result); if (result_type != TestPartResult::kSuccess && - result_type != TestPartResult::kSkip && - result_type != TestPartResult::kNonFatalFailure) { + result_type != TestPartResult::kSkip) { // gtest_break_on_failure takes precedence over // gtest_throw_on_failure. This allows a user to set the latter // in the code (perhaps in order to use Google Test assertions // with another testing framework) and specify the former on the // command line for debugging. - if (GTEST_FLAG_GET(break_on_failure)) { + if (GTEST_FLAG_GET(break_on_failure) && + result_type != TestPartResult::kNonFatalFailure) { #if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_PHONE) && \ !defined(GTEST_OS_WINDOWS_RT) // Using DebugBreak on Windows allows gtest to still break into a debugger diff --git a/googletest/test/googletest-throw-on-failure-test_.cc b/googletest/test/googletest-throw-on-failure-test_.cc index 3b81a5a1db..f388df6c5f 100644 --- a/googletest/test/googletest-throw-on-failure-test_.cc +++ b/googletest/test/googletest-throw-on-failure-test_.cc @@ -54,6 +54,7 @@ int main(int argc, char** argv) { std::set_terminate(&TerminateHandler); #endif testing::InitGoogleTest(&argc, argv); + GTEST_FLAG_SET(throw_on_failure, true); // We want to ensure that people can use Google Test assertions in // other testing frameworks, as long as they initialize Google Test