From f2374fb591b77747a9a5fbcf3ae6d3dc3491f864 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Wed, 29 Jul 2020 17:17:12 -0700 Subject: [PATCH] Add TestEnvironment to tests --- test/cpp/codegen/codegen_test_full.cc | 3 +++ test/cpp/codegen/codegen_test_minimal.cc | 3 +++ test/cpp/end2end/server_load_reporting_end2end_test.cc | 2 ++ test/cpp/qps/secure_sync_unary_ping_pong_test.cc | 3 ++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/cpp/codegen/codegen_test_full.cc b/test/cpp/codegen/codegen_test_full.cc index ccd310fc226..a61e24baa7c 100644 --- a/test/cpp/codegen/codegen_test_full.cc +++ b/test/cpp/codegen/codegen_test_full.cc @@ -20,6 +20,8 @@ #include #include +#include "test/core/util/test_config.h" + namespace grpc { namespace { @@ -37,6 +39,7 @@ TEST_F(CodegenTestFull, Init) { } // namespace grpc int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(argc, argv); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/cpp/codegen/codegen_test_minimal.cc b/test/cpp/codegen/codegen_test_minimal.cc index d317ea31164..60457308079 100644 --- a/test/cpp/codegen/codegen_test_minimal.cc +++ b/test/cpp/codegen/codegen_test_minimal.cc @@ -18,6 +18,8 @@ #include +#include "test/core/util/test_config.h" + namespace grpc { namespace { @@ -29,6 +31,7 @@ TEST_F(CodegenTestMinimal, Build) {} } // namespace grpc int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(argc, argv); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/cpp/end2end/server_load_reporting_end2end_test.cc b/test/cpp/end2end/server_load_reporting_end2end_test.cc index 111fd0c26f5..fa68fc1a623 100644 --- a/test/cpp/end2end/server_load_reporting_end2end_test.cc +++ b/test/cpp/end2end/server_load_reporting_end2end_test.cc @@ -33,6 +33,7 @@ #include "src/proto/grpc/lb/v1/load_reporter.grpc.pb.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" #include "test/core/util/port.h" +#include "test/core/util/test_config.h" namespace grpc { namespace testing { @@ -185,6 +186,7 @@ TEST_F(ServerLoadReportingEnd2endTest, BasicReport) { } // namespace grpc int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(argc, argv); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/cpp/qps/secure_sync_unary_ping_pong_test.cc b/test/cpp/qps/secure_sync_unary_ping_pong_test.cc index 422bd617ebc..d4c283c7237 100644 --- a/test/cpp/qps/secure_sync_unary_ping_pong_test.cc +++ b/test/cpp/qps/secure_sync_unary_ping_pong_test.cc @@ -20,6 +20,7 @@ #include +#include "test/core/util/test_config.h" #include "test/cpp/qps/benchmark_config.h" #include "test/cpp/qps/driver.h" #include "test/cpp/qps/report.h" @@ -65,9 +66,9 @@ static void RunSynchronousUnaryPingPong() { } // namespace grpc int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(argc, argv); grpc::testing::InitTest(&argc, &argv, true); grpc::testing::RunSynchronousUnaryPingPong(); - return 0; }