[gprpp] Better test for examine_stack (#32897)

In order to help https://github.com/grpc/grpc/pull/32748, change the
test so that it tells us what the problem is in the logs.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
pull/32903/head
Craig Tiller 2 years ago committed by GitHub
parent 5cae7abd31
commit 5da7cbb2c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      test/core/gprpp/examine_stack_test.cc

@ -20,6 +20,7 @@
#include "absl/debugging/stacktrace.h"
#include "absl/debugging/symbolize.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <grpc/support/log.h>
@ -68,7 +69,7 @@ TEST(ExamineStackTest, AbseilStackProvider) {
EXPECT_NE(stack_trace, absl::nullopt);
gpr_log(GPR_INFO, "stack_trace=%s", stack_trace->c_str());
#if !defined(NDEBUG) && !defined(GPR_MUSL_LIBC_COMPAT)
EXPECT_TRUE(stack_trace->find("GetCurrentStackTrace") != std::string::npos);
EXPECT_THAT(*stack_trace, ::testing::HasSubstr("GetCurrentStackTrace"));
#endif
}

Loading…
Cancel
Save