Skip to content

Commit 3b60dbc

Browse files
nodejs-github-bottargos
authored andcommitted
deps: update googletest to 4565741
PR-URL: #51657 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 5d3ee72 commit 3b60dbc

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

deps/googletest/src/gtest.cc

+14-4
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,19 @@ static bool ShouldRunTestSuite(const TestSuite* test_suite) {
451451
return test_suite->should_run();
452452
}
453453

454+
namespace {
455+
456+
// Returns true if test part results of type `type` should include a stack
457+
// trace.
458+
bool ShouldEmitStackTraceForResultType(TestPartResult::Type type) {
459+
// Suppress emission of the stack trace for SUCCEED() since it likely never
460+
// requires investigation, and GTEST_SKIP() since skipping is an intentional
461+
// act by the developer rather than a failure requiring investigation.
462+
return type != TestPartResult::kSuccess && type != TestPartResult::kSkip;
463+
}
464+
465+
} // namespace
466+
454467
// AssertHelper constructor.
455468
AssertHelper::AssertHelper(TestPartResult::Type type, const char* file,
456469
int line, const char* message)
@@ -463,10 +476,7 @@ void AssertHelper::operator=(const Message& message) const {
463476
UnitTest::GetInstance()->AddTestPartResult(
464477
data_->type, data_->file, data_->line,
465478
AppendUserMessage(data_->message, message),
466-
// Suppress emission of the stack trace for GTEST_SKIP() since skipping is
467-
// an intentional act by the developer rather than a failure requiring
468-
// investigation.
469-
data_->type != TestPartResult::kSkip
479+
ShouldEmitStackTraceForResultType(data_->type)
470480
? UnitTest::GetInstance()->impl()->CurrentOsStackTraceExceptTop(1)
471481
: ""
472482
// Skips the stack frame for this function itself.

0 commit comments

Comments
 (0)