Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4294] --gtest_break_on_failure conflicts with EXPECT_NONFATAL_FAILURE. #4406

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion googletest/src/gtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5348,7 +5348,8 @@ void UnitTest::AddTestPartResult(TestPartResult::Type result_type,
// 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
Expand Down
1 change: 1 addition & 0 deletions googletest/test/googletest-throw-on-failure-test_.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down