stack_tracer_test.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2020 the gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
20 
21 #include <string>
22 
23 #include <gtest/gtest.h>
24 
25 #include "absl/debugging/symbolize.h"
26 #include "absl/strings/match.h"
27 
28 #include <grpc/support/log.h>
29 
31 
32 TEST(StackTracerTest, Basic) {
34  gpr_log(GPR_INFO, "stack_trace=%s", stack_trace.c_str());
35 #if !defined(NDEBUG) && !defined(GPR_MUSL_LIBC_COMPAT)
36  EXPECT_TRUE(absl::StrContains(stack_trace, "Basic"));
37 #endif
38 }
39 
40 int main(int argc, char** argv) {
42  testing::InitGoogleTest(&argc, argv);
43  int ret = RUN_ALL_TESTS();
44  return ret;
45 }
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
log.h
generate.env
env
Definition: generate.py:37
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
TEST
TEST(StackTracerTest, Basic)
Definition: stack_tracer_test.cc:32
stack_tracer.h
main
int main(int argc, char **argv)
Definition: stack_tracer_test.cc:40
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
absl::StrContains
ABSL_NAMESPACE_BEGIN bool StrContains(absl::string_view haystack, absl::string_view needle) noexcept
Definition: third_party/abseil-cpp/absl/strings/match.h:46
RUN_ALL_TESTS
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2471
test_config.h
testing::InitGoogleTest
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition: bloaty/third_party/googletest/googletest/src/gtest.cc:6106
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
grpc::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
grpc_core::testing::GetCurrentStackTrace
std::string GetCurrentStackTrace()
Definition: stack_tracer.cc:93
EXPECT_TRUE
#define EXPECT_TRUE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1967


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:21