Added call to grpc::testing::TestEnvironment in tests

pull/23378/head
Esun Kim 5 years ago
parent 344f2de117
commit 62ac3f075a
  1. 3
      test/core/debug/stats_test.cc
  2. 3
      test/core/handshake/client_ssl.cc
  3. 3
      test/core/handshake/server_ssl.cc
  4. 1
      test/core/security/tls_security_connector_test.cc
  5. 1
      test/core/util/test_config.cc
  6. 3
      test/cpp/grpclb/grpclb_api_test.cc
  7. 1
      test/cpp/microbenchmarks/bm_alarm.cc
  8. 4
      test/cpp/microbenchmarks/bm_byte_buffer.cc
  9. 2
      test/cpp/microbenchmarks/bm_channel.cc
  10. 2
      test/cpp/microbenchmarks/bm_chttp2_hpack.cc
  11. 2
      test/cpp/microbenchmarks/bm_chttp2_transport.cc
  12. 2
      test/cpp/microbenchmarks/bm_metadata.cc
  13. 6
      test/cpp/microbenchmarks/bm_timer.cc

@ -26,6 +26,8 @@
#include <grpc/support/log.h>
#include <gtest/gtest.h>
#include "test/core/util/test_config.h"
namespace grpc {
namespace testing {
@ -146,6 +148,7 @@ int main(int argc, char** argv) {
* build.
*/
#if defined(GRPC_COLLECT_STATS) || !defined(NDEBUG)
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();

@ -309,7 +309,8 @@ static bool client_ssl_test(char* server_alpn_preferred) {
return success;
}
int main(int /*argc*/, char* /*argv*/[]) {
int main(int argc, char* argv[]) {
grpc::testing::TestEnvironment env(argc, argv);
// Handshake succeeeds when the server has grpc-exp as the ALPN preference.
GPR_ASSERT(client_ssl_test(const_cast<char*>("grpc-exp")));
// Handshake succeeeds when the server has h2 as the ALPN preference. This

@ -36,7 +36,8 @@
#include "test/core/handshake/server_ssl_common.h"
int main(int /*argc*/, char* /*argv*/[]) {
int main(int argc, char* argv[]) {
grpc::testing::TestEnvironment env(argc, argv);
// Handshake succeeeds when the client supplies the standard ALPN list.
const char* full_alpn_list[] = {"grpc-exp", "h2"};
GPR_ASSERT(server_ssl_test(full_alpn_list, 2, "grpc-exp"));

@ -326,6 +326,7 @@ TEST_F(TlsSecurityConnectorTest, CreateServerSecurityConnectorFailInit) {
} // namespace grpc
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();

@ -413,6 +413,7 @@ TestEnvironment::~TestEnvironment() {
break;
}
}
gpr_log(GPR_INFO, "TestEnvironment ends");
}
} // namespace testing

@ -28,6 +28,8 @@
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/proto/grpc/lb/v1/load_balancer.pb.h" // C++ version
#include "test/core/util/test_config.h"
namespace grpc {
namespace {
@ -135,6 +137,7 @@ TEST_F(GrpclbTest, ParseResponseServerList) {
} // namespace grpc
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;

@ -55,6 +55,7 @@ void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); }
} // namespace benchmark
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
LibraryInitializer libInit;
::benchmark::Initialize(&argc, argv);
::grpc::testing::InitTest(&argc, &argv, false);

@ -23,6 +23,8 @@
#include <benchmark/benchmark.h>
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/byte_buffer.h>
#include "test/core/util/test_config.h"
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
@ -122,9 +124,11 @@ void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); }
} // namespace benchmark
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
LibraryInitializer libInit;
::benchmark::Initialize(&argc, argv);
::grpc::testing::InitTest(&argc, &argv, false);
benchmark::RunTheBenchmarksNamespaced();
return 0;
}

@ -20,6 +20,7 @@
#include <benchmark/benchmark.h>
#include <grpc/grpc.h>
#include "test/core/util/test_config.h"
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
@ -81,6 +82,7 @@ void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); }
} // namespace benchmark
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
LibraryInitializer libInit;
::benchmark::Initialize(&argc, argv);
::grpc::testing::InitTest(&argc, &argv, false);

@ -33,6 +33,7 @@
#include "src/core/lib/transport/static_metadata.h"
#include "src/core/lib/transport/timeout_encoding.h"
#include "test/core/util/test_config.h"
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
@ -937,6 +938,7 @@ void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); }
} // namespace benchmark
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
LibraryInitializer libInit;
::benchmark::Initialize(&argc, argv);
::grpc::testing::InitTest(&argc, &argv, false);

@ -33,6 +33,7 @@
#include "src/core/lib/iomgr/resource_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/transport/static_metadata.h"
#include "test/core/util/test_config.h"
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
@ -684,6 +685,7 @@ void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); }
} // namespace benchmark
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
LibraryInitializer libInit;
::benchmark::Initialize(&argc, argv);
::grpc::testing::InitTest(&argc, &argv, false);

@ -25,6 +25,7 @@
#include "src/core/lib/transport/metadata.h"
#include "src/core/lib/transport/static_metadata.h"
#include "test/core/util/test_config.h"
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
@ -295,6 +296,7 @@ void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); }
} // namespace benchmark
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
LibraryInitializer libInit;
::benchmark::Initialize(&argc, argv);
::grpc::testing::InitTest(&argc, &argv, false);

@ -24,10 +24,11 @@
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
#include "src/core/lib/iomgr/timer.h"
#include "test/core/util/test_config.h"
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
namespace grpc {
namespace testing {
@ -109,6 +110,7 @@ void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); }
} // namespace benchmark
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
LibraryInitializer libInit;
::benchmark::Initialize(&argc, argv);
::grpc::testing::InitTest(&argc, &argv, false);

Loading…
Cancel
Save