Skip to content

Commit

Permalink
deps: update googletest to 4565741
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
nodejs-github-bot authored and targos committed May 21, 2024
1 parent edc3e5d commit 42070ca
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions deps/googletest/src/gtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,19 @@ static bool ShouldRunTestSuite(const TestSuite* test_suite) {
return test_suite->should_run();
}

namespace {

// Returns true if test part results of type `type` should include a stack
// trace.
bool ShouldEmitStackTraceForResultType(TestPartResult::Type type) {
// Suppress emission of the stack trace for SUCCEED() since it likely never
// requires investigation, and GTEST_SKIP() since skipping is an intentional
// act by the developer rather than a failure requiring investigation.
return type != TestPartResult::kSuccess && type != TestPartResult::kSkip;
}

} // namespace

// AssertHelper constructor.
AssertHelper::AssertHelper(TestPartResult::Type type, const char* file,
int line, const char* message)
Expand All @@ -463,10 +476,7 @@ void AssertHelper::operator=(const Message& message) const {
UnitTest::GetInstance()->AddTestPartResult(
data_->type, data_->file, data_->line,
AppendUserMessage(data_->message, message),
// Suppress emission of the stack trace for GTEST_SKIP() since skipping is
// an intentional act by the developer rather than a failure requiring
// investigation.
data_->type != TestPartResult::kSkip
ShouldEmitStackTraceForResultType(data_->type)
? UnitTest::GetInstance()->impl()->CurrentOsStackTraceExceptTop(1)
: ""
// Skips the stack frame for this function itself.
Expand Down

0 comments on commit 42070ca

Please sign in to comment.