Merge pull request #17359 from yang-g/test_env

Create a class for test environment and migrate most of the tests to use it.
pull/17360/head
Yang Gao 6 years ago committed by GitHub
commit 09add58eca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      test/core/avl/avl_test.cc
  2. 2
      test/core/backoff/backoff_test.cc
  3. 2
      test/core/bad_client/tests/badreq.cc
  4. 2
      test/core/bad_client/tests/connection_prefix.cc
  5. 2
      test/core/bad_client/tests/duplicate_header.cc
  6. 2
      test/core/bad_client/tests/head_of_line_blocking.cc
  7. 2
      test/core/bad_client/tests/headers.cc
  8. 2
      test/core/bad_client/tests/initial_settings_frame.cc
  9. 2
      test/core/bad_client/tests/large_metadata.cc
  10. 2
      test/core/bad_client/tests/server_registered_method.cc
  11. 2
      test/core/bad_client/tests/simple_request.cc
  12. 2
      test/core/bad_client/tests/unknown_frame.cc
  13. 2
      test/core/bad_client/tests/window_overflow.cc
  14. 2
      test/core/channel/channel_args_test.cc
  15. 2
      test/core/channel/channel_stack_builder_test.cc
  16. 2
      test/core/channel/channel_stack_test.cc
  17. 2
      test/core/channel/channel_trace_test.cc
  18. 2
      test/core/channel/channelz_registry_test.cc
  19. 2
      test/core/channel/channelz_test.cc
  20. 2
      test/core/channel/minimal_stack_is_minimal_test.cc
  21. 2
      test/core/client_channel/parse_address_test.cc
  22. 2
      test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
  23. 2
      test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc
  24. 2
      test/core/client_channel/resolvers/dns_resolver_test.cc
  25. 2
      test/core/client_channel/resolvers/fake_resolver_test.cc
  26. 2
      test/core/client_channel/resolvers/sockaddr_resolver_test.cc
  27. 2
      test/core/client_channel/retry_throttle_test.cc
  28. 2
      test/core/client_channel/uri_parser_test.cc
  29. 2
      test/core/compression/algorithm_test.cc
  30. 2
      test/core/compression/message_compress_test.cc
  31. 2
      test/core/end2end/bad_server_response_test.cc
  32. 2
      test/core/end2end/connection_refused_test.cc
  33. 2
      test/core/end2end/dualstack_socket_test.cc
  34. 2
      test/core/end2end/fixtures/h2_census.cc
  35. 2
      test/core/end2end/fixtures/h2_compress.cc
  36. 2
      test/core/end2end/fixtures/h2_fakesec.cc
  37. 2
      test/core/end2end/fixtures/h2_fd.cc
  38. 2
      test/core/end2end/fixtures/h2_full+pipe.cc
  39. 2
      test/core/end2end/fixtures/h2_full+trace.cc
  40. 2
      test/core/end2end/fixtures/h2_full+workarounds.cc
  41. 2
      test/core/end2end/fixtures/h2_full.cc
  42. 2
      test/core/end2end/fixtures/h2_http_proxy.cc
  43. 2
      test/core/end2end/fixtures/h2_local.cc
  44. 2
      test/core/end2end/fixtures/h2_oauth2.cc
  45. 2
      test/core/end2end/fixtures/h2_proxy.cc
  46. 2
      test/core/end2end/fixtures/h2_sockpair+trace.cc
  47. 2
      test/core/end2end/fixtures/h2_sockpair.cc
  48. 2
      test/core/end2end/fixtures/h2_sockpair_1byte.cc
  49. 2
      test/core/end2end/fixtures/h2_ssl.cc
  50. 2
      test/core/end2end/fixtures/h2_ssl_proxy.cc
  51. 2
      test/core/end2end/fixtures/h2_uds.cc
  52. 2
      test/core/end2end/fixtures/inproc.cc
  53. 2
      test/core/end2end/goaway_server_test.cc
  54. 2
      test/core/end2end/h2_ssl_cert_test.cc
  55. 2
      test/core/end2end/h2_ssl_session_reuse_test.cc
  56. 2
      test/core/end2end/inproc_callback_test.cc
  57. 2
      test/core/end2end/invalid_call_argument_test.cc
  58. 2
      test/core/end2end/multiple_server_queues_test.cc
  59. 2
      test/core/end2end/no_server_test.cc
  60. 6
      test/core/fling/client.cc
  61. 2
      test/core/gpr/alloc_test.cc
  62. 2
      test/core/gpr/arena_test.cc
  63. 2
      test/core/gpr/cpu_test.cc
  64. 2
      test/core/gpr/env_test.cc
  65. 2
      test/core/gpr/host_port_test.cc
  66. 2
      test/core/gpr/log_test.cc
  67. 2
      test/core/gpr/mpscq_test.cc
  68. 2
      test/core/gpr/murmur_hash_test.cc
  69. 2
      test/core/gpr/spinlock_test.cc
  70. 2
      test/core/gpr/string_test.cc
  71. 2
      test/core/gpr/sync_test.cc
  72. 2
      test/core/gpr/time_test.cc
  73. 2
      test/core/gpr/tls_test.cc
  74. 2
      test/core/gpr/useful_test.cc
  75. 2
      test/core/gprpp/fork_test.cc
  76. 2
      test/core/gprpp/inlined_vector_test.cc
  77. 2
      test/core/gprpp/manual_constructor_test.cc
  78. 2
      test/core/gprpp/memory_test.cc
  79. 2
      test/core/gprpp/orphanable_test.cc
  80. 2
      test/core/gprpp/ref_counted_ptr_test.cc
  81. 2
      test/core/gprpp/ref_counted_test.cc
  82. 2
      test/core/gprpp/thd_test.cc
  83. 2
      test/core/http/format_request_test.cc
  84. 2
      test/core/http/httpcli_test.cc
  85. 2
      test/core/http/httpscli_test.cc
  86. 2
      test/core/http/parser_test.cc
  87. 2
      test/core/iomgr/buffer_list_test.cc
  88. 2
      test/core/iomgr/combiner_test.cc
  89. 2
      test/core/iomgr/endpoint_pair_test.cc
  90. 2
      test/core/iomgr/error_test.cc
  91. 2
      test/core/iomgr/ev_epollex_linux_test.cc
  92. 2
      test/core/iomgr/fd_conservation_posix_test.cc
  93. 2
      test/core/iomgr/fd_posix_test.cc
  94. 2
      test/core/iomgr/grpc_ipv6_loopback_available_test.cc
  95. 2
      test/core/iomgr/load_file_test.cc
  96. 2
      test/core/iomgr/resolve_address_posix_test.cc
  97. 2
      test/core/iomgr/resolve_address_test.cc
  98. 2
      test/core/iomgr/resource_quota_test.cc
  99. 2
      test/core/iomgr/sockaddr_utils_test.cc
  100. 2
      test/core/iomgr/socket_utils_test.cc
  101. Some files were not shown because too many files have changed in this diff Show More

@ -283,7 +283,7 @@ static void test_stress(int amount_of_stress) {
}
int main(int argc, char* argv[]) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test_get();
test_ll();

@ -171,7 +171,7 @@ TEST(BackOffTest, JitterBackOff) {
} // namespace grpc
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

@ -39,7 +39,7 @@ static void verifier(grpc_server* server, grpc_completion_queue* cq,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
/* invalid content type */

@ -29,7 +29,7 @@ static void verifier(grpc_server* server, grpc_completion_queue* cq,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, "X", 0);

@ -122,7 +122,7 @@ static void verifier(grpc_server* server, grpc_completion_queue* cq,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
/* Verify that sending multiple headers doesn't segfault */

@ -109,7 +109,7 @@ static void addbuf(const void* data, size_t len) {
int main(int argc, char** argv) {
int i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
#define NUM_FRAMES 10

@ -33,7 +33,7 @@ static void verifier(grpc_server* server, grpc_completion_queue* cq,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
/* partial http2 header prefixes */

@ -32,7 +32,7 @@ static void verifier(grpc_server* server, grpc_completion_queue* cq,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
/* various partial prefixes */

@ -141,7 +141,7 @@ static void server_verifier_sends_too_much_metadata(grpc_server* server,
int main(int argc, char** argv) {
int i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
// Test sending more metadata than the server will accept.
gpr_strvec headers;

@ -76,7 +76,7 @@ static void verifier_fails(grpc_server* server, grpc_completion_queue* cq,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
/* body generated with

@ -123,7 +123,7 @@ static void failure_verifier(grpc_server* server, grpc_completion_queue* cq,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
/* basic request: check that things are working */

@ -34,7 +34,7 @@ static void verifier(grpc_server* server, grpc_completion_queue* cq,
int main(int argc, char** argv) {
grpc_init();
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
/* test adding prioritization data */
GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr,

@ -71,7 +71,7 @@ int main(int argc, char** argv) {
#define FRAME_SIZE (MESSAGES_PER_FRAME * 5)
#define SEND_SIZE (4 * 1024 * 1024)
#define NUM_FRAMES (SEND_SIZE / FRAME_SIZE + 1)
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
addbuf(PFX_STR, sizeof(PFX_STR) - 1);

@ -231,7 +231,7 @@ static void test_server_create_with_args(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_create();
test_set_compression_algorithm();

@ -132,7 +132,7 @@ static void init_plugin(void) {
static void destroy_plugin(void) {}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_register_plugin(init_plugin, destroy_plugin);
grpc_init();
test_channel_stack_builder_filter_replace();

@ -147,7 +147,7 @@ static void test_create_channel_stack(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_create_channel_stack();
grpc_shutdown();

@ -342,7 +342,7 @@ TEST(ChannelTracerTest, TestTotalEviction) {
} // namespace grpc_core
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();

@ -195,7 +195,7 @@ TEST_F(ChannelzRegistryTest, TestAddAfterCompaction) {
} // namespace grpc_core
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;

@ -541,7 +541,7 @@ INSTANTIATE_TEST_CASE_P(ChannelzChannelTestSweep, ChannelzChannelTest,
} // namespace grpc_core
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();

@ -56,7 +56,7 @@ static int check_stack(const char* file, int line, const char* transport_name,
#define CHECK_STACK(...) check_stack(__FILE__, __LINE__, __VA_ARGS__)
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
int errors = 0;

@ -101,7 +101,7 @@ static void test_grpc_parse_ipv6_invalid(const char* uri_text) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_grpc_parse_unix("unix:/path/name", "/path/name");

@ -145,7 +145,7 @@ static void call_resolver_next_after_locking(grpc_core::Resolver* resolver,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
gpr_mu_init(&g_mu);

@ -262,7 +262,7 @@ static void test_cooldown() {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
g_combiner = grpc_combiner_create();

@ -60,7 +60,7 @@ static void test_fails(grpc_core::ResolverFactory* factory,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
g_combiner = grpc_combiner_create();

@ -213,7 +213,7 @@ static void test_fake_resolver() {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_fake_resolver();

@ -84,7 +84,7 @@ static void test_fails(grpc_core::ResolverFactory* factory,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
g_combiner = grpc_combiner_create();

@ -136,7 +136,7 @@ TEST(ServerRetryThrottleMap, Replacement) {
} // namespace grpc_core
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

@ -119,7 +119,7 @@ static void test_query_parts() {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_succeeds("http://www.google.com", "http", "www.google.com", "", "", "");
test_succeeds("dns:///foo", "dns", "", "/foo", "", "");

@ -105,7 +105,7 @@ static void test_algorithm_failure(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_algorithm_mesh();

@ -292,7 +292,7 @@ int main(int argc, char** argv) {
GRPC_SLICE_SPLIT_IDENTITY,
GRPC_SLICE_SPLIT_ONE_BYTE};
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
for (i = 0; i < GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT; i++) {

@ -302,7 +302,7 @@ static void run_test(const char* response_payload,
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
/* status defined in hpack static table */

@ -142,7 +142,7 @@ static void run_test(bool wait_for_ready, bool use_service_config) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
run_test(false /* wait_for_ready */, false /* use_service_config */);
run_test(true /* wait_for_ready */, false /* use_service_config */);
run_test(true /* wait_for_ready */, true /* use_service_config */);

@ -303,7 +303,7 @@ int external_dns_works(const char* host) {
int main(int argc, char** argv) {
int do_ipv6 = 1;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
if (!grpc_ipv6_loopback_available()) {

@ -118,7 +118,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -118,7 +118,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -142,7 +142,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -104,7 +104,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -105,7 +105,7 @@ int main(int argc, char** argv) {
grpc_allow_specialized_wakeup_fd = 0;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -113,7 +113,7 @@ int main(int argc, char** argv) {
g_fixture_slowdown_factor = 10;
#endif
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -114,7 +114,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -97,7 +97,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -120,7 +120,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -140,7 +140,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -224,7 +224,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -124,7 +124,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -140,7 +140,7 @@ int main(int argc, char** argv) {
g_fixture_slowdown_factor = 10;
#endif
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -126,7 +126,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -140,7 +140,7 @@ int main(int argc, char** argv) {
g_fixture_slowdown_factor = 2;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -158,7 +158,7 @@ int main(int argc, char** argv) {
size_t roots_size = strlen(test_root_cert);
char* roots_filename;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
/* Set the SSL roots env var. */

@ -199,7 +199,7 @@ int main(int argc, char** argv) {
size_t roots_size = strlen(test_root_cert);
char* roots_filename;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
/* Set the SSL roots env var. */

@ -102,7 +102,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -83,7 +83,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char** argv) {
size_t i;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();

@ -144,7 +144,7 @@ int main(int argc, char** argv) {
grpc_op ops[6];
grpc_op* op;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
gpr_mu_init(&g_mu);
grpc_init();

@ -358,7 +358,7 @@ int main(int argc, char** argv) {
size_t roots_size = strlen(test_root_cert);
char* roots_filename;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
/* Set the SSL roots env var. */
roots_file =
gpr_tmpfile("chttp2_simple_ssl_cert_fullstack_test", &roots_filename);

@ -258,7 +258,7 @@ int main(int argc, char** argv) {
size_t roots_size = strlen(test_root_cert);
char* roots_filename;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
/* Set the SSL roots env var. */
roots_file = gpr_tmpfile("chttp2_ssl_session_reuse_test", &roots_filename);
GPR_ASSERT(roots_filename != nullptr);

@ -495,7 +495,7 @@ static grpc_end2end_test_config configs[] = {
};
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
simple_request_pre_init();

@ -609,7 +609,7 @@ static void test_invalid_initial_metadata_reserved_key() {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_invalid_initial_metadata_reserved_key();
test_non_null_reserved_on_start_batch();

@ -27,7 +27,7 @@ int main(int argc, char** argv) {
grpc_server* server;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
attr.version = 1;

@ -107,7 +107,7 @@ void run_test(bool wait_for_ready) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
run_test(true /* wait_for_ready */);
run_test(false /* wait_for_ready */);
return 0;

@ -158,11 +158,11 @@ int main(int argc, char** argv) {
gpr_timers_set_log_filename("latency_trace.fling_client.txt");
grpc_init();
GPR_ASSERT(argc >= 1);
fake_argv[0] = argv[0];
grpc_test_init(1, fake_argv);
grpc::testing::TestEnvironment env(1, fake_argv);
grpc_init();
int warmup_seconds = 1;
int benchmark_seconds = 5;

@ -64,7 +64,7 @@ static void test_malloc_aligned() {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test_custom_allocs();
test_malloc_aligned();
return 0;

@ -116,7 +116,7 @@ static void concurrent_test(void) {
}
int main(int argc, char* argv[]) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test_noop();
TEST(0_1, 0, 1);

@ -144,7 +144,7 @@ static void cpu_test(void) {
}
int main(int argc, char* argv[]) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
cpu_test();
return 0;
}

@ -43,7 +43,7 @@ static void test_setenv_getenv(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test_setenv_getenv();
return 0;
}

@ -50,7 +50,7 @@ static void test_join_host_port_garbage(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test_join_host_port();
test_join_host_port_garbage();

@ -53,7 +53,7 @@ static void test_should_not_log(gpr_log_func_args* args) { GPR_ASSERT(false); }
gpr_log(SEVERITY, "hello %d %d %d", 1, 2, 3);
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
/* test logging at various verbosity levels */
gpr_log(GPR_DEBUG, "%s", "hello world");
gpr_log(GPR_INFO, "%s", "hello world");

@ -182,7 +182,7 @@ static void test_mt_multipop(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test_serial();
test_mt();
test_mt_multipop();

@ -64,7 +64,7 @@ static void verification_test(hash_func hash, uint32_t expected) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
/* basic tests to verify that things don't crash */
gpr_murmur_hash3("", 0, 0);
gpr_murmur_hash3("xyz", 3, 0);

@ -149,7 +149,7 @@ static void inctry(void* v /*=m*/) {
/* ------------------------------------------------- */
int main(int argc, char* argv[]) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test("spinlock", &inc, 1, 1);
test("spinlock try", &inctry, 1, 1);
return 0;

@ -295,7 +295,7 @@ static void test_is_true(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test_strdup();
test_dump();
test_parse_uint32();

@ -458,7 +458,7 @@ static void refcheck(void* v /*=m*/) {
/* ------------------------------------------------- */
int main(int argc, char* argv[]) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test("mutex", &inc, nullptr, 1, 1);
test("mutex try", &inctry, nullptr, 1, 1);
test("cv", &inc_by_turns, nullptr, 1, 1);

@ -254,7 +254,7 @@ static void test_cmp_extreme(void) {
}
int main(int argc, char* argv[]) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test_values();
test_add_sub();

@ -50,7 +50,7 @@ static void thd_body(void* arg) {
int main(int argc, char* argv[]) {
grpc_core::Thread threads[NUM_THREADS];
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
gpr_tls_init(&test_var);

@ -26,7 +26,7 @@ int main(int argc, char** argv) {
int four[4];
int five[5];
uint32_t bitset = 0;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
GPR_ASSERT(GPR_MIN(1, 2) == 1);
GPR_ASSERT(GPR_MAX(1, 2) == 2);

@ -130,7 +130,7 @@ static void test_exec_count() {
}
int main(int argc, char* argv[]) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test_init();
test_thd_count();
test_exec_count();

@ -454,7 +454,7 @@ TEST(InlinedVectorTest, PopBackAllocated) {
} // namespace grpc_core
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

@ -92,7 +92,7 @@ static void complex_test() {
/* ------------------------------------------------- */
int main(int argc, char* argv[]) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
basic_test();
complex_test();
return 0;

@ -68,7 +68,7 @@ TEST(MemoryTest, UniquePtrWithCustomDeleter) {
} // namespace grpc_core
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

@ -114,7 +114,7 @@ TEST(OrphanablePtr, InternallyRefCountedWithTracing) {
} // namespace grpc_core
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

@ -241,7 +241,7 @@ TEST(RefCountedPtr, CanPassSubclassToFunctionExpectingSubclass) {
} // namespace grpc_core
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

@ -116,7 +116,7 @@ TEST(RefCountedNonPolymorphicWithTracing, Basic) {
} // namespace grpc_core
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

@ -92,7 +92,7 @@ static void test2(void) {
/* ------------------------------------------------- */
int main(int argc, char* argv[]) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test1();
test2();
return 0;

@ -138,7 +138,7 @@ static void test_format_post_request_content_type_override(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_format_get_request();

@ -145,7 +145,7 @@ static void destroy_pops(void* p, grpc_error* error) {
int main(int argc, char** argv) {
gpr_subprocess* server;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
{
grpc_closure destroyed;

@ -201,7 +201,7 @@ int main(int argc, char** argv) {
gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_seconds(5, GPR_TIMESPAN)));
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
grpc_httpcli_context_init(&g_context);
grpc_pollset* pollset =

@ -218,7 +218,7 @@ int main(int argc, char** argv) {
GRPC_SLICE_SPLIT_ONE_BYTE};
char *tmp1, *tmp2;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
for (i = 0; i < GPR_ARRAY_SIZE(split_modes); i++) {

@ -97,7 +97,7 @@ static void TestTcpBufferList() {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
TestTcpBufferList();
grpc_shutdown();

@ -144,7 +144,7 @@ static void test_execute_finally(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_no_op();
test_execute_one();

@ -60,7 +60,7 @@ static void destroy_pollset(void* p, grpc_error* error) {
int main(int argc, char** argv) {
grpc_closure destroyed;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
{
grpc_core::ExecCtx exec_ctx;

@ -215,7 +215,7 @@ static void test_overflow() {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_set_get_int();
test_set_get_str();

@ -92,7 +92,7 @@ static void test_pollable_owner_fd() {
int main(int argc, char** argv) {
const char* poll_strategy = nullptr;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
{
grpc_core::ExecCtx exec_ctx;

@ -29,7 +29,7 @@ int main(int argc, char** argv) {
struct rlimit rlim;
grpc_endpoint_pair p;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
{
grpc_core::ExecCtx exec_ctx;

@ -515,7 +515,7 @@ static void destroy_pollset(void* p, grpc_error* error) {
int main(int argc, char** argv) {
grpc_closure destroyed;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
{
grpc_core::ExecCtx exec_ctx;

@ -32,7 +32,7 @@
#endif
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
// This test assumes that the ipv6 loopback is available
// in all environments in which grpc tests run in.

@ -152,7 +152,7 @@ static void test_load_big_file(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_load_empty_file();
test_load_failure();

@ -158,7 +158,7 @@ static void test_unix_socket_path_name_too_long(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
{

@ -271,7 +271,7 @@ int main(int argc, char** argv) {
abort();
}
// Run the test.
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
{
grpc_core::ExecCtx exec_ctx;

@ -891,7 +891,7 @@ static void test_thread_maxquota_change() {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
gpr_mu_init(&g_mu);
gpr_cv_init(&g_cv);

@ -270,7 +270,7 @@ static void test_sockaddr_set_get_port(void) {
}
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
test_sockaddr_is_v4mapped();
test_sockaddr_to_v4mapped();

@ -80,7 +80,7 @@ static const grpc_socket_mutator_vtable mutator_vtable = {
int main(int argc, char** argv) {
int sock;
grpc_error* err;
grpc_test_init(argc, argv);
grpc::testing::TestEnvironment env(argc, argv);
sock = socket(PF_INET, SOCK_STREAM, 0);
GPR_ASSERT(sock > 0);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save