From cb3ac04e2b096eb447b3ec2ba58ae175c91da542 Mon Sep 17 00:00:00 2001 From: Joshua Marantz Date: Mon, 4 Feb 2019 00:08:31 -0500 Subject: [PATCH] test: add a common test base class (#5811) Signed-off-by: Joshua Marantz --- bazel/envoy_build_system.bzl | 1 + .../access_log/access_log_formatter_test.cc | 2 +- .../common/access_log/access_log_impl_test.cc | 4 ++-- .../access_log_manager_impl_test.cc | 2 +- test/common/buffer/buffer_test.cc | 3 +-- test/common/buffer/owned_impl_test.cc | 4 ++-- test/common/buffer/utility.h | 2 +- test/common/buffer/watermark_buffer_test.cc | 4 ++-- .../buffer/zero_copy_input_stream_test.cc | 4 ++-- test/common/common/assert_test.cc | 3 +-- test/common/common/backoff_strategy_test.cc | 3 +-- test/common/common/base64_test.cc | 3 +-- .../common/block_memory_hash_set_test.cc | 5 +++-- test/common/common/callback_impl_test.cc | 4 +++- test/common/common/cleanup_test.cc | 2 +- test/common/common/fmt_test.cc | 3 ++- test/common/common/hash_test.cc | 2 +- test/common/common/hex_test.cc | 2 +- test/common/common/lock_guard_test.cc | 4 ++-- test/common/common/log_macros_test.cc | 2 +- test/common/common/matchers_test.cc | 2 +- test/common/common/mutex_tracer_test.cc | 4 ++-- .../common/perf_annotation_disabled_test.cc | 2 +- test/common/common/perf_annotation_test.cc | 4 ++-- test/common/common/phantom_test.cc | 2 +- test/common/common/stack_array_test.cc | 3 ++- test/common/common/to_lower_table_test.cc | 2 +- test/common/common/token_bucket_impl_test.cc | 5 ++--- test/common/common/utility_test.cc | 2 +- .../compressor/zlib_compressor_impl_test.cc | 5 ++--- .../config/config_provider_impl_test.cc | 4 ++-- .../filesystem_subscription_impl_test.cc | 5 ++--- .../filesystem_subscription_test_harness.h | 2 +- test/common/config/filter_json_test.cc | 3 +-- test/common/config/grpc_mux_impl_test.cc | 4 ++-- .../config/grpc_subscription_impl_test.cc | 5 ++--- .../config/grpc_subscription_test_harness.h | 2 +- .../config/http_subscription_impl_test.cc | 5 ++--- .../config/http_subscription_test_harness.h | 2 +- test/common/config/metadata_test.cc | 5 ++--- test/common/config/rds_json_test.cc | 3 ++- .../config/subscription_factory_test.cc | 4 ++-- test/common/config/subscription_impl_test.cc | 2 +- .../common/config/subscription_test_harness.h | 2 +- test/common/config/utility_test.cc | 2 +- test/common/crypto/utility_test.cc | 2 +- .../zlib_decompressor_impl_test.cc | 5 ++--- .../event/dispatched_thread_impl_test.cc | 4 ++-- test/common/event/dispatcher_impl_test.cc | 4 ++-- test/common/event/file_event_impl_test.cc | 7 +++---- test/common/filesystem/directory_test.cc | 4 ++-- .../common/filesystem/filesystem_impl_test.cc | 4 ++-- test/common/filesystem/watcher_impl_test.cc | 4 ++-- test/common/grpc/async_client_impl_test.cc | 4 ++-- .../grpc/async_client_manager_impl_test.cc | 4 ++-- test/common/grpc/codec_test.cc | 3 +-- test/common/grpc/common_test.cc | 3 +-- .../grpc/google_async_client_impl_test.cc | 4 ++-- test/common/grpc/google_grpc_creds_test.cc | 5 ++--- test/common/grpc/grpc_client_integration.h | 7 +++---- test/common/html/utility_test.cc | 2 +- test/common/http/async_client_impl_test.cc | 4 ++-- test/common/http/codec_client_test.cc | 6 +++--- test/common/http/codes_test.cc | 6 +++--- test/common/http/conn_manager_impl_test.cc | 4 ++-- test/common/http/conn_manager_utility_test.cc | 4 ++-- test/common/http/date_provider_impl_test.cc | 2 +- test/common/http/header_map_impl_test.cc | 3 +-- test/common/http/header_utility_test.cc | 3 +-- test/common/http/http1/codec_impl_test.cc | 6 +++--- test/common/http/http1/conn_pool_test.cc | 4 ++-- test/common/http/http2/codec_impl_test.cc | 4 ++-- test/common/http/http2/conn_pool_test.cc | 4 ++-- .../http2/metadata_encoder_decoder_test.cc | 5 +++-- test/common/http/user_agent_test.cc | 3 +-- test/common/http/utility_test.cc | 3 +-- test/common/json/config_schemas_test.cc | 4 ++-- test/common/json/json_loader_test.cc | 5 ++--- test/common/memory/debug_test.cc | 2 +- test/common/network/address_impl_test.cc | 7 +++---- test/common/network/cidr_range_test.cc | 2 +- test/common/network/connection_impl_test.cc | 12 +++++------ test/common/network/dns_impl_test.cc | 6 +++--- .../network/filter_manager_impl_test.cc | 4 ++-- test/common/network/lc_trie_test.cc | 5 ++--- .../common/network/listen_socket_impl_test.cc | 5 ++--- test/common/network/listener_impl_test.cc | 6 +++--- test/common/network/resolver_impl_test.cc | 5 ++--- .../network/socket_option_factory_test.cc | 5 ++--- test/common/network/socket_option_test.h | 5 ++--- test/common/network/udp_listener_impl_test.cc | 4 ++-- test/common/network/utility_test.cc | 5 ++--- test/common/protobuf/utility_test.cc | 7 +++---- test/common/router/config_impl_test.cc | 20 +++++++++--------- test/common/router/header_formatter_test.cc | 4 ++-- test/common/router/rds_impl_test.cc | 4 ++-- test/common/router/retry_state_impl_test.cc | 4 ++-- test/common/router/router_ratelimit_test.cc | 6 +++--- test/common/router/router_test.cc | 4 ++-- .../common/router/router_upstream_log_test.cc | 4 ++-- test/common/router/shadow_writer_impl_test.cc | 4 ++-- .../router/string_accessor_impl_test.cc | 3 ++- test/common/runtime/runtime_impl_test.cc | 6 +++--- test/common/runtime/uuid_util_test.cc | 2 +- test/common/secret/sds_api_test.cc | 4 ++-- .../common/secret/secret_manager_impl_test.cc | 4 ++-- .../singleton/threadsafe_singleton_test.cc | 3 +-- test/common/stats/heap_stat_data_test.cc | 3 +-- test/common/stats/isolated_store_impl_test.cc | 3 ++- test/common/stats/raw_stat_data_test.cc | 5 ++--- test/common/stats/source_impl_test.cc | 3 +-- test/common/stats/stats_matcher_impl_test.cc | 5 ++--- test/common/stats/symbol_table_impl_test.cc | 4 ++-- test/common/stats/tag_extractor_impl_test.cc | 3 +-- test/common/stats/tag_producer_impl_test.cc | 3 +-- test/common/stats/thread_local_store_test.cc | 6 +++--- .../stream_info/filter_state_impl_test.cc | 5 ++--- .../stream_info/stream_info_impl_test.cc | 4 ++-- test/common/stream_info/utility_test.cc | 2 +- test/common/tcp/conn_pool_test.cc | 6 +++--- test/common/tcp_proxy/tcp_proxy_test.cc | 6 +++--- .../thread/thread_factory_singleton_test.cc | 5 +++-- .../thread_local/thread_local_impl_test.cc | 2 +- test/common/tracing/http_tracer_impl_test.cc | 4 ++-- test/common/upstream/cds_api_impl_test.cc | 4 ++-- .../upstream/cluster_manager_impl_test.cc | 6 +++--- test/common/upstream/edf_scheduler_test.cc | 2 +- test/common/upstream/eds_test.cc | 4 ++-- test/common/upstream/hds_test.cc | 4 ++-- .../upstream/health_checker_impl_test.cc | 10 ++++----- test/common/upstream/host_utility_test.cc | 3 +-- .../upstream/load_balancer_impl_test.cc | 4 ++-- .../upstream/load_balancer_simulation_test.cc | 4 ++-- .../upstream/load_stats_reporter_test.cc | 4 ++-- .../upstream/logical_dns_cluster_test.cc | 4 ++-- test/common/upstream/maglev_lb_test.cc | 2 +- .../upstream/original_dst_cluster_test.cc | 4 ++-- .../upstream/outlier_detection_impl_test.cc | 4 ++-- .../upstream/resource_manager_impl_test.cc | 2 +- test/common/upstream/ring_hash_lb_test.cc | 4 ++-- test/common/upstream/subset_lb_test.cc | 4 ++-- test/common/upstream/upstream_impl_test.cc | 14 ++++++------- test/config/utility.cc | 2 +- test/config_test/config_test.cc | 2 +- test/config_test/example_configs_test.cc | 3 +-- test/coverage/gcc_only_test/gcc_only_test.cc | 2 +- test/exe/main_common_test.cc | 5 ++--- test/exe/signals_test.cc | 3 +-- test/exe/terminate_handler_test.cc | 3 +-- .../access_loggers/file/config_test.cc | 2 +- .../access_loggers/http_grpc/config_test.cc | 4 ++-- .../http_grpc/grpc_access_log_impl_test.cc | 4 ++-- .../grpc_access_log_integration_test.cc | 3 +-- test/extensions/common/tap/admin_test.cc | 5 ++--- .../extensions/common/tap/tap_matcher_test.cc | 5 ++--- .../ext_authz/check_request_utils_test.cc | 4 ++-- .../ext_authz/ext_authz_grpc_impl_test.cc | 4 ++-- .../ext_authz/ext_authz_http_impl_test.cc | 4 ++-- .../extensions/filters/common/lua/lua_test.cc | 2 +- .../filters/common/lua/lua_wrappers.h | 2 +- .../common/ratelimit/ratelimit_impl_test.cc | 4 ++-- .../filters/common/rbac/engine_impl_test.cc | 2 +- .../filters/common/rbac/matchers_test.cc | 2 +- .../filters/http/buffer/buffer_filter_test.cc | 4 ++-- .../filters/http/buffer/config_test.cc | 2 +- .../http/common/aws/signer_impl_test.cc | 2 +- .../filters/http/common/aws/utility_test.cc | 3 +-- .../filters/http/common/jwks_fetcher_test.cc | 2 +- .../http/cors/cors_filter_integration_test.cc | 5 ++--- .../filters/http/cors/cors_filter_test.cc | 4 ++-- .../filters/http/dynamo/config_test.cc | 2 +- .../filters/http/dynamo/dynamo_filter_test.cc | 4 ++-- .../http/dynamo/dynamo_request_parser_test.cc | 3 +-- .../http/dynamo/dynamo_utility_test.cc | 2 +- .../filters/http/ext_authz/config_test.cc | 2 +- .../filters/http/ext_authz/ext_authz_test.cc | 8 +++---- .../filters/http/fault/config_test.cc | 2 +- .../filters/http/fault/fault_filter_test.cc | 4 ++-- .../http/grpc_http1_bridge/config_test.cc | 2 +- .../http1_bridge_filter_test.cc | 4 ++-- .../reverse_bridge_integration_test.cc | 4 ++-- .../reverse_bridge_test.cc | 4 ++-- .../http/grpc_json_transcoder/config_test.cc | 2 +- .../grpc_json_transcoder_integration_test.cc | 7 +++---- .../json_transcoder_filter_test.cc | 8 +++---- .../transcoder_input_stream_test.cc | 4 ++-- .../filters/http/grpc_web/config_test.cc | 2 +- .../http/grpc_web/grpc_web_filter_test.cc | 4 ++-- .../http/gzip/gzip_filter_integration_test.cc | 5 ++--- .../filters/http/gzip/gzip_filter_test.cc | 5 ++--- .../header_to_metadata_filter_test.cc | 4 ++-- .../filters/http/health_check/config_test.cc | 2 +- .../http/health_check/health_check_test.cc | 4 ++-- .../http/ip_tagging/ip_tagging_filter_test.cc | 4 ++-- .../http/jwt_authn/all_verifier_test.cc | 2 +- .../http/jwt_authn/authenticator_test.cc | 5 ++--- .../filters/http/jwt_authn/extractor_test.cc | 2 +- .../http/jwt_authn/filter_factory_test.cc | 2 +- .../filters/http/jwt_authn/filter_test.cc | 4 ++-- .../http/jwt_authn/group_verifier_test.cc | 2 +- .../filters/http/jwt_authn/jwks_cache_test.cc | 2 +- .../filters/http/jwt_authn/matcher_test.cc | 2 +- .../http/jwt_authn/provider_verifier_test.cc | 2 +- .../filters/http/lua/config_test.cc | 2 +- .../filters/http/lua/lua_filter_test.cc | 2 +- .../filters/http/lua/lua_integration_test.cc | 5 ++--- .../filters/http/ratelimit/config_test.cc | 2 +- .../filters/http/ratelimit/ratelimit_test.cc | 4 ++-- .../filters/http/rbac/config_test.cc | 2 +- .../filters/http/rbac/rbac_filter_test.cc | 2 +- .../filters/http/router/config_test.cc | 2 +- .../filters/http/squash/config_test.cc | 2 +- .../squash/squash_filter_integration_test.cc | 2 +- .../filters/http/squash/squash_filter_test.cc | 4 ++-- .../http/tap/tap_filter_integration_test.cc | 4 ++-- .../filters/http/tap/tap_filter_test.cc | 4 ++-- .../listener/original_src/config_test.cc | 4 ++-- .../original_src_config_factory_test.cc | 2 +- .../original_src_socket_option_test.cc | 4 ++-- .../original_src/original_src_test.cc | 4 ++-- .../proxy_protocol/proxy_protocol_test.cc | 6 +++--- .../tls_inspector/tls_inspector_benchmark.cc | 2 +- .../tls_inspector/tls_inspector_test.cc | 4 ++-- .../client_ssl_auth/client_ssl_auth_test.cc | 4 ++-- .../network/client_ssl_auth/config_test.cc | 4 ++-- .../network/dubbo_proxy/config_test.cc | 2 +- .../dubbo_proxy/dubbo_protocol_impl_test.cc | 2 +- .../network/dubbo_proxy/filter_test.cc | 4 ++-- .../hessian_deserializer_impl_test.cc | 2 +- .../network/dubbo_proxy/hessian_utils_test.cc | 3 +-- .../network/dubbo_proxy/metadata_test.cc | 2 +- .../filters/network/dubbo_proxy/mocks.cc | 2 +- .../network/dubbo_proxy/route_matcher_test.cc | 2 +- .../filters/network/ext_authz/config_test.cc | 2 +- .../network/ext_authz/ext_authz_test.cc | 4 ++-- .../http_connection_manager/config_test.cc | 4 ++-- .../network/mongo_proxy/bson_impl_test.cc | 3 +-- .../network/mongo_proxy/codec_impl_test.cc | 4 ++-- .../network/mongo_proxy/config_test.cc | 2 +- .../filters/network/mongo_proxy/proxy_test.cc | 4 ++-- .../network/mongo_proxy/utility_test.cc | 2 +- .../network/mysql_proxy/mysql_codec_test.cc | 5 +++-- .../network/mysql_proxy/mysql_command_test.cc | 5 +++-- .../network/mysql_proxy/mysql_filter_test.cc | 4 ++-- .../mysql_proxy/mysql_integration_test.cc | 4 ++-- .../filters/network/ratelimit/config_test.cc | 2 +- .../network/ratelimit/ratelimit_test.cc | 4 ++-- .../filters/network/rbac/config_test.cc | 4 ++-- .../filters/network/rbac/filter_test.cc | 2 +- .../filters/network/rbac/integration_test.cc | 2 +- .../network/redis_proxy/codec_impl_test.cc | 5 ++--- .../redis_proxy/command_splitter_impl_test.cc | 4 ++-- .../network/redis_proxy/config_test.cc | 2 +- .../redis_proxy/conn_pool_impl_test.cc | 6 +++--- .../filters/network/redis_proxy/mocks.cc | 3 ++- .../network/redis_proxy/proxy_filter_test.cc | 6 +++--- .../network/sni_cluster/sni_cluster_test.cc | 2 +- .../filters/network/tcp_proxy/config_test.cc | 4 ++-- .../thrift_proxy/app_exception_impl_test.cc | 2 +- .../thrift_proxy/auto_protocol_impl_test.cc | 4 ++-- .../thrift_proxy/auto_transport_impl_test.cc | 2 +- .../thrift_proxy/binary_protocol_impl_test.cc | 5 ++--- .../thrift_proxy/buffer_helper_test.cc | 3 +-- .../compact_protocol_impl_test.cc | 8 +++---- .../network/thrift_proxy/config_test.cc | 8 +++---- .../network/thrift_proxy/conn_manager_test.cc | 4 ++-- .../network/thrift_proxy/conn_state_test.cc | 2 +- .../network/thrift_proxy/decoder_test.cc | 13 ++++++------ .../filters/ratelimit/config_test.cc | 2 +- .../filters/ratelimit/ratelimit_test.cc | 4 ++-- .../framed_transport_impl_test.cc | 3 +-- .../header_transport_impl_test.cc | 2 +- .../network/thrift_proxy/integration_test.cc | 8 +++---- .../network/thrift_proxy/metadata_test.cc | 3 +-- .../filters/network/thrift_proxy/mocks.cc | 2 +- .../thrift_proxy/route_matcher_test.cc | 3 +-- .../thrift_proxy/router_ratelimit_test.cc | 6 +++--- .../network/thrift_proxy/router_test.cc | 9 ++++---- .../thrift_proxy/thrift_object_impl_test.cc | 7 +++---- .../translation_integration_test.cc | 9 ++++---- .../twitter_protocol_impl_test.cc | 5 ++--- .../unframed_transport_impl_test.cc | 3 +-- .../filters/network/thrift_proxy/utility.h | 4 ++-- .../health_checkers/redis/redis_test.cc | 2 +- .../quic_listeners/quiche/dummy_test.cc | 3 ++- .../quiche/platform/http2_platform_test.cc | 3 ++- .../quiche/platform/quic_platform_test.cc | 3 ++- .../quiche/platform/spdy_platform_test.cc | 3 ++- .../fixed_heap/config_test.cc | 3 +-- .../fixed_heap/fixed_heap_monitor_test.cc | 3 ++- .../injected_resource/config_test.cc | 3 +-- .../injected_resource_monitor_test.cc | 4 ++-- .../retry/host/previous_hosts/config_test.cc | 2 +- .../previous_priorities/config_test.cc | 4 ++-- .../stats_sinks/common/statsd/statsd_test.cc | 4 ++-- .../common/statsd/udp_statsd_test.cc | 6 +++--- .../stats_sinks/dog_statsd/config_test.cc | 4 ++-- .../stats_sinks/hystrix/config_test.cc | 2 +- .../stats_sinks/hystrix/hystrix_test.cc | 4 ++-- .../grpc_metrics_service_impl_test.cc | 4 ++-- .../metrics_service_integration_test.cc | 3 +-- .../stats_sinks/statsd/config_test.cc | 6 +++--- .../common/ot/opentracing_driver_impl_test.cc | 4 ++-- .../extensions/tracers/datadog/config_test.cc | 2 +- .../datadog/datadog_tracer_impl_test.cc | 4 ++-- .../tracers/dynamic_ot/config_test.cc | 2 +- .../dynamic_opentracing_driver_impl_test.cc | 4 ++-- .../tracers/lightstep/config_test.cc | 2 +- .../lightstep/lightstep_tracer_impl_test.cc | 4 ++-- test/extensions/tracers/zipkin/config_test.cc | 2 +- .../tracers/zipkin/span_buffer_test.cc | 3 +-- .../zipkin/span_context_extractor_test.cc | 3 +-- test/extensions/tracers/zipkin/tracer_test.cc | 4 ++-- test/extensions/tracers/zipkin/util_test.cc | 3 +-- .../tracers/zipkin/zipkin_core_types_test.cc | 3 +-- .../tracers/zipkin/zipkin_tracer_impl_test.cc | 4 ++-- .../alts/alts_integration_test.cc | 4 ++-- .../transport_sockets/alts/config_test.cc | 2 +- .../noop_transport_socket_callbacks_test.cc | 5 ++--- .../alts/tsi_frame_protector_test.cc | 5 +++-- .../alts/tsi_handshaker_test.cc | 4 ++-- .../transport_sockets/alts/tsi_socket_test.cc | 6 +++--- .../tls/context_impl_test.cc | 2 +- .../transport_sockets/tls/ssl_certs_test.h | 5 ++--- .../transport_sockets/tls/ssl_socket_test.cc | 2 +- .../transport_sockets/tls/ssl_test_utility.h | 2 +- .../transport_sockets/tls/utility_test.cc | 2 +- test/fuzz/main.cc | 5 ++--- test/integration/ads_integration_test.cc | 3 +-- test/integration/cds_integration_test.cc | 2 +- test/integration/echo_integration_test.cc | 2 +- test/integration/eds_integration_test.cc | 5 ++--- test/integration/hds_integration_test.cc | 4 ++-- test/integration/header_integration_test.cc | 9 ++++---- test/integration/http2_integration_test.cc | 3 +-- test/integration/http2_integration_test.h | 5 ++--- .../http2_upstream_integration_test.cc | 3 +-- .../http2_upstream_integration_test.h | 5 ++--- test/integration/http_integration.cc | 3 +-- test/integration/http_protocol_integration.h | 7 +++---- test/integration/integration.cc | 3 +-- test/integration/integration_admin_test.cc | 6 +++--- test/integration/integration_admin_test.h | 3 +-- test/integration/integration_test.cc | 3 +-- test/integration/integration_test.h | 5 ++--- .../load_stats_integration_test.cc | 5 ++--- .../proxy_proto_integration_test.cc | 2 +- .../proxy_proto_integration_test.h | 5 ++--- .../integration/ratelimit_integration_test.cc | 3 +-- .../sds_dynamic_integration_test.cc | 2 +- .../sds_static_integration_test.cc | 12 +++++------ test/integration/server.cc | 2 +- test/integration/ssl_integration_test.cc | 8 +++---- test/integration/ssl_integration_test.h | 4 ++-- test/integration/ssl_utility.cc | 3 +-- test/integration/stats_integration_test.cc | 5 ++--- .../tcp_conn_pool_integration_test.cc | 2 +- .../integration/tcp_proxy_integration_test.cc | 3 +-- test/integration/tcp_proxy_integration_test.h | 5 ++--- test/integration/uds_integration_test.cc | 3 +-- test/integration/uds_integration_test.h | 7 +++---- .../integration/websocket_integration_test.cc | 2 +- test/integration/websocket_integration_test.h | 3 +-- test/integration/xds_integration_test.cc | 5 ++--- test/integration/xfcc_integration_test.cc | 2 +- test/integration/xfcc_integration_test.h | 4 ++-- test/mocks/access_log/mocks.cc | 3 ++- test/mocks/api/mocks.cc | 3 ++- test/mocks/common.h | 1 + test/mocks/event/mocks.cc | 3 ++- test/mocks/http/mocks.cc | 3 ++- test/mocks/init/mocks.cc | 3 ++- test/mocks/local_info/mocks.cc | 3 ++- test/mocks/network/mocks.cc | 2 +- test/mocks/router/mocks.cc | 3 ++- test/mocks/runtime/mocks.cc | 3 ++- test/mocks/secret/mocks.h | 3 ++- test/mocks/server/mocks.cc | 3 ++- test/mocks/server/mocks.h | 2 +- test/mocks/stats/mocks.cc | 3 ++- test/mocks/stream_info/mocks.cc | 3 ++- test/mocks/thread_local/mocks.cc | 3 ++- test/mocks/tracing/mocks.cc | 3 ++- test/mocks/upstream/cluster_info.h | 2 +- test/mocks/upstream/mocks.cc | 3 ++- test/mocks/upstream/mocks.h | 2 +- test/server/backtrace_test.cc | 2 +- .../config_validation/dispatcher_test.cc | 2 +- test/server/config_validation/server_test.cc | 2 +- test/server/configuration_impl_test.cc | 4 ++-- test/server/connection_handler_test.cc | 4 ++-- test/server/drain_manager_impl_test.cc | 4 ++-- test/server/guarddog_impl_test.cc | 4 ++-- test/server/hot_restart_impl_test.cc | 4 ++-- test/server/http/admin_test.cc | 10 ++++----- test/server/http/config_tracker_impl_test.cc | 2 +- test/server/init_manager_impl_test.cc | 2 +- test/server/lds_api_test.cc | 2 +- test/server/listener_manager_impl_test.cc | 4 ++-- test/server/options_impl_test.cc | 4 ++-- test/server/overload_manager_impl_test.cc | 4 ++-- test/server/server_test.cc | 7 +++---- test/server/worker_impl_test.cc | 5 ++--- test/test_common/BUILD | 12 ++++++++++- test/test_common/environment.cc | 2 +- test/test_common/global_test.cc | 5 ++--- test/test_common/network_utility_test.cc | 5 ++--- test/test_common/registry.h | 2 +- .../test_common/simulated_time_system_test.cc | 4 ++-- test/test_common/test_base.cc | 19 +++++++++++++++++ test/test_common/test_base.h | 21 +++++++++++++++++++ test/test_common/test_time_system_test.cc | 5 ++--- test/test_common/utility.cc | 2 +- test/test_common/utility.h | 4 ++-- test/test_common/utility_test.cc | 3 +-- test/test_runner.h | 11 ++++------ .../config_load_check/config_load_check.cc | 3 +-- tools/check_format.py | 5 +++++ 418 files changed, 795 insertions(+), 824 deletions(-) create mode 100644 test/test_common/test_base.cc create mode 100644 test/test_common/test_base.h diff --git a/bazel/envoy_build_system.bzl b/bazel/envoy_build_system.bzl index 3954d2492177..a244d8be7a94 100644 --- a/bazel/envoy_build_system.bzl +++ b/bazel/envoy_build_system.bzl @@ -432,6 +432,7 @@ def envoy_cc_test_library( deps = deps + [envoy_external_dep_path(dep) for dep in external_deps] + [ envoy_external_dep_path("googletest"), repository + "//test/test_common:printers_includes", + repository + "//test/test_common:test_base", ], tags = tags, alwayslink = 1, diff --git a/test/common/access_log/access_log_formatter_test.cc b/test/common/access_log/access_log_formatter_test.cc index 06273f2fe486..38a81cd2c6d3 100644 --- a/test/common/access_log/access_log_formatter_test.cc +++ b/test/common/access_log/access_log_formatter_test.cc @@ -11,10 +11,10 @@ #include "test/mocks/stream_info/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Const; diff --git a/test/common/access_log/access_log_impl_test.cc b/test/common/access_log/access_log_impl_test.cc index 378617adb5ba..a5c13c589c2a 100644 --- a/test/common/access_log/access_log_impl_test.cc +++ b/test/common/access_log/access_log_impl_test.cc @@ -20,10 +20,10 @@ #include "test/mocks/server/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -48,7 +48,7 @@ envoy::config::filter::accesslog::v2::AccessLog parseAccessLogFromV2Yaml(const s return access_log; } -class AccessLogImplTest : public testing::Test { +class AccessLogImplTest : public TestBase { public: AccessLogImplTest() : file_(new Filesystem::MockFile()) { ON_CALL(context_, runtime()).WillByDefault(ReturnRef(runtime_)); diff --git a/test/common/access_log/access_log_manager_impl_test.cc b/test/common/access_log/access_log_manager_impl_test.cc index 06838ee9df28..cde2c1a0fb8f 100644 --- a/test/common/access_log/access_log_manager_impl_test.cc +++ b/test/common/access_log/access_log_manager_impl_test.cc @@ -7,9 +7,9 @@ #include "test/mocks/api/mocks.h" #include "test/mocks/event/mocks.h" #include "test/mocks/filesystem/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Return; diff --git a/test/common/buffer/buffer_test.cc b/test/common/buffer/buffer_test.cc index c70ea116bdfb..f9574b5ecc66 100644 --- a/test/common/buffer/buffer_test.cc +++ b/test/common/buffer/buffer_test.cc @@ -6,10 +6,9 @@ #include "test/common/buffer/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Buffer { namespace { diff --git a/test/common/buffer/owned_impl_test.cc b/test/common/buffer/owned_impl_test.cc index 227f93284662..aad9ada56490 100644 --- a/test/common/buffer/owned_impl_test.cc +++ b/test/common/buffer/owned_impl_test.cc @@ -2,11 +2,11 @@ #include "common/buffer/buffer_impl.h" #include "test/mocks/api/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" #include "absl/strings/str_cat.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Return; @@ -15,7 +15,7 @@ namespace Envoy { namespace Buffer { namespace { -class OwnedImplTest : public testing::Test { +class OwnedImplTest : public TestBase { public: OwnedImplTest() {} diff --git a/test/common/buffer/utility.h b/test/common/buffer/utility.h index 868427de465a..1670a2da040e 100644 --- a/test/common/buffer/utility.h +++ b/test/common/buffer/utility.h @@ -4,7 +4,7 @@ #include "common/buffer/buffer_impl.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Buffer { diff --git a/test/common/buffer/watermark_buffer_test.cc b/test/common/buffer/watermark_buffer_test.cc index e7f45ea56b8f..18efc4246082 100644 --- a/test/common/buffer/watermark_buffer_test.cc +++ b/test/common/buffer/watermark_buffer_test.cc @@ -3,7 +3,7 @@ #include "common/buffer/buffer_impl.h" #include "common/buffer/watermark_buffer.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Buffer { @@ -11,7 +11,7 @@ namespace { const char TEN_BYTES[] = "0123456789"; -class WatermarkBufferTest : public testing::Test { +class WatermarkBufferTest : public TestBase { public: WatermarkBufferTest() { buffer_.setWatermarks(5, 10); } diff --git a/test/common/buffer/zero_copy_input_stream_test.cc b/test/common/buffer/zero_copy_input_stream_test.cc index 69070f1cc026..1a748fe1146b 100644 --- a/test/common/buffer/zero_copy_input_stream_test.cc +++ b/test/common/buffer/zero_copy_input_stream_test.cc @@ -1,13 +1,13 @@ #include "common/buffer/buffer_impl.h" #include "common/buffer/zero_copy_input_stream_impl.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Buffer { namespace { -class ZeroCopyInputStreamTest : public testing::Test { +class ZeroCopyInputStreamTest : public TestBase { public: ZeroCopyInputStreamTest() { Buffer::OwnedImpl buffer{"abcd"}; diff --git a/test/common/common/assert_test.cc b/test/common/common/assert_test.cc index 44d65b495766..078e085144b6 100644 --- a/test/common/common/assert_test.cc +++ b/test/common/common/assert_test.cc @@ -1,8 +1,7 @@ #include "common/common/assert.h" #include "test/test_common/logging.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { diff --git a/test/common/common/backoff_strategy_test.cc b/test/common/common/backoff_strategy_test.cc index 010768349983..3396c166a1ad 100644 --- a/test/common/common/backoff_strategy_test.cc +++ b/test/common/common/backoff_strategy_test.cc @@ -1,8 +1,7 @@ #include "common/common/backoff_strategy.h" #include "test/mocks/runtime/mocks.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::NiceMock; using testing::Return; diff --git a/test/common/common/base64_test.cc b/test/common/common/base64_test.cc index 74cbbd44132c..257ad0060326 100644 --- a/test/common/common/base64_test.cc +++ b/test/common/common/base64_test.cc @@ -4,8 +4,7 @@ #include "common/common/base64.h" #include "test/test_common/printers.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { TEST(Base64Test, EmptyBufferEncode) { diff --git a/test/common/common/block_memory_hash_set_test.cc b/test/common/common/block_memory_hash_set_test.cc index 37b4957feca1..fbeb56f7c38d 100644 --- a/test/common/common/block_memory_hash_set_test.cc +++ b/test/common/common/block_memory_hash_set_test.cc @@ -9,13 +9,14 @@ #include "common/common/hash.h" #include "common/stats/stats_options_impl.h" +#include "test/test_common/test_base.h" + #include "absl/strings/string_view.h" -#include "gtest/gtest.h" namespace Envoy { // Tests BlockMemoryHashSet. -class BlockMemoryHashSetTest : public testing::Test { +class BlockMemoryHashSetTest : public TestBase { protected: // TestValue that doesn't define a hash. struct TestValueBase { diff --git a/test/common/common/callback_impl_test.cc b/test/common/common/callback_impl_test.cc index 6f5d6afe4854..72ea44c63b81 100644 --- a/test/common/common/callback_impl_test.cc +++ b/test/common/common/callback_impl_test.cc @@ -1,5 +1,7 @@ #include "common/common/callback_impl.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" using testing::InSequence; @@ -7,7 +9,7 @@ using testing::InSequence; namespace Envoy { namespace Common { -class CallbackManagerTest : public testing::Test { +class CallbackManagerTest : public TestBase { public: MOCK_METHOD1(called, void(int arg)); }; diff --git a/test/common/common/cleanup_test.cc b/test/common/common/cleanup_test.cc index 742f279dc530..f702f70f4bdc 100644 --- a/test/common/common/cleanup_test.cc +++ b/test/common/common/cleanup_test.cc @@ -1,6 +1,6 @@ #include "common/common/cleanup.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { diff --git a/test/common/common/fmt_test.cc b/test/common/common/fmt_test.cc index f5b8fd45d953..6ec59c26b270 100644 --- a/test/common/common/fmt_test.cc +++ b/test/common/common/fmt_test.cc @@ -1,8 +1,9 @@ #include "common/common/fmt.h" #include "common/common/logger.h" +#include "test/test_common/test_base.h" + #include "absl/strings/string_view.h" -#include "gtest/gtest.h" namespace Envoy { diff --git a/test/common/common/hash_test.cc b/test/common/common/hash_test.cc index e1fcafc5ea97..8d131ea7ca9f 100644 --- a/test/common/common/hash_test.cc +++ b/test/common/common/hash_test.cc @@ -1,6 +1,6 @@ #include "common/common/hash.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { TEST(Hash, xxHash) { diff --git a/test/common/common/hex_test.cc b/test/common/common/hex_test.cc index 06a06469edc1..4fe426a25fb9 100644 --- a/test/common/common/hex_test.cc +++ b/test/common/common/hex_test.cc @@ -5,7 +5,7 @@ #include "common/common/hex.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { TEST(Hex, SimpleEncode) { diff --git a/test/common/common/lock_guard_test.cc b/test/common/common/lock_guard_test.cc index 55f505f9ab58..ee9073391a5d 100644 --- a/test/common/common/lock_guard_test.cc +++ b/test/common/common/lock_guard_test.cc @@ -1,12 +1,12 @@ #include "common/common/lock_guard.h" #include "common/common/thread.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Thread { -class ThreadTest : public testing::Test { +class ThreadTest : public TestBase { protected: ThreadTest() : a_(0), b_(0) {} int a_ GUARDED_BY(a_mutex_); diff --git a/test/common/common/log_macros_test.cc b/test/common/common/log_macros_test.cc index 8d683910bb6b..82fdfeca05ec 100644 --- a/test/common/common/log_macros_test.cc +++ b/test/common/common/log_macros_test.cc @@ -5,9 +5,9 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/network/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { diff --git a/test/common/common/matchers_test.cc b/test/common/common/matchers_test.cc index d5b509a89082..43c24e132109 100644 --- a/test/common/common/matchers_test.cc +++ b/test/common/common/matchers_test.cc @@ -7,7 +7,7 @@ #include "common/config/metadata.h" #include "common/protobuf/protobuf.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Matcher { diff --git a/test/common/common/mutex_tracer_test.cc b/test/common/common/mutex_tracer_test.cc index 042b0469f199..a8ccee205a04 100644 --- a/test/common/common/mutex_tracer_test.cc +++ b/test/common/common/mutex_tracer_test.cc @@ -5,13 +5,13 @@ #include "common/common/mutex_tracer_impl.h" #include "test/test_common/contention.h" +#include "test/test_common/test_base.h" #include "absl/synchronization/mutex.h" -#include "gtest/gtest.h" namespace Envoy { -class MutexTracerTest : public testing::Test { +class MutexTracerTest : public TestBase { protected: void SetUp() override { tracer_.reset(); } diff --git a/test/common/common/perf_annotation_disabled_test.cc b/test/common/common/perf_annotation_disabled_test.cc index 8109cad63457..fe6ecc663a2b 100644 --- a/test/common/common/perf_annotation_disabled_test.cc +++ b/test/common/common/perf_annotation_disabled_test.cc @@ -6,7 +6,7 @@ #include "common/common/perf_annotation.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { diff --git a/test/common/common/perf_annotation_test.cc b/test/common/common/perf_annotation_test.cc index c8498a72096e..6a479009b25f 100644 --- a/test/common/common/perf_annotation_test.cc +++ b/test/common/common/perf_annotation_test.cc @@ -9,11 +9,11 @@ #include "common/common/perf_annotation.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { -class PerfAnnotationTest : public testing::Test { +class PerfAnnotationTest : public TestBase { protected: void TearDown() override { PERF_CLEAR(); } }; diff --git a/test/common/common/phantom_test.cc b/test/common/common/phantom_test.cc index 6ec0ed185068..fbdfd42a5df0 100644 --- a/test/common/common/phantom_test.cc +++ b/test/common/common/phantom_test.cc @@ -1,6 +1,6 @@ #include "common/common/phantom.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { diff --git a/test/common/common/stack_array_test.cc b/test/common/common/stack_array_test.cc index fa857f77b05f..04a98c9d3159 100644 --- a/test/common/common/stack_array_test.cc +++ b/test/common/common/stack_array_test.cc @@ -1,7 +1,8 @@ #include "common/common/stack_array.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { diff --git a/test/common/common/to_lower_table_test.cc b/test/common/common/to_lower_table_test.cc index 3004f852aa20..a20c6cebdd5a 100644 --- a/test/common/common/to_lower_table_test.cc +++ b/test/common/common/to_lower_table_test.cc @@ -1,6 +1,6 @@ #include "common/common/to_lower_table.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { TEST(ToLowerTableTest, All) { diff --git a/test/common/common/token_bucket_impl_test.cc b/test/common/common/token_bucket_impl_test.cc index 5d4e811e473e..5d575377769d 100644 --- a/test/common/common/token_bucket_impl_test.cc +++ b/test/common/common/token_bucket_impl_test.cc @@ -3,12 +3,11 @@ #include "common/common/token_bucket_impl.h" #include "test/test_common/simulated_time_system.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { -class TokenBucketImplTest : public testing::Test { +class TokenBucketImplTest : public TestBase { protected: Event::SimulatedTimeSystem time_system_; }; diff --git a/test/common/common/utility_test.cc b/test/common/common/utility_test.cc index 2946b5218910..3e83544a04c0 100644 --- a/test/common/common/utility_test.cc +++ b/test/common/common/utility_test.cc @@ -8,13 +8,13 @@ #include "common/common/utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::ContainerEq; diff --git a/test/common/compressor/zlib_compressor_impl_test.cc b/test/common/compressor/zlib_compressor_impl_test.cc index 8d07331995a1..c1fd72b5cd50 100644 --- a/test/common/compressor/zlib_compressor_impl_test.cc +++ b/test/common/compressor/zlib_compressor_impl_test.cc @@ -3,15 +3,14 @@ #include "common/common/stack_array.h" #include "common/compressor/zlib_compressor_impl.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Compressor { namespace { -class ZlibCompressorImplTest : public testing::Test { +class ZlibCompressorImplTest : public TestBase { protected: void expectValidFlushedBuffer(const Buffer::OwnedImpl& output_buffer) { uint64_t num_comp_slices = output_buffer.getRawSlices(nullptr, 0); diff --git a/test/common/config/config_provider_impl_test.cc b/test/common/config/config_provider_impl_test.cc index 4704f1aa82b0..1f355769cda5 100644 --- a/test/common/config/config_provider_impl_test.cc +++ b/test/common/config/config_provider_impl_test.cc @@ -6,9 +6,9 @@ #include "test/common/config/dummy_config.pb.h" #include "test/mocks/server/mocks.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Config { @@ -205,7 +205,7 @@ DummyConfigSubscription::DummyConfigSubscription( "DummyDS", manager_identifier, config_provider_manager, factory_context.timeSource(), factory_context.timeSource().systemTime(), factory_context.localInfo()) {} -class ConfigProviderImplTest : public testing::Test { +class ConfigProviderImplTest : public TestBase { public: ConfigProviderImplTest() { EXPECT_CALL(factory_context_.admin_.config_tracker_, add_("dummy", _)); diff --git a/test/common/config/filesystem_subscription_impl_test.cc b/test/common/config/filesystem_subscription_impl_test.cc index b76d6de62a7b..c1582b0f4557 100644 --- a/test/common/config/filesystem_subscription_impl_test.cc +++ b/test/common/config/filesystem_subscription_impl_test.cc @@ -2,9 +2,9 @@ #include "test/mocks/event/mocks.h" #include "test/mocks/filesystem/mocks.h" #include "test/test_common/logging.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using ::testing::Throw; @@ -12,8 +12,7 @@ namespace Envoy { namespace Config { namespace { -class FilesystemSubscriptionImplTest : public FilesystemSubscriptionTestHarness, - public testing::Test {}; +class FilesystemSubscriptionImplTest : public FilesystemSubscriptionTestHarness, public TestBase {}; // Validate that the client can recover from bad JSON responses. TEST_F(FilesystemSubscriptionImplTest, BadJsonRecovery) { diff --git a/test/common/config/filesystem_subscription_test_harness.h b/test/common/config/filesystem_subscription_test_harness.h index ef402e657344..f78b0ef199d5 100644 --- a/test/common/config/filesystem_subscription_test_harness.h +++ b/test/common/config/filesystem_subscription_test_harness.h @@ -11,11 +11,11 @@ #include "test/common/config/subscription_test_harness.h" #include "test/mocks/config/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/common/config/filter_json_test.cc b/test/common/config/filter_json_test.cc index 8cec55f45609..beb6a7e4de3d 100644 --- a/test/common/config/filter_json_test.cc +++ b/test/common/config/filter_json_test.cc @@ -5,10 +5,9 @@ #include "common/config/filter_json.h" #include "common/json/json_loader.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Config { namespace { diff --git a/test/common/config/grpc_mux_impl_test.cc b/test/common/config/grpc_mux_impl_test.cc index d20d699fbdec..b8c58b5443fe 100644 --- a/test/common/config/grpc_mux_impl_test.cc +++ b/test/common/config/grpc_mux_impl_test.cc @@ -18,11 +18,11 @@ #include "test/mocks/runtime/mocks.h" #include "test/test_common/logging.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AtLeast; @@ -38,7 +38,7 @@ namespace { // We test some mux specific stuff below, other unit test coverage for singleton use of GrpcMuxImpl // is provided in [grpc_]subscription_impl_test.cc. -class GrpcMuxImplTestBase : public testing::Test { +class GrpcMuxImplTestBase : public TestBase { public: GrpcMuxImplTestBase() : async_client_(new Grpc::MockAsyncClient()) {} diff --git a/test/common/config/grpc_subscription_impl_test.cc b/test/common/config/grpc_subscription_impl_test.cc index 3dd94aea5f4f..1c2f1c987e87 100644 --- a/test/common/config/grpc_subscription_impl_test.cc +++ b/test/common/config/grpc_subscription_impl_test.cc @@ -1,6 +1,5 @@ #include "test/common/config/grpc_subscription_test_harness.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::InSequence; @@ -8,7 +7,7 @@ namespace Envoy { namespace Config { namespace { -class GrpcSubscriptionImplTest : public GrpcSubscriptionTestHarness, public testing::Test {}; +class GrpcSubscriptionImplTest : public GrpcSubscriptionTestHarness, public TestBase {}; // Validate that stream creation results in a timer based retry and can recover. TEST_F(GrpcSubscriptionImplTest, StreamCreationFailure) { diff --git a/test/common/config/grpc_subscription_test_harness.h b/test/common/config/grpc_subscription_test_harness.h index c6316aab957c..a9e2c0eed41d 100644 --- a/test/common/config/grpc_subscription_test_harness.h +++ b/test/common/config/grpc_subscription_test_harness.h @@ -14,10 +14,10 @@ #include "test/mocks/grpc/mocks.h" #include "test/mocks/local_info/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/common/config/http_subscription_impl_test.cc b/test/common/config/http_subscription_impl_test.cc index 8a275347ec0b..05d5c19cf5cd 100644 --- a/test/common/config/http_subscription_impl_test.cc +++ b/test/common/config/http_subscription_impl_test.cc @@ -1,14 +1,13 @@ #include #include "test/common/config/http_subscription_test_harness.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Config { namespace { -class HttpSubscriptionImplTest : public HttpSubscriptionTestHarness, public testing::Test {}; +class HttpSubscriptionImplTest : public HttpSubscriptionTestHarness, public TestBase {}; // Validate that the client can recover from a remote fetch failure. TEST_F(HttpSubscriptionImplTest, OnRequestReset) { diff --git a/test/common/config/http_subscription_test_harness.h b/test/common/config/http_subscription_test_harness.h index 762f28454b25..d847994b081f 100644 --- a/test/common/config/http_subscription_test_harness.h +++ b/test/common/config/http_subscription_test_harness.h @@ -17,10 +17,10 @@ #include "test/mocks/local_info/mocks.h" #include "test/mocks/runtime/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/common/config/metadata_test.cc b/test/common/config/metadata_test.cc index 28d5cb67b4a8..bfc208841fcf 100644 --- a/test/common/config/metadata_test.cc +++ b/test/common/config/metadata_test.cc @@ -5,10 +5,9 @@ #include "common/protobuf/utility.h" #include "test/test_common/registry.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Config { namespace { @@ -48,7 +47,7 @@ TEST(MetadataTest, MetadataValuePath) { ProtobufWkt::Value::KindCase::KIND_NOT_SET); } -class TypedMetadataTest : public testing::Test { +class TypedMetadataTest : public TestBase { public: TypedMetadataTest() : registered_factory_(foo_factory_) {} diff --git a/test/common/config/rds_json_test.cc b/test/common/config/rds_json_test.cc index 0b099bbe33e3..262871c750b7 100644 --- a/test/common/config/rds_json_test.cc +++ b/test/common/config/rds_json_test.cc @@ -3,8 +3,9 @@ #include "common/config/rds_json.h" #include "common/json/json_loader.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; diff --git a/test/common/config/subscription_factory_test.cc b/test/common/config/subscription_factory_test.cc index e689f68fc4bf..0daf82b123fc 100644 --- a/test/common/config/subscription_factory_test.cc +++ b/test/common/config/subscription_factory_test.cc @@ -14,10 +14,10 @@ #include "test/mocks/stats/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using ::testing::_; using ::testing::Invoke; @@ -26,7 +26,7 @@ using ::testing::Return; namespace Envoy { namespace Config { -class SubscriptionFactoryTest : public ::testing::Test { +class SubscriptionFactoryTest : public TestBase { public: SubscriptionFactoryTest() : http_request_(&cm_.async_client_), api_(Api::createApiForTest(stats_store_)) {} diff --git a/test/common/config/subscription_impl_test.cc b/test/common/config/subscription_impl_test.cc index 85b07333306a..503f469fe8bb 100644 --- a/test/common/config/subscription_impl_test.cc +++ b/test/common/config/subscription_impl_test.cc @@ -15,7 +15,7 @@ enum class SubscriptionType { Filesystem, }; -class SubscriptionImplTest : public testing::TestWithParam { +class SubscriptionImplTest : public TestBaseWithParam { public: SubscriptionImplTest() { switch (GetParam()) { diff --git a/test/common/config/subscription_test_harness.h b/test/common/config/subscription_test_harness.h index 0df305a00f58..16d184121789 100644 --- a/test/common/config/subscription_test_harness.h +++ b/test/common/config/subscription_test_harness.h @@ -3,9 +3,9 @@ #include "common/config/utility.h" #include "test/mocks/stats/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Config { diff --git a/test/common/config/utility_test.cc b/test/common/config/utility_test.cc index c52d2c811813..c3ebc97e5d23 100644 --- a/test/common/config/utility_test.cc +++ b/test/common/config/utility_test.cc @@ -14,10 +14,10 @@ #include "test/mocks/stats/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AtLeast; diff --git a/test/common/crypto/utility_test.cc b/test/common/crypto/utility_test.cc index 46c685210244..e3730caab959 100644 --- a/test/common/crypto/utility_test.cc +++ b/test/common/crypto/utility_test.cc @@ -2,7 +2,7 @@ #include "common/common/hex.h" #include "common/crypto/utility.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Common { diff --git a/test/common/decompressor/zlib_decompressor_impl_test.cc b/test/common/decompressor/zlib_decompressor_impl_test.cc index bb715643e123..3dfa3600966a 100644 --- a/test/common/decompressor/zlib_decompressor_impl_test.cc +++ b/test/common/decompressor/zlib_decompressor_impl_test.cc @@ -3,15 +3,14 @@ #include "common/compressor/zlib_compressor_impl.h" #include "common/decompressor/zlib_decompressor_impl.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Decompressor { namespace { -class ZlibDecompressorImplTest : public testing::Test { +class ZlibDecompressorImplTest : public TestBase { protected: void drainBuffer(Buffer::OwnedImpl& buffer) { buffer.drain(buffer.length()); } diff --git a/test/common/event/dispatched_thread_impl_test.cc b/test/common/event/dispatched_thread_impl_test.cc index cf0717371c3a..1971ee014621 100644 --- a/test/common/event/dispatched_thread_impl_test.cc +++ b/test/common/event/dispatched_thread_impl_test.cc @@ -9,11 +9,11 @@ #include "test/mocks/common.h" #include "test/mocks/server/mocks.h" #include "test/mocks/stats/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::InSequence; using testing::NiceMock; @@ -21,7 +21,7 @@ using testing::NiceMock; namespace Envoy { namespace Event { -class DispatchedThreadTest : public testing::Test { +class DispatchedThreadTest : public TestBase { protected: DispatchedThreadTest() : config_(1000, 1000, 1000, 1000), api_(Api::createApiForTest(fakestats_)), diff --git a/test/common/event/dispatcher_impl_test.cc b/test/common/event/dispatcher_impl_test.cc index 1d2d6b54a533..da48fa793e17 100644 --- a/test/common/event/dispatcher_impl_test.cc +++ b/test/common/event/dispatcher_impl_test.cc @@ -8,11 +8,11 @@ #include "common/stats/isolated_store_impl.h" #include "test/mocks/common.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::InSequence; @@ -61,7 +61,7 @@ TEST(DeferredDeleteTest, DeferredDelete) { dispatcher.clearDeferredDeleteList(); } -class DispatcherImplTest : public ::testing::Test { +class DispatcherImplTest : public TestBase { protected: DispatcherImplTest() : api_(Api::createApiForTest(stat_store_)), diff --git a/test/common/event/file_event_impl_test.cc b/test/common/event/file_event_impl_test.cc index 8b8dc3fe415b..cb8bec642bf6 100644 --- a/test/common/event/file_event_impl_test.cc +++ b/test/common/event/file_event_impl_test.cc @@ -7,15 +7,14 @@ #include "test/mocks/common.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Event { -class FileEventImplTest : public testing::Test { +class FileEventImplTest : public TestBase { public: FileEventImplTest() : api_(Api::createApiForTest(stats_store_)), dispatcher_(test_time_.timeSystem(), *api_) {} @@ -41,7 +40,7 @@ class FileEventImplTest : public testing::Test { DispatcherImpl dispatcher_; }; -class FileEventImplActivateTest : public testing::TestWithParam {}; +class FileEventImplActivateTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpVersions, FileEventImplActivateTest, testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), diff --git a/test/common/filesystem/directory_test.cc b/test/common/filesystem/directory_test.cc index 5536f77d7286..9eb3f0d3ddd7 100644 --- a/test/common/filesystem/directory_test.cc +++ b/test/common/filesystem/directory_test.cc @@ -6,10 +6,10 @@ #include "common/filesystem/directory.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Filesystem { @@ -18,7 +18,7 @@ namespace Filesystem { // as it looks like some versions of libstdc++ have a bug in // std::experimental::filesystem::remove_all where it fails with nested directories: // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71313 -class DirectoryTest : public testing::Test { +class DirectoryTest : public TestBase { public: DirectoryTest() : dir_path_(TestEnvironment::temporaryPath("envoy_test")) { files_to_remove_.push(dir_path_); diff --git a/test/common/filesystem/filesystem_impl_test.cc b/test/common/filesystem/filesystem_impl_test.cc index 4e4558c83591..3bc30c6a14c7 100644 --- a/test/common/filesystem/filesystem_impl_test.cc +++ b/test/common/filesystem/filesystem_impl_test.cc @@ -13,11 +13,11 @@ #include "test/mocks/event/mocks.h" #include "test/mocks/filesystem/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -30,7 +30,7 @@ using testing::Throw; namespace Envoy { -class FileSystemImplTest : public testing::Test { +class FileSystemImplTest : public TestBase { protected: FileSystemImplTest() : file_system_(std::chrono::milliseconds(10000), Thread::threadFactoryForTest(), diff --git a/test/common/filesystem/watcher_impl_test.cc b/test/common/filesystem/watcher_impl_test.cc index 0f90304f001f..a7ab6895f702 100644 --- a/test/common/filesystem/watcher_impl_test.cc +++ b/test/common/filesystem/watcher_impl_test.cc @@ -7,16 +7,16 @@ #include "common/stats/isolated_store_impl.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Filesystem { -class WatcherImplTest : public testing::Test { +class WatcherImplTest : public TestBase { protected: WatcherImplTest() : api_(Api::createApiForTest(stats_store_)), dispatcher_(test_time_.timeSystem(), *api_) {} diff --git a/test/common/grpc/async_client_impl_test.cc b/test/common/grpc/async_client_impl_test.cc index 94a33c83fd68..f12ff4992137 100644 --- a/test/common/grpc/async_client_impl_test.cc +++ b/test/common/grpc/async_client_impl_test.cc @@ -4,10 +4,10 @@ #include "test/mocks/tracing/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/proto/helloworld.pb.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -19,7 +19,7 @@ namespace Envoy { namespace Grpc { namespace { -class EnvoyAsyncClientImplTest : public testing::Test { +class EnvoyAsyncClientImplTest : public TestBase { public: EnvoyAsyncClientImplTest() : method_descriptor_(helloworld::Greeter::descriptor()->FindMethodByName("SayHello")) { diff --git a/test/common/grpc/async_client_manager_impl_test.cc b/test/common/grpc/async_client_manager_impl_test.cc index c047970fc968..8d3c15f0a9fd 100644 --- a/test/common/grpc/async_client_manager_impl_test.cc +++ b/test/common/grpc/async_client_manager_impl_test.cc @@ -4,11 +4,11 @@ #include "test/mocks/stats/mocks.h" #include "test/mocks/thread_local/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using ::testing::Return; @@ -16,7 +16,7 @@ namespace Envoy { namespace Grpc { namespace { -class AsyncClientManagerImplTest : public testing::Test { +class AsyncClientManagerImplTest : public TestBase { public: AsyncClientManagerImplTest() : api_(Api::createApiForTest(api_stats_store_)) {} diff --git a/test/common/grpc/codec_test.cc b/test/common/grpc/codec_test.cc index 99a9d2f59973..e0e6be57502d 100644 --- a/test/common/grpc/codec_test.cc +++ b/test/common/grpc/codec_test.cc @@ -8,8 +8,7 @@ #include "test/proto/helloworld.pb.h" #include "test/test_common/printers.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Grpc { diff --git a/test/common/grpc/common_test.cc b/test/common/grpc/common_test.cc index 290328a53941..34a582d35c93 100644 --- a/test/common/grpc/common_test.cc +++ b/test/common/grpc/common_test.cc @@ -5,10 +5,9 @@ #include "test/mocks/upstream/mocks.h" #include "test/proto/helloworld.pb.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Grpc { diff --git a/test/common/grpc/google_async_client_impl_test.cc b/test/common/grpc/google_async_client_impl_test.cc index abbc914c8c68..761ce43fbd61 100644 --- a/test/common/grpc/google_async_client_impl_test.cc +++ b/test/common/grpc/google_async_client_impl_test.cc @@ -8,11 +8,11 @@ #include "test/mocks/grpc/mocks.h" #include "test/mocks/tracing/mocks.h" #include "test/proto/helloworld.pb.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Return; @@ -44,7 +44,7 @@ class MockStubFactory : public GoogleStubFactory { std::shared_ptr shared_stub_{stub_}; }; -class EnvoyGoogleAsyncClientImplTest : public testing::Test { +class EnvoyGoogleAsyncClientImplTest : public TestBase { public: EnvoyGoogleAsyncClientImplTest() : stats_store_(new Stats::IsolatedStoreImpl), api_(Api::createApiForTest(*stats_store_)), diff --git a/test/common/grpc/google_grpc_creds_test.cc b/test/common/grpc/google_grpc_creds_test.cc index a9eeb2a55002..1bbb3bd35340 100644 --- a/test/common/grpc/google_grpc_creds_test.cc +++ b/test/common/grpc/google_grpc_creds_test.cc @@ -2,10 +2,9 @@ #include "test/common/grpc/utility.h" #include "test/mocks/stats/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Grpc { namespace { @@ -15,7 +14,7 @@ namespace { // of getting at the underlying state, we can at best just make sure we don't // crash, compare with nullptr and/or look at vector lengths. -class CredsUtilityTest : public testing::Test { +class CredsUtilityTest : public TestBase { public: CredsUtilityTest() : api_(Api::createApiForTest(stats_store_)) {} diff --git a/test/common/grpc/grpc_client_integration.h b/test/common/grpc/grpc_client_integration.h index a2c1ac2ca3f1..ee664f4f2f59 100644 --- a/test/common/grpc/grpc_client_integration.h +++ b/test/common/grpc/grpc_client_integration.h @@ -2,10 +2,9 @@ #include "common/common/assert.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Grpc { @@ -39,11 +38,11 @@ class BaseGrpcClientIntegrationParamTest { class GrpcClientIntegrationParamTest : public BaseGrpcClientIntegrationParamTest, - public testing::TestWithParam> { + public TestBaseWithParam> { public: ~GrpcClientIntegrationParamTest() {} static std::string protocolTestParamsToString( - const testing::TestParamInfo>& p) { + const ::testing::TestParamInfo>& p) { return absl::StrCat( (std::get<0>(p.param) == Network::Address::IpVersion::v4 ? "IPv4_" : "IPv6_"), (std::get<1>(p.param) == ClientType::GoogleGrpc ? "GoogleGrpc" : "EnvoyGrpc")); diff --git a/test/common/html/utility_test.cc b/test/common/html/utility_test.cc index 251e3508a9cb..d4954b9bf9a3 100644 --- a/test/common/html/utility_test.cc +++ b/test/common/html/utility_test.cc @@ -1,6 +1,6 @@ #include "common/html/utility.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Html { diff --git a/test/common/http/async_client_impl_test.cc b/test/common/http/async_client_impl_test.cc index ba6115bedc04..67f6b1291ea3 100644 --- a/test/common/http/async_client_impl_test.cc +++ b/test/common/http/async_client_impl_test.cc @@ -19,9 +19,9 @@ #include "test/mocks/stats/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -34,7 +34,7 @@ namespace Envoy { namespace Http { namespace { -class AsyncClientImplTest : public testing::Test { +class AsyncClientImplTest : public TestBase { public: AsyncClientImplTest() : client_(cm_.thread_local_cluster_.cluster_.info_, stats_store_, dispatcher_, local_info_, diff --git a/test/common/http/codec_client_test.cc b/test/common/http/codec_client_test.cc index 2fcddd36f255..0871311e6fbb 100644 --- a/test/common/http/codec_client_test.cc +++ b/test/common/http/codec_client_test.cc @@ -18,11 +18,11 @@ #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AtMost; @@ -38,7 +38,7 @@ using testing::Throw; namespace Envoy { namespace Http { -class CodecClientTest : public testing::Test { +class CodecClientTest : public TestBase { public: CodecClientTest() { connection_ = new NiceMock(); @@ -259,7 +259,7 @@ TEST_F(CodecClientTest, WatermarkPassthrough) { } // Test the codec getting input from a real TCP connection. -class CodecNetworkTest : public testing::TestWithParam { +class CodecNetworkTest : public TestBaseWithParam { public: CodecNetworkTest() : api_(Api::createApiForTest(stats_store_)) { dispatcher_ = std::make_unique(test_time_.timeSystem(), *api_); diff --git a/test/common/http/codes_test.cc b/test/common/http/codes_test.cc index b209d6ce74e3..598bd008f6ff 100644 --- a/test/common/http/codes_test.cc +++ b/test/common/http/codes_test.cc @@ -11,10 +11,10 @@ #include "test/mocks/stats/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Property; @@ -22,7 +22,7 @@ using testing::Property; namespace Envoy { namespace Http { -class CodeUtilityTest : public testing::Test { +class CodeUtilityTest : public TestBase { public: void addResponse(uint64_t code, bool canary, bool internal_request, const std::string& request_vhost_name = EMPTY_STRING, @@ -235,7 +235,7 @@ TEST(CodeUtilityResponseTimingTest, All) { code_stats.chargeResponseTiming(info); } -class CodeStatsTest : public testing::Test { +class CodeStatsTest : public TestBase { protected: absl::string_view stripTrailingDot(absl::string_view prefix) { return CodeStatsImpl::stripTrailingDot(prefix); diff --git a/test/common/http/conn_manager_impl_test.cc b/test/common/http/conn_manager_impl_test.cc index dd73d0334922..527bb7b86578 100644 --- a/test/common/http/conn_manager_impl_test.cc +++ b/test/common/http/conn_manager_impl_test.cc @@ -39,10 +39,10 @@ #include "test/mocks/upstream/cluster_info.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AnyNumber; @@ -60,7 +60,7 @@ using testing::Sequence; namespace Envoy { namespace Http { -class HttpConnectionManagerImplTest : public testing::Test, public ConnectionManagerConfig { +class HttpConnectionManagerImplTest : public TestBase, public ConnectionManagerConfig { public: struct RouteConfigProvider : public Router::RouteConfigProvider { RouteConfigProvider(TimeSource& time_source) : time_source_(time_source) {} diff --git a/test/common/http/conn_manager_utility_test.cc b/test/common/http/conn_manager_utility_test.cc index 3d9335d96b2e..6ede90b769f4 100644 --- a/test/common/http/conn_manager_utility_test.cc +++ b/test/common/http/conn_manager_utility_test.cc @@ -13,10 +13,10 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/ssl/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -82,7 +82,7 @@ class MockConnectionManagerConfig : public ConnectionManagerConfig { std::make_unique(); }; -class ConnectionManagerUtilityTest : public testing::Test { +class ConnectionManagerUtilityTest : public TestBase { public: ConnectionManagerUtilityTest() { ON_CALL(config_, userAgent()).WillByDefault(ReturnRef(user_agent_)); diff --git a/test/common/http/date_provider_impl_test.cc b/test/common/http/date_provider_impl_test.cc index ea037ee0f8d9..352554cd520e 100644 --- a/test/common/http/date_provider_impl_test.cc +++ b/test/common/http/date_provider_impl_test.cc @@ -6,9 +6,9 @@ #include "test/mocks/event/mocks.h" #include "test/mocks/thread_local/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; diff --git a/test/common/http/header_map_impl_test.cc b/test/common/http/header_map_impl_test.cc index c8ffe6d45568..dfdb515af7fd 100644 --- a/test/common/http/header_map_impl_test.cc +++ b/test/common/http/header_map_impl_test.cc @@ -4,10 +4,9 @@ #include "common/http/header_map_impl.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using ::testing::InSequence; namespace Envoy { diff --git a/test/common/http/header_utility_test.cc b/test/common/http/header_utility_test.cc index 0d8c82d13424..b65439f7de71 100644 --- a/test/common/http/header_utility_test.cc +++ b/test/common/http/header_utility_test.cc @@ -7,10 +7,9 @@ #include "common/http/header_utility.h" #include "common/json/json_loader.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Http { diff --git a/test/common/http/http1/codec_impl_test.cc b/test/common/http/http1/codec_impl_test.cc index 3fcd62337729..74fb6280b826 100644 --- a/test/common/http/http1/codec_impl_test.cc +++ b/test/common/http/http1/codec_impl_test.cc @@ -13,9 +13,9 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/network/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -28,7 +28,7 @@ namespace Envoy { namespace Http { namespace Http1 { -class Http1ServerConnectionImplTest : public ::testing::Test { +class Http1ServerConnectionImplTest : public TestBase { public: void initialize() { codec_ = std::make_unique(connection_, callbacks_, codec_settings_); @@ -671,7 +671,7 @@ TEST_F(Http1ServerConnectionImplTest, WatermarkTest) { ->onUnderlyingConnectionBelowWriteBufferLowWatermark(); } -class Http1ClientConnectionImplTest : public testing::Test { +class Http1ClientConnectionImplTest : public TestBase { public: void initialize() { codec_ = std::make_unique(connection_, callbacks_); } diff --git a/test/common/http/http1/conn_pool_test.cc b/test/common/http/http1/conn_pool_test.cc index ddcd230d5001..40c3994e9688 100644 --- a/test/common/http/http1/conn_pool_test.cc +++ b/test/common/http/http1/conn_pool_test.cc @@ -17,11 +17,11 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::DoAll; @@ -124,7 +124,7 @@ class ConnPoolImplForTest : public ConnPoolImpl { /** * Test fixture for all connection pool tests. */ -class Http1ConnPoolImplTest : public testing::Test { +class Http1ConnPoolImplTest : public TestBase { public: Http1ConnPoolImplTest() : upstream_ready_timer_(new NiceMock(&dispatcher_)), diff --git a/test/common/http/http2/codec_impl_test.cc b/test/common/http/http2/codec_impl_test.cc index ea41227ac65e..a20bfda08d15 100644 --- a/test/common/http/http2/codec_impl_test.cc +++ b/test/common/http/http2/codec_impl_test.cc @@ -12,10 +12,10 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/network/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AnyNumber; @@ -51,7 +51,7 @@ class TestClientConnectionImpl : public ClientConnectionImpl { using ClientConnectionImpl::getStream; }; -class Http2CodecImplTest : public testing::TestWithParam { +class Http2CodecImplTest : public TestBaseWithParam { public: struct ConnectionWrapper { void dispatch(const Buffer::Instance& data, ConnectionImpl& connection) { diff --git a/test/common/http/http2/conn_pool_test.cc b/test/common/http/http2/conn_pool_test.cc index 9e67df328a16..0402277c88f0 100644 --- a/test/common/http/http2/conn_pool_test.cc +++ b/test/common/http/http2/conn_pool_test.cc @@ -15,10 +15,10 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::DoAll; @@ -54,7 +54,7 @@ class TestConnPoolImpl : public ConnPoolImpl { class ActiveTestRequest; -class Http2ConnPoolImplTest : public testing::Test { +class Http2ConnPoolImplTest : public TestBase { public: struct TestCodecClient { Http::MockClientConnection* codec_; diff --git a/test/common/http/http2/metadata_encoder_decoder_test.cc b/test/common/http/http2/metadata_encoder_decoder_test.cc index e65d27229c7a..10e1023bbf5b 100644 --- a/test/common/http/http2/metadata_encoder_decoder_test.cc +++ b/test/common/http/http2/metadata_encoder_decoder_test.cc @@ -4,8 +4,9 @@ #include "common/http/http2/metadata_encoder.h" #include "common/runtime/runtime_impl.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "nghttp2/nghttp2.h" // A global variable in nghttp2 to disable preface and initial settings for tests. @@ -80,7 +81,7 @@ static ssize_t send_callback(nghttp2_session* session, const uint8_t* buf, size_ } } // namespace -class MetadataEncoderDecoderTest : public ::testing::Test { +class MetadataEncoderDecoderTest : public TestBase { public: void initialize(MetadataCallback cb) { decoder_ = std::make_unique(cb); diff --git a/test/common/http/user_agent_test.cc b/test/common/http/user_agent_test.cc index d69b99c84051..d5a5a04a2f2e 100644 --- a/test/common/http/user_agent_test.cc +++ b/test/common/http/user_agent_test.cc @@ -5,10 +5,9 @@ #include "test/mocks/stats/mocks.h" #include "test/test_common/printers.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::_; using testing::NiceMock; using testing::Property; diff --git a/test/common/http/utility_test.cc b/test/common/http/utility_test.cc index 06a737da93ef..bd825d86acce 100644 --- a/test/common/http/utility_test.cc +++ b/test/common/http/utility_test.cc @@ -10,10 +10,9 @@ #include "test/mocks/http/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::_; using testing::Invoke; using testing::InvokeWithoutArgs; diff --git a/test/common/json/config_schemas_test.cc b/test/common/json/config_schemas_test.cc index 703c1afa712d..5a4d6eba6dc8 100644 --- a/test/common/json/config_schemas_test.cc +++ b/test/common/json/config_schemas_test.cc @@ -7,10 +7,10 @@ #include "common/stats/isolated_store_impl.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; @@ -27,7 +27,7 @@ std::vector generateTestInputs() { return file_list; } -class ConfigSchemasTest : public ::testing::TestWithParam { +class ConfigSchemasTest : public TestBaseWithParam { protected: ConfigSchemasTest() : api_(Api::createApiForTest(stats_store_)) {} diff --git a/test/common/json/json_loader_test.cc b/test/common/json/json_loader_test.cc index 82659a950c12..2846fa4f0a55 100644 --- a/test/common/json/json_loader_test.cc +++ b/test/common/json/json_loader_test.cc @@ -4,14 +4,13 @@ #include "common/json/json_loader.h" #include "common/stats/isolated_store_impl.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Json { -class JsonLoaderTest : public testing::Test { +class JsonLoaderTest : public TestBase { protected: JsonLoaderTest() : api_(Api::createApiForTest(stats_store_)) {} diff --git a/test/common/memory/debug_test.cc b/test/common/memory/debug_test.cc index 6dfeca6cd67e..694a4cfa89cc 100644 --- a/test/common/memory/debug_test.cc +++ b/test/common/memory/debug_test.cc @@ -1,6 +1,6 @@ #include "common/memory/stats.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Memory { diff --git a/test/common/network/address_impl_test.cc b/test/common/network/address_impl_test.cc index c64538942915..8cae44fe9589 100644 --- a/test/common/network/address_impl_test.cc +++ b/test/common/network/address_impl_test.cc @@ -18,10 +18,9 @@ #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Network { namespace Address { @@ -107,7 +106,7 @@ void testSocketBindAndConnect(Network::Address::IpVersion ip_version, bool v6onl } } // namespace -class AddressImplSocketTest : public testing::TestWithParam {}; +class AddressImplSocketTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpVersions, AddressImplSocketTest, testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), TestUtility::ipTestParamsToString); @@ -431,7 +430,7 @@ struct TestCase { uint32_t port_; // Ignored for Pipe }; -class MixedAddressTest : public testing::TestWithParam<::testing::tuple> { +class MixedAddressTest : public TestBaseWithParam<::testing::tuple> { public: protected: InstanceConstSharedPtr testCaseToInstance(const struct TestCase& test_case) { diff --git a/test/common/network/cidr_range_test.cc b/test/common/network/cidr_range_test.cc index 3636c530f97a..e9df0bddb664 100644 --- a/test/common/network/cidr_range_test.cc +++ b/test/common/network/cidr_range_test.cc @@ -11,7 +11,7 @@ #include "common/network/cidr_range.h" #include "common/network/utility.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" // We are adding things into the std namespace. // Note that this is technically undefined behavior! diff --git a/test/common/network/connection_impl_test.cc b/test/common/network/connection_impl_test.cc index 2f329456e17d..9f8667b03082 100644 --- a/test/common/network/connection_impl_test.cc +++ b/test/common/network/connection_impl_test.cc @@ -22,10 +22,10 @@ #include "test/test_common/network_utility.h" #include "test/test_common/printers.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AnyNumber; @@ -72,7 +72,7 @@ TEST(ConnectionImplUtility, updateBufferStats) { ConnectionImplUtility::updateBufferStats(3, 3, previous_total, counter, gauge); } -class ConnectionImplDeathTest : public testing::TestWithParam {}; +class ConnectionImplDeathTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpVersions, ConnectionImplDeathTest, testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), TestUtility::ipTestParamsToString); @@ -90,7 +90,7 @@ TEST_P(ConnectionImplDeathTest, BadFd) { ".*assert failure: ioHandle\\(\\).fd\\(\\) != -1.*"); } -class ConnectionImplTest : public testing::TestWithParam { +class ConnectionImplTest : public TestBaseWithParam { public: ConnectionImplTest() : api_(Api::createApiForTest(stats_store_)) {} @@ -1229,7 +1229,7 @@ class FakeReadFilter : public Network::ReadFilter { private: ReadFilterCallbacks* callbacks_{nullptr}; }; -class MockTransportConnectionImplTest : public testing::Test { +class MockTransportConnectionImplTest : public TestBase { public: MockTransportConnectionImplTest() { EXPECT_CALL(dispatcher_.buffer_factory_, create_(_, _)) @@ -1643,7 +1643,7 @@ TEST_P(ReadBufferLimitTest, SomeLimit) { readBufferLimitTest(read_buffer_limit, read_buffer_limit - 1 + 16384); } -class TcpClientConnectionImplTest : public testing::TestWithParam { +class TcpClientConnectionImplTest : public TestBaseWithParam { protected: TcpClientConnectionImplTest() : api_(Api::createApiForTest(stats_store_)), dispatcher_(time_system_, *api_) {} @@ -1688,7 +1688,7 @@ TEST_P(TcpClientConnectionImplTest, BadConnectConnRefused) { dispatcher_.run(Event::Dispatcher::RunType::Block); } -class PipeClientConnectionImplTest : public testing::Test { +class PipeClientConnectionImplTest : public TestBase { protected: PipeClientConnectionImplTest() : api_(Api::createApiForTest(stats_store_)), dispatcher_(time_system_, *api_) {} diff --git a/test/common/network/dns_impl_test.cc b/test/common/network/dns_impl_test.cc index 3e74ab351163..37cf0080bbc2 100644 --- a/test/common/network/dns_impl_test.cc +++ b/test/common/network/dns_impl_test.cc @@ -26,12 +26,12 @@ #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "ares.h" #include "ares_dns.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -323,7 +323,7 @@ class DnsResolverImplPeer { DnsResolverImpl* resolver_; }; -class DnsImplConstructor : public testing::Test { +class DnsImplConstructor : public TestBase { protected: DnsImplConstructor() : api_(Api::createApiForTest(stats_store_)), dispatcher_(test_time_.timeSystem(), *api_) {} @@ -405,7 +405,7 @@ TEST_F(DnsImplConstructor, BadCustomResolvers) { "DNS resolver 'foo' is not an IP address"); } -class DnsImplTest : public testing::TestWithParam { +class DnsImplTest : public TestBaseWithParam { public: DnsImplTest() : api_(Api::createApiForTest(stats_store_)), dispatcher_(test_time_.timeSystem(), *api_) {} diff --git a/test/common/network/filter_manager_impl_test.cc b/test/common/network/filter_manager_impl_test.cc index 5f5f1a63db88..54d12d38debc 100644 --- a/test/common/network/filter_manager_impl_test.cc +++ b/test/common/network/filter_manager_impl_test.cc @@ -20,9 +20,9 @@ #include "test/mocks/upstream/host.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -34,7 +34,7 @@ using testing::WithArgs; namespace Envoy { namespace Network { -class NetworkFilterManagerTest : public testing::Test, public BufferSource { +class NetworkFilterManagerTest : public TestBase, public BufferSource { public: StreamBuffer getReadBuffer() override { return {read_buffer_, read_end_stream_}; } StreamBuffer getWriteBuffer() override { return {write_buffer_, write_end_stream_}; } diff --git a/test/common/network/lc_trie_test.cc b/test/common/network/lc_trie_test.cc index 75b93e2dee1a..d7383b952f7a 100644 --- a/test/common/network/lc_trie_test.cc +++ b/test/common/network/lc_trie_test.cc @@ -5,15 +5,14 @@ #include "common/network/cidr_range.h" #include "common/network/lc_trie.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Network { namespace LcTrie { -class LcTrieTest : public testing::Test { +class LcTrieTest : public TestBase { public: void setup(const std::vector>& cidr_range_strings, bool exclusive = false, double fill_factor = 0, uint32_t root_branch_factor = 0) { diff --git a/test/common/network/listen_socket_impl_test.cc b/test/common/network/listen_socket_impl_test.cc index 8a4d787d8eb5..285a829f76fc 100644 --- a/test/common/network/listen_socket_impl_test.cc +++ b/test/common/network/listen_socket_impl_test.cc @@ -5,10 +5,9 @@ #include "test/mocks/network/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::_; using testing::Return; @@ -16,7 +15,7 @@ namespace Envoy { namespace Network { template -class ListenSocketImplTest : public testing::TestWithParam { +class ListenSocketImplTest : public TestBaseWithParam { protected: ListenSocketImplTest() : version_(GetParam()) {} const Address::IpVersion version_; diff --git a/test/common/network/listener_impl_test.cc b/test/common/network/listener_impl_test.cc index 2e0409319997..0e20d0f10363 100644 --- a/test/common/network/listener_impl_test.cc +++ b/test/common/network/listener_impl_test.cc @@ -6,11 +6,11 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -55,7 +55,7 @@ static void errorCallbackTest(Address::IpVersion version) { dispatcher.run(Event::Dispatcher::RunType::Block); } -class ListenerImplDeathTest : public testing::TestWithParam {}; +class ListenerImplDeathTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpVersions, ListenerImplDeathTest, testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), TestUtility::ipTestParamsToString); @@ -73,7 +73,7 @@ class TestListenerImpl : public ListenerImpl { MOCK_METHOD1(getLocalAddress, Address::InstanceConstSharedPtr(int fd)); }; -class ListenerImplTest : public testing::TestWithParam { +class ListenerImplTest : public TestBaseWithParam { protected: ListenerImplTest() : version_(GetParam()), diff --git a/test/common/network/resolver_impl_test.cc b/test/common/network/resolver_impl_test.cc index 3a7496ea09b5..e47534d03a0c 100644 --- a/test/common/network/resolver_impl_test.cc +++ b/test/common/network/resolver_impl_test.cc @@ -14,14 +14,13 @@ #include "test/mocks/network/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/registry.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Network { namespace Address { -class IpResolverTest : public testing::Test { +class IpResolverTest : public TestBase { public: Resolver* resolver_{Registry::FactoryRegistry::getFactory("envoy.ip")}; }; diff --git a/test/common/network/socket_option_factory_test.cc b/test/common/network/socket_option_factory_test.cc index 7ba8f53d1e51..4529316408e2 100644 --- a/test/common/network/socket_option_factory_test.cc +++ b/test/common/network/socket_option_factory_test.cc @@ -4,16 +4,15 @@ #include "test/mocks/api/mocks.h" #include "test/mocks/network/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" -#include "gtest/gtest.h" - using testing::_; namespace Envoy { namespace Network { -class SocketOptionFactoryTest : public testing::Test { +class SocketOptionFactoryTest : public TestBase { public: SocketOptionFactoryTest() = default; diff --git a/test/common/network/socket_option_test.h b/test/common/network/socket_option_test.h index fb218b015c3e..0399ba981ca0 100644 --- a/test/common/network/socket_option_test.h +++ b/test/common/network/socket_option_test.h @@ -6,10 +6,9 @@ #include "test/mocks/api/mocks.h" #include "test/mocks/network/mocks.h" #include "test/test_common/logging.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" -#include "gtest/gtest.h" - using testing::_; using testing::Invoke; using testing::NiceMock; @@ -19,7 +18,7 @@ namespace Envoy { namespace Network { namespace { -class SocketOptionTest : public testing::Test { +class SocketOptionTest : public TestBase { public: SocketOptionTest() { socket_.local_address_.reset(); } diff --git a/test/common/network/udp_listener_impl_test.cc b/test/common/network/udp_listener_impl_test.cc index d9262e2dc052..6c9e9b192652 100644 --- a/test/common/network/udp_listener_impl_test.cc +++ b/test/common/network/udp_listener_impl_test.cc @@ -10,11 +10,11 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -36,7 +36,7 @@ class TestUdpListenerImpl : public UdpListenerImpl { } }; -class ListenerImplTest : public testing::TestWithParam { +class ListenerImplTest : public TestBaseWithParam { protected: ListenerImplTest() : version_(GetParam()), diff --git a/test/common/network/utility_test.cc b/test/common/network/utility_test.cc index 675093150d30..91007b4b62c7 100644 --- a/test/common/network/utility_test.cc +++ b/test/common/network/utility_test.cc @@ -11,10 +11,9 @@ #include "test/mocks/network/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Network { @@ -154,7 +153,7 @@ TEST(NetworkUtility, ParseInternetAddressAndPort) { EXPECT_EQ("[::1]:0", Utility::parseInternetAddressAndPort("[::1]:0")->asString()); } -class NetworkUtilityGetLocalAddress : public testing::TestWithParam {}; +class NetworkUtilityGetLocalAddress : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpVersions, NetworkUtilityGetLocalAddress, testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), diff --git a/test/common/protobuf/utility_test.cc b/test/common/protobuf/utility_test.cc index bdedbed7f78f..58d4c00d2d12 100644 --- a/test/common/protobuf/utility_test.cc +++ b/test/common/protobuf/utility_test.cc @@ -8,13 +8,12 @@ #include "common/stats/isolated_store_impl.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { -class ProtobufUtilityTest : public testing::Test { +class ProtobufUtilityTest : public TestBase { protected: ProtobufUtilityTest() : api_(Api::createApiForTest(stats_store_)) {} @@ -338,7 +337,7 @@ TEST(DurationUtilTest, OutOfRange) { } } -class TimestampUtilTest : public ::testing::Test, public ::testing::WithParamInterface {}; +class TimestampUtilTest : public TestBase, public ::testing::WithParamInterface {}; TEST_P(TimestampUtilTest, SystemClockToTimestampTest) { // Generate an input time_point, diff --git a/test/common/router/config_impl_test.cc b/test/common/router/config_impl_test.cc index 96499d1ee066..40a2a9636a41 100644 --- a/test/common/router/config_impl_test.cc +++ b/test/common/router/config_impl_test.cc @@ -24,10 +24,10 @@ #include "test/test_common/environment.h" #include "test/test_common/printers.h" #include "test/test_common/registry.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::ContainerEq; @@ -111,7 +111,7 @@ class ConfigImplTestBase { NiceMock factory_context_; }; -class RouteMatcherTest : public testing::Test, public ConfigImplTestBase {}; +class RouteMatcherTest : public TestBase, public ConfigImplTestBase {}; TEST_F(RouteMatcherTest, TestRoutes) { const std::string json = R"EOF( @@ -1382,7 +1382,7 @@ TEST_F(RouteMatcherTest, InvalidQueryParamMatchedRoutingConfig) { EnvoyException, "Invalid regex"); } -class RouterMatcherHashPolicyTest : public testing::Test, public ConfigImplTestBase { +class RouterMatcherHashPolicyTest : public TestBase, public ConfigImplTestBase { protected: RouterMatcherHashPolicyTest() : add_cookie_nop_( @@ -2220,7 +2220,7 @@ TEST_F(RouteMatcherTest, Shadow) { .runtimeKey()); } -class RouteConfigurationV2 : public testing::Test, public ConfigImplTestBase {}; +class RouteConfigurationV2 : public TestBase, public ConfigImplTestBase {}; TEST_F(RouteConfigurationV2, RequestMirrorPolicy) { const std::string yaml = R"EOF( @@ -3629,7 +3629,7 @@ TEST(NullConfigImplTest, All) { EXPECT_EQ("", config.name()); } -class BadHttpRouteConfigurationsTest : public testing::Test, public ConfigImplTestBase {}; +class BadHttpRouteConfigurationsTest : public TestBase, public ConfigImplTestBase {}; TEST_F(BadHttpRouteConfigurationsTest, BadRouteConfig) { const std::string json = R"EOF( @@ -3875,7 +3875,7 @@ TEST_F(RouteMatcherTest, TestOpaqueConfig) { EXPECT_EQ(opaque_config.find("name2")->second, "value2"); } -class RoutePropertyTest : public testing::Test, public ConfigImplTestBase {}; +class RoutePropertyTest : public TestBase, public ConfigImplTestBase {}; TEST_F(RoutePropertyTest, excludeVHRateLimits) { std::string json = R"EOF( @@ -4225,7 +4225,7 @@ TEST_F(RouteMatcherTest, Decorator) { } } -class CustomRequestHeadersTest : public testing::Test, public ConfigImplTestBase {}; +class CustomRequestHeadersTest : public TestBase, public ConfigImplTestBase {}; TEST_F(CustomRequestHeadersTest, AddNewHeader) { const std::string json = R"EOF( @@ -4406,7 +4406,7 @@ TEST(MetadataMatchCriteriaImpl, Merge) { EXPECT_EQ((*it)->value().value().string_value(), "override3"); } -class RouteEntryMetadataMatchTest : public testing::Test, public ConfigImplTestBase {}; +class RouteEntryMetadataMatchTest : public TestBase, public ConfigImplTestBase {}; TEST_F(RouteEntryMetadataMatchTest, ParsesMetadata) { auto route_config = envoy::api::v2::RouteConfiguration(); @@ -4518,7 +4518,7 @@ TEST_F(RouteEntryMetadataMatchTest, ParsesMetadata) { } } -class ConfigUtilityTest : public testing::Test, public ConfigImplTestBase {}; +class ConfigUtilityTest : public TestBase, public ConfigImplTestBase {}; TEST_F(ConfigUtilityTest, ParseResponseCode) { const std::vector< @@ -5247,7 +5247,7 @@ name: RetriableStatusCodes EXPECT_NE(predicates1, predicates2); } -class PerFilterConfigsTest : public testing::Test, public ConfigImplTestBase { +class PerFilterConfigsTest : public TestBase, public ConfigImplTestBase { public: PerFilterConfigsTest() : factory_(), registered_factory_(factory_), default_factory_(), diff --git a/test/common/router/header_formatter_test.cc b/test/common/router/header_formatter_test.cc index 327a9e807664..58a8c9b37d35 100644 --- a/test/common/router/header_formatter_test.cc +++ b/test/common/router/header_formatter_test.cc @@ -15,10 +15,10 @@ #include "test/common/stream_info/test_int_accessor.h" #include "test/mocks/http/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; using testing::Return; @@ -33,7 +33,7 @@ static envoy::api::v2::route::Route parseRouteFromV2Yaml(const std::string& yaml return route; } -class StreamInfoHeaderFormatterTest : public testing::Test { +class StreamInfoHeaderFormatterTest : public TestBase { public: void testFormatting(const Envoy::StreamInfo::MockStreamInfo& stream_info, const std::string& variable, const std::string& expected_output) { diff --git a/test/common/router/rds_impl_test.cc b/test/common/router/rds_impl_test.cc index 7fa8cac0dc85..19171f44d5e0 100644 --- a/test/common/router/rds_impl_test.cc +++ b/test/common/router/rds_impl_test.cc @@ -21,10 +21,10 @@ #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -47,7 +47,7 @@ parseHttpConnectionManagerFromJson(const std::string& json_string, const Stats:: return http_connection_manager; } -class RdsTestBase : public testing::Test { +class RdsTestBase : public TestBase { public: RdsTestBase() : request_(&factory_context_.cluster_manager_.async_client_) {} diff --git a/test/common/router/retry_state_impl_test.cc b/test/common/router/retry_state_impl_test.cc index 61acbeaf199b..f418c98922ca 100644 --- a/test/common/router/retry_state_impl_test.cc +++ b/test/common/router/retry_state_impl_test.cc @@ -11,10 +11,10 @@ #include "test/mocks/stats/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -23,7 +23,7 @@ using testing::Return; namespace Envoy { namespace Router { -class RouterRetryStateImplTest : public testing::Test { +class RouterRetryStateImplTest : public TestBase { public: RouterRetryStateImplTest() : callback_([this]() -> void { callback_ready_.ready(); }) { ON_CALL(runtime_.snapshot_, featureEnabled("upstream.use_retry", 100)) diff --git a/test/common/router/router_ratelimit_test.cc b/test/common/router/router_ratelimit_test.cc index ae5a104aec3f..9ec8c79c1903 100644 --- a/test/common/router/router_ratelimit_test.cc +++ b/test/common/router/router_ratelimit_test.cc @@ -14,10 +14,10 @@ #include "test/mocks/router/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -97,7 +97,7 @@ static Http::TestHeaderMapImpl genHeaders(const std::string& host, const std::st return Http::TestHeaderMapImpl{{":authority", host}, {":path", path}, {":method", method}}; } -class RateLimitConfiguration : public testing::Test { +class RateLimitConfiguration : public TestBase { public: void SetUpTest(const std::string json) { envoy::api::v2::RouteConfiguration route_config; @@ -343,7 +343,7 @@ TEST_F(RateLimitConfiguration, Stages) { EXPECT_TRUE(rate_limits.empty()); } -class RateLimitPolicyEntryTest : public testing::Test { +class RateLimitPolicyEntryTest : public TestBase { public: void SetUpTest(const std::string json) { rate_limit_entry_ = std::make_unique(parseRateLimitFromJson(json)); diff --git a/test/common/router/router_test.cc b/test/common/router/router_test.cc index c237bebacde0..ce54d1c0c353 100644 --- a/test/common/router/router_test.cc +++ b/test/common/router/router_test.cc @@ -24,11 +24,11 @@ #include "test/mocks/upstream/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AssertionFailure; @@ -74,7 +74,7 @@ class TestFilter : public Filter { bool reject_all_hosts_ = false; }; -class RouterTestBase : public testing::Test { +class RouterTestBase : public TestBase { public: RouterTestBase(bool start_child_span, bool suppress_envoy_headers) : shadow_writer_(new MockShadowWriter()), diff --git a/test/common/router/router_upstream_log_test.cc b/test/common/router/router_upstream_log_test.cc index 64210156df15..8bf7069a6e14 100644 --- a/test/common/router/router_upstream_log_test.cc +++ b/test/common/router/router_upstream_log_test.cc @@ -16,11 +16,11 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/server/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/types/optional.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -72,7 +72,7 @@ class TestFilter : public Filter { MockRetryState* retry_state_{}; }; -class RouterUpstreamLogTest : public testing::Test { +class RouterUpstreamLogTest : public TestBase { public: RouterUpstreamLogTest() {} diff --git a/test/common/router/shadow_writer_impl_test.cc b/test/common/router/shadow_writer_impl_test.cc index adf0cf593ea2..eb2859ca5644 100644 --- a/test/common/router/shadow_writer_impl_test.cc +++ b/test/common/router/shadow_writer_impl_test.cc @@ -6,9 +6,9 @@ #include "common/router/shadow_writer_impl.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -18,7 +18,7 @@ using testing::Return; namespace Envoy { namespace Router { -class ShadowWriterImplTest : public testing::Test { +class ShadowWriterImplTest : public TestBase { public: void expectShadowWriter(absl::string_view host, absl::string_view shadowed_host) { Http::MessagePtr message(new Http::RequestMessageImpl()); diff --git a/test/common/router/string_accessor_impl_test.cc b/test/common/router/string_accessor_impl_test.cc index 4138980f8b36..6cfe54ad8c42 100644 --- a/test/common/router/string_accessor_impl_test.cc +++ b/test/common/router/string_accessor_impl_test.cc @@ -1,7 +1,8 @@ #include "common/router/string_accessor_impl.h" +#include "test/test_common/test_base.h" + #include "absl/strings/string_view.h" -#include "gtest/gtest.h" namespace Envoy { namespace Router { diff --git a/test/common/runtime/runtime_impl_test.cc b/test/common/runtime/runtime_impl_test.cc index 74a5f7b0c8b7..aa99434d3bef 100644 --- a/test/common/runtime/runtime_impl_test.cc +++ b/test/common/runtime/runtime_impl_test.cc @@ -9,9 +9,9 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/thread_local/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -63,7 +63,7 @@ TEST(UUID, sanityCheckOfUniqueness) { EXPECT_EQ(num_of_uuids, uuids.size()); } -class DiskBackedLoaderImplTest : public testing::Test { +class DiskBackedLoaderImplTest : public TestBase { protected: DiskBackedLoaderImplTest() : api_(Api::createApiForTest(store)) {} @@ -260,7 +260,7 @@ TEST(LoaderImplTest, All) { testNewOverrides(loader, store); } -class DiskLayerTest : public testing::Test { +class DiskLayerTest : public TestBase { protected: DiskLayerTest() : api_(Api::createApiForTest(store_)) {} diff --git a/test/common/runtime/uuid_util_test.cc b/test/common/runtime/uuid_util_test.cc index 8596783038a5..fff1b87b6651 100644 --- a/test/common/runtime/uuid_util_test.cc +++ b/test/common/runtime/uuid_util_test.cc @@ -3,7 +3,7 @@ #include "common/runtime/runtime_impl.h" #include "common/runtime/uuid_util.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { TEST(UUIDUtilsTest, mod) { diff --git a/test/common/secret/sds_api_test.cc b/test/common/secret/sds_api_test.cc index 7c11e3730f36..39808f24d432 100644 --- a/test/common/secret/sds_api_test.cc +++ b/test/common/secret/sds_api_test.cc @@ -13,10 +13,10 @@ #include "test/mocks/secret/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using ::testing::_; using ::testing::Invoke; @@ -26,7 +26,7 @@ namespace Envoy { namespace Secret { namespace { -class SdsApiTest : public testing::Test { +class SdsApiTest : public TestBase { protected: SdsApiTest() : api_(Api::createApiForTest(stats_store_)) {} diff --git a/test/common/secret/secret_manager_impl_test.cc b/test/common/secret/secret_manager_impl_test.cc index 8b50f6678ecb..7b3aa38238f6 100644 --- a/test/common/secret/secret_manager_impl_test.cc +++ b/test/common/secret/secret_manager_impl_test.cc @@ -10,10 +10,10 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::Return; using testing::ReturnRef; @@ -22,7 +22,7 @@ namespace Envoy { namespace Secret { namespace { -class SecretManagerImplTest : public testing::Test { +class SecretManagerImplTest : public TestBase { protected: SecretManagerImplTest() : api_(Api::createApiForTest(stats_store_)) {} diff --git a/test/common/singleton/threadsafe_singleton_test.cc b/test/common/singleton/threadsafe_singleton_test.cc index a9172aceade7..984e95c25ff0 100644 --- a/test/common/singleton/threadsafe_singleton_test.cc +++ b/test/common/singleton/threadsafe_singleton_test.cc @@ -5,11 +5,10 @@ #include "common/singleton/threadsafe_singleton.h" #include "common/stats/isolated_store_impl.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { class TestSingleton { diff --git a/test/common/stats/heap_stat_data_test.cc b/test/common/stats/heap_stat_data_test.cc index eac2c123ff2b..6293df616a4e 100644 --- a/test/common/stats/heap_stat_data_test.cc +++ b/test/common/stats/heap_stat_data_test.cc @@ -4,8 +4,7 @@ #include "common/stats/stats_options_impl.h" #include "test/test_common/logging.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Stats { diff --git a/test/common/stats/isolated_store_impl_test.cc b/test/common/stats/isolated_store_impl_test.cc index b2aaa80693fd..ffb206909422 100644 --- a/test/common/stats/isolated_store_impl_test.cc +++ b/test/common/stats/isolated_store_impl_test.cc @@ -4,9 +4,10 @@ #include "common/stats/isolated_store_impl.h" +#include "test/test_common/test_base.h" + #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "gtest/gtest.h" namespace Envoy { namespace Stats { diff --git a/test/common/stats/raw_stat_data_test.cc b/test/common/stats/raw_stat_data_test.cc index 3b7b5575bfa7..d04421d10553 100644 --- a/test/common/stats/raw_stat_data_test.cc +++ b/test/common/stats/raw_stat_data_test.cc @@ -4,14 +4,13 @@ #include "common/stats/stats_options_impl.h" #include "test/test_common/logging.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Stats { -class RawStatDataTest : public testing::Test { +class RawStatDataTest : public TestBase { public: RawStatDataTest() : allocator_(stats_options_) {} diff --git a/test/common/stats/source_impl_test.cc b/test/common/stats/source_impl_test.cc index 8668626534c7..a3a8bdec9bef 100644 --- a/test/common/stats/source_impl_test.cc +++ b/test/common/stats/source_impl_test.cc @@ -3,8 +3,7 @@ #include "common/stats/source_impl.h" #include "test/mocks/stats/mocks.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::NiceMock; using testing::ReturnPointee; diff --git a/test/common/stats/stats_matcher_impl_test.cc b/test/common/stats/stats_matcher_impl_test.cc index 485560f2b702..b70db7f78ec9 100644 --- a/test/common/stats/stats_matcher_impl_test.cc +++ b/test/common/stats/stats_matcher_impl_test.cc @@ -2,17 +2,16 @@ #include "common/stats/stats_matcher_impl.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::IsFalse; using testing::IsTrue; namespace Envoy { namespace Stats { -class StatsMatcherTest : public testing::Test { +class StatsMatcherTest : public TestBase { protected: envoy::type::matcher::StringMatcher* inclusionList() { return stats_config_.mutable_stats_matcher()->mutable_inclusion_list()->add_patterns(); diff --git a/test/common/stats/symbol_table_impl_test.cc b/test/common/stats/symbol_table_impl_test.cc index 6b91a15236f4..571f2665d947 100644 --- a/test/common/stats/symbol_table_impl_test.cc +++ b/test/common/stats/symbol_table_impl_test.cc @@ -7,10 +7,10 @@ #include "test/common/stats/stat_test_utility.h" #include "test/test_common/logging.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/synchronization/blocking_counter.h" -#include "gtest/gtest.h" namespace Envoy { namespace Stats { @@ -28,7 +28,7 @@ enum class SymbolTableType { Fake, }; -class StatNameTest : public testing::TestWithParam { +class StatNameTest : public TestBaseWithParam { protected: StatNameTest() { switch (GetParam()) { diff --git a/test/common/stats/tag_extractor_impl_test.cc b/test/common/stats/tag_extractor_impl_test.cc index 4fe93839194b..d47b8610cee8 100644 --- a/test/common/stats/tag_extractor_impl_test.cc +++ b/test/common/stats/tag_extractor_impl_test.cc @@ -7,10 +7,9 @@ #include "common/stats/tag_extractor_impl.h" #include "common/stats/tag_producer_impl.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Stats { diff --git a/test/common/stats/tag_producer_impl_test.cc b/test/common/stats/tag_producer_impl_test.cc index d97819ed4e9c..965003f09d9d 100644 --- a/test/common/stats/tag_producer_impl_test.cc +++ b/test/common/stats/tag_producer_impl_test.cc @@ -3,10 +3,9 @@ #include "common/config/well_known_names.h" #include "common/stats/tag_producer_impl.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Stats { diff --git a/test/common/stats/thread_local_store_test.cc b/test/common/stats/thread_local_store_test.cc index 7d69bf0abae5..f13ed96ca61c 100644 --- a/test/common/stats/thread_local_store_test.cc +++ b/test/common/stats/thread_local_store_test.cc @@ -17,11 +17,11 @@ #include "test/mocks/stats/mocks.h" #include "test/mocks/thread_local/mocks.h" #include "test/test_common/logging.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/strings/str_split.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -33,7 +33,7 @@ using testing::Return; namespace Envoy { namespace Stats { -class StatsThreadLocalStoreTest : public testing::Test { +class StatsThreadLocalStoreTest : public TestBase { public: void SetUp() override { alloc_ = std::make_unique(options_); @@ -71,7 +71,7 @@ class HistogramWrapper { histogram_t* histogram_; }; -class HistogramTest : public testing::Test { +class HistogramTest : public TestBase { public: typedef std::map NameHistogramMap; diff --git a/test/common/stream_info/filter_state_impl_test.cc b/test/common/stream_info/filter_state_impl_test.cc index 56fbbd91d00d..779077a4b94b 100644 --- a/test/common/stream_info/filter_state_impl_test.cc +++ b/test/common/stream_info/filter_state_impl_test.cc @@ -2,10 +2,9 @@ #include "common/stream_info/filter_state_impl.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace StreamInfo { namespace { @@ -44,7 +43,7 @@ class SimpleType : public FilterState::Object { int value_; }; -class FilterStateImplTest : public testing::Test { +class FilterStateImplTest : public TestBase { public: FilterStateImplTest() { resetFilterState(); } diff --git a/test/common/stream_info/stream_info_impl_test.cc b/test/common/stream_info/stream_info_impl_test.cc index 62a62166040b..d094e623ba0d 100644 --- a/test/common/stream_info/stream_info_impl_test.cc +++ b/test/common/stream_info/stream_info_impl_test.cc @@ -12,9 +12,9 @@ #include "test/common/stream_info/test_int_accessor.h" #include "test/mocks/router/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace StreamInfo { @@ -27,7 +27,7 @@ std::chrono::nanoseconds checkDuration(std::chrono::nanoseconds last, return timing.value(); } -class StreamInfoImplTest : public testing::Test { +class StreamInfoImplTest : public TestBase { protected: DangerousDeprecatedTestTime test_time_; }; diff --git a/test/common/stream_info/utility_test.cc b/test/common/stream_info/utility_test.cc index 51781b85df80..e96ddd17eab3 100644 --- a/test/common/stream_info/utility_test.cc +++ b/test/common/stream_info/utility_test.cc @@ -2,9 +2,9 @@ #include "common/stream_info/utility.h" #include "test/mocks/stream_info/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/common/tcp/conn_pool_test.cc b/test/common/tcp/conn_pool_test.cc index b3f26916eaba..84f4cd72db6b 100644 --- a/test/common/tcp/conn_pool_test.cc +++ b/test/common/tcp/conn_pool_test.cc @@ -12,10 +12,10 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::DoAll; @@ -152,7 +152,7 @@ class ConnPoolImplForTest : public ConnPoolImpl { /** * Test fixture for connection pool tests. */ -class TcpConnPoolImplTest : public testing::Test { +class TcpConnPoolImplTest : public TestBase { public: TcpConnPoolImplTest() : upstream_ready_timer_(new NiceMock(&dispatcher_)), @@ -175,7 +175,7 @@ class TcpConnPoolImplTest : public testing::Test { /** * Test fixture for connection pool destructor tests. */ -class TcpConnPoolImplDestructorTest : public testing::Test { +class TcpConnPoolImplDestructorTest : public TestBase { public: TcpConnPoolImplDestructorTest() : upstream_ready_timer_(new NiceMock(&dispatcher_)), diff --git a/test/common/tcp_proxy/tcp_proxy_test.cc b/test/common/tcp_proxy/tcp_proxy_test.cc index cb04f0bb5c12..9f1dced174f2 100644 --- a/test/common/tcp_proxy/tcp_proxy_test.cc +++ b/test/common/tcp_proxy/tcp_proxy_test.cc @@ -25,9 +25,9 @@ #include "test/mocks/upstream/host.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -346,7 +346,7 @@ TEST(ConfigTest, AccessLogConfig) { EXPECT_EQ(2, config_obj.accessLogs().size()); } -class TcpProxyTest : public testing::Test { +class TcpProxyTest : public TestBase { public: TcpProxyTest() { ON_CALL(*factory_context_.access_log_manager_.file_, write(_)) @@ -1076,7 +1076,7 @@ TEST_F(TcpProxyTest, UpstreamFlushReceiveUpstreamData) { upstream_callbacks_->onUpstreamData(buffer, false); } -class TcpProxyRoutingTest : public testing::Test { +class TcpProxyRoutingTest : public TestBase { public: TcpProxyRoutingTest() { std::string json = R"EOF( diff --git a/test/common/thread/thread_factory_singleton_test.cc b/test/common/thread/thread_factory_singleton_test.cc index d50fc69ee417..dd474ce520f8 100644 --- a/test/common/thread/thread_factory_singleton_test.cc +++ b/test/common/thread/thread_factory_singleton_test.cc @@ -2,14 +2,15 @@ #include "common/common/assert.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Thread { namespace { -class ThreadFactorySingletonTest : public testing::Test { +class ThreadFactorySingletonTest : public TestBase { protected: ThreadFactorySingletonTest() : run_tid_(Envoy::Thread::ThreadFactorySingleton::get().currentThreadId()) {} diff --git a/test/common/thread_local/thread_local_impl_test.cc b/test/common/thread_local/thread_local_impl_test.cc index 0f67f18c5022..49e228030d1a 100644 --- a/test/common/thread_local/thread_local_impl_test.cc +++ b/test/common/thread_local/thread_local_impl_test.cc @@ -23,7 +23,7 @@ class TestThreadLocalObject : public ThreadLocalObject { MOCK_METHOD0(onDestroy, void()); }; -class ThreadLocalInstanceImplTest : public testing::Test { +class ThreadLocalInstanceImplTest : public TestBase { public: ThreadLocalInstanceImplTest() { tls_.registerThread(main_dispatcher_, true); diff --git a/test/common/tracing/http_tracer_impl_test.cc b/test/common/tracing/http_tracer_impl_test.cc index ac5ad1a0ddc9..c0790a1651c2 100644 --- a/test/common/tracing/http_tracer_impl_test.cc +++ b/test/common/tracing/http_tracer_impl_test.cc @@ -18,10 +18,10 @@ #include "test/mocks/tracing/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -323,7 +323,7 @@ TEST(HttpNullTracerTest, BasicFunctionality) { EXPECT_NE(nullptr, span_ptr->spawnChild(config, "foo", SystemTime())); } -class HttpTracerImplTest : public testing::Test { +class HttpTracerImplTest : public TestBase { public: HttpTracerImplTest() { driver_ = new MockDriver(); diff --git a/test/common/upstream/cds_api_impl_test.cc b/test/common/upstream/cds_api_impl_test.cc index 3c5888235294..205611fb88c5 100644 --- a/test/common/upstream/cds_api_impl_test.cc +++ b/test/common/upstream/cds_api_impl_test.cc @@ -12,10 +12,10 @@ #include "test/mocks/local_info/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -26,7 +26,7 @@ using testing::ReturnRef; namespace Envoy { namespace Upstream { -class CdsApiImplTest : public testing::Test { +class CdsApiImplTest : public TestBase { protected: CdsApiImplTest() : request_(&cm_.async_client_), api_(Api::createApiForTest(store_)) {} diff --git a/test/common/upstream/cluster_manager_impl_test.cc b/test/common/upstream/cluster_manager_impl_test.cc index f03f9b7901c9..ade2b7b5e399 100644 --- a/test/common/upstream/cluster_manager_impl_test.cc +++ b/test/common/upstream/cluster_manager_impl_test.cc @@ -30,11 +30,11 @@ #include "test/mocks/thread_local/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -163,7 +163,7 @@ envoy::config::bootstrap::v2::Bootstrap parseBootstrapFromV2Yaml(const std::stri return bootstrap; } -class ClusterManagerImplTest : public testing::Test { +class ClusterManagerImplTest : public TestBase { public: ClusterManagerImplTest() : api_(Api::createApiForTest(stats_store_)) {} @@ -2336,7 +2336,7 @@ TEST_F(ClusterManagerImplTest, MergedUpdatesDestroyedOnUpdate) { EXPECT_EQ(0, factory_.stats_.gauge("cluster_manager.warming_clusters").value()); } -class ClusterManagerInitHelperTest : public testing::Test { +class ClusterManagerInitHelperTest : public TestBase { public: MOCK_METHOD1(onClusterInit, void(Cluster& cluster)); diff --git a/test/common/upstream/edf_scheduler_test.cc b/test/common/upstream/edf_scheduler_test.cc index ddb39bf847a0..9962b6f5cd6d 100644 --- a/test/common/upstream/edf_scheduler_test.cc +++ b/test/common/upstream/edf_scheduler_test.cc @@ -1,6 +1,6 @@ #include "common/upstream/edf_scheduler.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Upstream { diff --git a/test/common/upstream/eds_test.cc b/test/common/upstream/eds_test.cc index 8a729e80378a..be98cdf9f97e 100644 --- a/test/common/upstream/eds_test.cc +++ b/test/common/upstream/eds_test.cc @@ -15,10 +15,10 @@ #include "test/mocks/server/mocks.h" #include "test/mocks/ssl/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Return; @@ -27,7 +27,7 @@ using testing::ReturnRef; namespace Envoy { namespace Upstream { -class EdsTest : public testing::Test { +class EdsTest : public TestBase { protected: EdsTest() : api_(Api::createApiForTest(stats_)) { resetCluster(); } diff --git a/test/common/upstream/hds_test.cc b/test/common/upstream/hds_test.cc index 2f2963891d6b..501aa9aa7692 100644 --- a/test/common/upstream/hds_test.cc +++ b/test/common/upstream/hds_test.cc @@ -15,10 +15,10 @@ #include "test/mocks/server/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AtLeast; @@ -42,7 +42,7 @@ class HdsDelegateFriend { }; }; -class HdsTest : public testing::Test { +class HdsTest : public TestBase { protected: HdsTest() : retry_timer_(new Event::MockTimer()), server_response_timer_(new Event::MockTimer()), diff --git a/test/common/upstream/health_checker_impl_test.cc b/test/common/upstream/health_checker_impl_test.cc index e930588f9d4a..bf7e3b2c6575 100644 --- a/test/common/upstream/health_checker_impl_test.cc +++ b/test/common/upstream/health_checker_impl_test.cc @@ -24,10 +24,10 @@ #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::DoAll; @@ -101,7 +101,7 @@ class TestHttpHealthCheckerImpl : public HttpHealthCheckerImpl { Http::CodecClient::Type codecClientType() { return codec_client_type_; } }; -class HttpHealthCheckerImplTest : public testing::Test { +class HttpHealthCheckerImplTest : public TestBase { public: struct TestSession { TestSession() {} @@ -1969,7 +1969,7 @@ TEST(TcpHealthCheckMatcher, match) { EXPECT_TRUE(TcpHealthCheckMatcher::match(segments, buffer)); } -class TcpHealthCheckerImplTest : public testing::Test { +class TcpHealthCheckerImplTest : public TestBase { public: TcpHealthCheckerImplTest() : cluster_(new NiceMock()), event_logger_(new MockHealthCheckEventLogger()) {} @@ -2753,7 +2753,7 @@ class GrpcHealthCheckerImplTestBase { std::list codec_index_{}; }; -class GrpcHealthCheckerImplTest : public GrpcHealthCheckerImplTestBase, public testing::Test {}; +class GrpcHealthCheckerImplTest : public GrpcHealthCheckerImplTestBase, public TestBase {}; // Test single host check success. TEST_F(GrpcHealthCheckerImplTest, Success) { testSingleHostSuccess(absl::nullopt); } @@ -3382,7 +3382,7 @@ TEST_F(GrpcHealthCheckerImplTest, GoAwayBetweenChecks) { class BadResponseGrpcHealthCheckerImplTest : public GrpcHealthCheckerImplTestBase, - public testing::TestWithParam {}; + public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P( BadResponse, BadResponseGrpcHealthCheckerImplTest, diff --git a/test/common/upstream/host_utility_test.cc b/test/common/upstream/host_utility_test.cc index f6c37823d051..ce26ba708725 100644 --- a/test/common/upstream/host_utility_test.cc +++ b/test/common/upstream/host_utility_test.cc @@ -4,8 +4,7 @@ #include "test/common/upstream/utility.h" #include "test/mocks/upstream/mocks.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Upstream { diff --git a/test/common/upstream/load_balancer_impl_test.cc b/test/common/upstream/load_balancer_impl_test.cc index 3d624e6c4396..5d59c4806a1a 100644 --- a/test/common/upstream/load_balancer_impl_test.cc +++ b/test/common/upstream/load_balancer_impl_test.cc @@ -11,9 +11,9 @@ #include "test/common/upstream/utility.h" #include "test/mocks/runtime/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::ElementsAre; using testing::NiceMock; @@ -23,7 +23,7 @@ using testing::ReturnRef; namespace Envoy { namespace Upstream { -class LoadBalancerTestBase : public ::testing::TestWithParam { +class LoadBalancerTestBase : public TestBaseWithParam { protected: // Run all tests against both priority 0 and priority 1 host sets, to ensure // all the load balancers have equivalent functonality for failover host sets. diff --git a/test/common/upstream/load_balancer_simulation_test.cc b/test/common/upstream/load_balancer_simulation_test.cc index 7474b9072751..14267d825b68 100644 --- a/test/common/upstream/load_balancer_simulation_test.cc +++ b/test/common/upstream/load_balancer_simulation_test.cc @@ -11,9 +11,9 @@ #include "test/common/upstream/utility.h" #include "test/mocks/runtime/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; using testing::Return; @@ -90,7 +90,7 @@ TEST(DISABLED_LeastRequestLoadBalancerWeightTest, Weight) { /** * This test is for simulation only and should not be run as part of unit tests. */ -class DISABLED_SimulationTest : public testing::Test { +class DISABLED_SimulationTest : public TestBase { public: DISABLED_SimulationTest() : stats_(ClusterInfoImpl::generateStats(stats_store_)) { ON_CALL(runtime_.snapshot_, getInteger("upstream.healthy_panic_threshold", 50U)) diff --git a/test/common/upstream/load_stats_reporter_test.cc b/test/common/upstream/load_stats_reporter_test.cc index beed927a7170..f86024899698 100644 --- a/test/common/upstream/load_stats_reporter_test.cc +++ b/test/common/upstream/load_stats_reporter_test.cc @@ -10,10 +10,10 @@ #include "test/mocks/local_info/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -26,7 +26,7 @@ using testing::Return; namespace Envoy { namespace Upstream { -class LoadStatsReporterTest : public testing::Test { +class LoadStatsReporterTest : public TestBase { public: LoadStatsReporterTest() : retry_timer_(new Event::MockTimer()), response_timer_(new Event::MockTimer()), diff --git a/test/common/upstream/logical_dns_cluster_test.cc b/test/common/upstream/logical_dns_cluster_test.cc index 0c27abdc0fdf..9d55f81d1e5e 100644 --- a/test/common/upstream/logical_dns_cluster_test.cc +++ b/test/common/upstream/logical_dns_cluster_test.cc @@ -21,10 +21,10 @@ #include "test/mocks/ssl/mocks.h" #include "test/mocks/thread_local/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -35,7 +35,7 @@ namespace Upstream { enum class ConfigType { V2_YAML, V1_JSON }; -class LogicalDnsClusterTest : public testing::Test { +class LogicalDnsClusterTest : public TestBase { protected: LogicalDnsClusterTest() : api_(Api::createApiForTest(stats_store_)) {} diff --git a/test/common/upstream/maglev_lb_test.cc b/test/common/upstream/maglev_lb_test.cc index b0208e983619..34f196251da7 100644 --- a/test/common/upstream/maglev_lb_test.cc +++ b/test/common/upstream/maglev_lb_test.cc @@ -20,7 +20,7 @@ class TestLoadBalancerContext : public LoadBalancerContextBase { // Note: ThreadAwareLoadBalancer base is heavily tested by RingHashLoadBalancerTest. Only basic // functionality is covered here. -class MaglevLoadBalancerTest : public ::testing::Test { +class MaglevLoadBalancerTest : public TestBase { public: MaglevLoadBalancerTest() : stats_(ClusterInfoImpl::generateStats(stats_store_)) {} diff --git a/test/common/upstream/original_dst_cluster_test.cc b/test/common/upstream/original_dst_cluster_test.cc index dc6e51e3f877..f052e5d56a21 100644 --- a/test/common/upstream/original_dst_cluster_test.cc +++ b/test/common/upstream/original_dst_cluster_test.cc @@ -22,10 +22,10 @@ #include "test/mocks/server/mocks.h" #include "test/mocks/ssl/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -57,7 +57,7 @@ class TestLoadBalancerContext : public LoadBalancerContextBase { Http::HeaderMapPtr downstream_headers_; }; -class OriginalDstClusterTest : public testing::Test { +class OriginalDstClusterTest : public TestBase { public: // cleanup timer must be created before the cluster (in setup()), so that we can set expectations // on it. Ownership is transferred to the cluster at the cluster constructor, so the cluster will diff --git a/test/common/upstream/outlier_detection_impl_test.cc b/test/common/upstream/outlier_detection_impl_test.cc index 5a85a50ac346..c55da17c8619 100644 --- a/test/common/upstream/outlier_detection_impl_test.cc +++ b/test/common/upstream/outlier_detection_impl_test.cc @@ -16,10 +16,10 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "absl/types/optional.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -56,7 +56,7 @@ class CallbackChecker { MOCK_METHOD1(check, void(HostSharedPtr host)); }; -class OutlierDetectorImplTest : public testing::Test { +class OutlierDetectorImplTest : public TestBase { public: OutlierDetectorImplTest() { ON_CALL(runtime_.snapshot_, featureEnabled("outlier_detection.enforcing_consecutive_5xx", 100)) diff --git a/test/common/upstream/resource_manager_impl_test.cc b/test/common/upstream/resource_manager_impl_test.cc index 73610ab81c5f..c726700ad77a 100644 --- a/test/common/upstream/resource_manager_impl_test.cc +++ b/test/common/upstream/resource_manager_impl_test.cc @@ -5,9 +5,9 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/stats/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/common/upstream/ring_hash_lb_test.cc b/test/common/upstream/ring_hash_lb_test.cc index 0ef94dd3dd00..8f6e5234380a 100644 --- a/test/common/upstream/ring_hash_lb_test.cc +++ b/test/common/upstream/ring_hash_lb_test.cc @@ -12,9 +12,9 @@ #include "test/common/upstream/utility.h" #include "test/mocks/runtime/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -33,7 +33,7 @@ class TestLoadBalancerContext : public LoadBalancerContextBase { absl::optional hash_key_; }; -class RingHashLoadBalancerTest : public ::testing::TestWithParam { +class RingHashLoadBalancerTest : public TestBaseWithParam { public: RingHashLoadBalancerTest() : stats_(ClusterInfoImpl::generateStats(stats_store_)) {} diff --git a/test/common/upstream/subset_lb_test.cc b/test/common/upstream/subset_lb_test.cc index 49b29a98be67..a7447a226d54 100644 --- a/test/common/upstream/subset_lb_test.cc +++ b/test/common/upstream/subset_lb_test.cc @@ -17,10 +17,10 @@ #include "test/mocks/filesystem/mocks.h" #include "test/mocks/runtime/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "absl/types/optional.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::EndsWith; @@ -106,7 +106,7 @@ class TestLoadBalancerContext : public LoadBalancerContextBase { enum UpdateOrder { REMOVES_FIRST, SIMULTANEOUS }; -class SubsetLoadBalancerTest : public testing::TestWithParam { +class SubsetLoadBalancerTest : public TestBaseWithParam { public: SubsetLoadBalancerTest() : stats_(ClusterInfoImpl::generateStats(stats_store_)) { stats_.max_host_weight_.set(1UL); diff --git a/test/common/upstream/upstream_impl_test.cc b/test/common/upstream/upstream_impl_test.cc index efa170dc6e2a..a84e7b834b98 100644 --- a/test/common/upstream/upstream_impl_test.cc +++ b/test/common/upstream/upstream_impl_test.cc @@ -28,10 +28,10 @@ #include "test/mocks/ssl/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/registry.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::ContainerEq; @@ -134,7 +134,7 @@ std::vector generateStrictDnsParams() { return dns_config; } -class StrictDnsParamTest : public testing::TestWithParam, +class StrictDnsParamTest : public TestBaseWithParam, public UpstreamImplTestBase {}; INSTANTIATE_TEST_SUITE_P(DnsParam, StrictDnsParamTest, @@ -176,7 +176,7 @@ TEST_P(StrictDnsParamTest, ImmediateResolve) { EXPECT_EQ(2UL, cluster.prioritySet().hostSetsPerPriority()[0]->healthyHosts().size()); } -class StrictDnsClusterImplTest : public testing::Test, public UpstreamImplTestBase { +class StrictDnsClusterImplTest : public TestBase, public UpstreamImplTestBase { protected: std::shared_ptr dns_resolver_ = std::make_shared(); @@ -846,7 +846,7 @@ TEST(HostImplTest, HealthFlags) { EXPECT_EQ(Host::Health::Degraded, host->health()); } -class StaticClusterImplTest : public testing::Test, public UpstreamImplTestBase {}; +class StaticClusterImplTest : public TestBase, public UpstreamImplTestBase {}; TEST_F(StaticClusterImplTest, InitialHosts) { const std::string yaml = R"EOF( @@ -1446,7 +1446,7 @@ TEST_F(StaticClusterImplTest, SourceAddressPriority) { } } -class ClusterImplTest : public testing::Test, public UpstreamImplTestBase {}; +class ClusterImplTest : public TestBase, public UpstreamImplTestBase {}; // Test that the correct feature() is set when close_connections_on_host_health_failure is // configured. @@ -1532,7 +1532,7 @@ TEST(PrioritySet, Extend) { } } -class ClusterInfoImplTest : public testing::Test { +class ClusterInfoImplTest : public TestBase { public: ClusterInfoImplTest() : api_(Api::createApiForTest(stats_)) {} @@ -1976,7 +1976,7 @@ TEST(HostsPerLocalityImpl, Filter) { } } -class HostSetImplLocalityTest : public ::testing::Test { +class HostSetImplLocalityTest : public TestBase { public: LocalityWeightsConstSharedPtr locality_weights_; HostSetImpl host_set_{0, kDefaultOverProvisioningFactor}; diff --git a/test/config/utility.cc b/test/config/utility.cc index 467fa9d8b7fb..4f1e353372d7 100644 --- a/test/config/utility.cc +++ b/test/config/utility.cc @@ -12,10 +12,10 @@ #include "test/config/integration/certs/clientcert_hash.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/strings/str_replace.h" -#include "gtest/gtest.h" namespace Envoy { diff --git a/test/config_test/config_test.cc b/test/config_test/config_test.cc index f2a83ab1196b..f7efcaab4863 100644 --- a/test/config_test/config_test.cc +++ b/test/config_test/config_test.cc @@ -14,11 +14,11 @@ #include "test/integration/server.h" #include "test/mocks/server/mocks.h" #include "test/mocks/ssl/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/config_test/example_configs_test.cc b/test/config_test/example_configs_test.cc index ca85b6f1ecad..6f4c7fe4428b 100644 --- a/test/config_test/example_configs_test.cc +++ b/test/config_test/example_configs_test.cc @@ -1,9 +1,8 @@ #include "test/config_test/config_test.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { TEST(ExampleConfigsTest, All) { TestEnvironment::exec( diff --git a/test/coverage/gcc_only_test/gcc_only_test.cc b/test/coverage/gcc_only_test/gcc_only_test.cc index 31346323d20e..ced70a1e7213 100644 --- a/test/coverage/gcc_only_test/gcc_only_test.cc +++ b/test/coverage/gcc_only_test/gcc_only_test.cc @@ -1,4 +1,4 @@ -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { diff --git a/test/exe/main_common_test.cc b/test/exe/main_common_test.cc index 54f8ef9d10e2..0040171dbe53 100644 --- a/test/exe/main_common_test.cc +++ b/test/exe/main_common_test.cc @@ -11,10 +11,9 @@ #include "test/test_common/contention.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - #ifdef ENVOY_HANDLE_SIGNALS #include "exe/signal_action.h" #endif @@ -32,7 +31,7 @@ namespace Envoy { * an argv array that is terminated with nullptr. Identifies the config * file relative to $TEST_RUNDIR. */ -class MainCommonTest : public testing::TestWithParam { +class MainCommonTest : public TestBaseWithParam { protected: MainCommonTest() : config_file_(TestEnvironment::temporaryFileSubstitute( diff --git a/test/exe/signals_test.cc b/test/exe/signals_test.cc index eb07fe61370a..99ff8fa73cb9 100644 --- a/test/exe/signals_test.cc +++ b/test/exe/signals_test.cc @@ -3,10 +3,9 @@ #include "exe/signal_action.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { #if defined(__has_feature) #if __has_feature(address_sanitizer) diff --git a/test/exe/terminate_handler_test.cc b/test/exe/terminate_handler_test.cc index f37774352b3a..bb84c26ffd41 100644 --- a/test/exe/terminate_handler_test.cc +++ b/test/exe/terminate_handler_test.cc @@ -1,9 +1,8 @@ #include "exe/terminate_handler.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { TEST(TerminateHandlerDeathTest, HandlerInstalledTest) { diff --git a/test/extensions/access_loggers/file/config_test.cc b/test/extensions/access_loggers/file/config_test.cc index 14e35b40c72f..b309c55d3c1a 100644 --- a/test/extensions/access_loggers/file/config_test.cc +++ b/test/extensions/access_loggers/file/config_test.cc @@ -9,9 +9,9 @@ #include "extensions/access_loggers/well_known_names.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/access_loggers/http_grpc/config_test.cc b/test/extensions/access_loggers/http_grpc/config_test.cc index b337fe4cf9d4..5bf1e1134ed0 100644 --- a/test/extensions/access_loggers/http_grpc/config_test.cc +++ b/test/extensions/access_loggers/http_grpc/config_test.cc @@ -6,9 +6,9 @@ #include "extensions/access_loggers/well_known_names.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -19,7 +19,7 @@ namespace Extensions { namespace AccessLoggers { namespace HttpGrpc { -class HttpGrpcAccessLogConfigTest : public testing::Test { +class HttpGrpcAccessLogConfigTest : public TestBase { public: void SetUp() override { factory_ = diff --git a/test/extensions/access_loggers/http_grpc/grpc_access_log_impl_test.cc b/test/extensions/access_loggers/http_grpc/grpc_access_log_impl_test.cc index 1b5aed984b6e..ebc8fe648260 100644 --- a/test/extensions/access_loggers/http_grpc/grpc_access_log_impl_test.cc +++ b/test/extensions/access_loggers/http_grpc/grpc_access_log_impl_test.cc @@ -22,7 +22,7 @@ namespace Extensions { namespace AccessLoggers { namespace HttpGrpc { -class GrpcAccessLogStreamerImplTest : public testing::Test { +class GrpcAccessLogStreamerImplTest : public TestBase { public: typedef Grpc::MockAsyncStream MockAccessLogStream; typedef Grpc::TypedAsyncStreamCallbacks @@ -112,7 +112,7 @@ class MockGrpcAccessLogStreamer : public GrpcAccessLogStreamer { const std::string& log_name)); }; -class HttpGrpcAccessLogTest : public testing::Test { +class HttpGrpcAccessLogTest : public TestBase { public: void init() { ON_CALL(*filter_, evaluate(_, _)).WillByDefault(Return(true)); diff --git a/test/extensions/access_loggers/http_grpc/grpc_access_log_integration_test.cc b/test/extensions/access_loggers/http_grpc/grpc_access_log_integration_test.cc index 59b5b1b3f92e..16015e13764c 100644 --- a/test/extensions/access_loggers/http_grpc/grpc_access_log_integration_test.cc +++ b/test/extensions/access_loggers/http_grpc/grpc_access_log_integration_test.cc @@ -8,10 +8,9 @@ #include "test/common/grpc/grpc_client_integration.h" #include "test/integration/http_integration.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::AssertionResult; namespace Envoy { diff --git a/test/extensions/common/tap/admin_test.cc b/test/extensions/common/tap/admin_test.cc index 8af525043213..665e137cfcac 100644 --- a/test/extensions/common/tap/admin_test.cc +++ b/test/extensions/common/tap/admin_test.cc @@ -1,8 +1,7 @@ #include "extensions/common/tap/admin.h" #include "test/mocks/server/mocks.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::_; using testing::Return; @@ -22,7 +21,7 @@ class MockExtensionConfig : public ExtensionConfig { void(envoy::service::tap::v2alpha::TapConfig&& proto_config, Sink* admin_streamer)); }; -class AdminHandlerTest : public testing::Test { +class AdminHandlerTest : public TestBase { public: AdminHandlerTest() { EXPECT_CALL(admin_, addHandler("/tap", "tap filter control", _, true, true)) diff --git a/test/extensions/common/tap/tap_matcher_test.cc b/test/extensions/common/tap/tap_matcher_test.cc index e7265f221952..214e3166b87f 100644 --- a/test/extensions/common/tap/tap_matcher_test.cc +++ b/test/extensions/common/tap/tap_matcher_test.cc @@ -2,17 +2,16 @@ #include "extensions/common/tap/tap_matcher.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace Common { namespace Tap { namespace { -class TapMatcherTest : public testing::Test { +class TapMatcherTest : public TestBase { public: std::vector matchers_; std::vector statuses_; diff --git a/test/extensions/filters/common/ext_authz/check_request_utils_test.cc b/test/extensions/filters/common/ext_authz/check_request_utils_test.cc index f03291fb2f49..01aef6d69565 100644 --- a/test/extensions/filters/common/ext_authz/check_request_utils_test.cc +++ b/test/extensions/filters/common/ext_authz/check_request_utils_test.cc @@ -7,9 +7,9 @@ #include "test/mocks/ssl/mocks.h" #include "test/mocks/stream_info/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::Return; using testing::ReturnPointee; @@ -21,7 +21,7 @@ namespace Filters { namespace Common { namespace ExtAuthz { -class CheckRequestUtilsTest : public testing::Test { +class CheckRequestUtilsTest : public TestBase { public: CheckRequestUtilsTest() { addr_ = std::make_shared("1.2.3.4", 1111); diff --git a/test/extensions/filters/common/ext_authz/ext_authz_grpc_impl_test.cc b/test/extensions/filters/common/ext_authz/ext_authz_grpc_impl_test.cc index 7c74aca575c2..ef56a5bdacd8 100644 --- a/test/extensions/filters/common/ext_authz/ext_authz_grpc_impl_test.cc +++ b/test/extensions/filters/common/ext_authz/ext_authz_grpc_impl_test.cc @@ -9,9 +9,9 @@ #include "test/extensions/filters/common/ext_authz/test_common.h" #include "test/mocks/grpc/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -28,7 +28,7 @@ namespace Filters { namespace Common { namespace ExtAuthz { -class ExtAuthzGrpcClientTest : public testing::Test { +class ExtAuthzGrpcClientTest : public TestBase { public: ExtAuthzGrpcClientTest() : async_client_(new Grpc::MockAsyncClient()), timeout_(10), diff --git a/test/extensions/filters/common/ext_authz/ext_authz_http_impl_test.cc b/test/extensions/filters/common/ext_authz/ext_authz_http_impl_test.cc index 57a332ec78cc..4a529ccce0a0 100644 --- a/test/extensions/filters/common/ext_authz/ext_authz_http_impl_test.cc +++ b/test/extensions/filters/common/ext_authz/ext_authz_http_impl_test.cc @@ -10,9 +10,9 @@ #include "test/extensions/filters/common/ext_authz/mocks.h" #include "test/extensions/filters/common/ext_authz/test_common.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AllOf; @@ -30,7 +30,7 @@ namespace Filters { namespace Common { namespace ExtAuthz { -class ExtAuthzHttpClientTest : public testing::Test { +class ExtAuthzHttpClientTest : public TestBase { public: ExtAuthzHttpClientTest() : cm_{}, async_client_{}, diff --git a/test/extensions/filters/common/lua/lua_test.cc b/test/extensions/filters/common/lua/lua_test.cc index 720c1794b78a..4d81601c290d 100644 --- a/test/extensions/filters/common/lua/lua_test.cc +++ b/test/extensions/filters/common/lua/lua_test.cc @@ -33,7 +33,7 @@ class TestObject : public BaseLuaObject { int TestObject::luaTestCall(lua_State* state) { return doTestCall(state); } -class LuaTest : public testing::Test { +class LuaTest : public TestBase { public: LuaTest() : yield_callback_([this]() { on_yield_.ready(); }) {} diff --git a/test/extensions/filters/common/lua/lua_wrappers.h b/test/extensions/filters/common/lua/lua_wrappers.h index e1e7a41f1d0f..a48bc2880d2e 100644 --- a/test/extensions/filters/common/lua/lua_wrappers.h +++ b/test/extensions/filters/common/lua/lua_wrappers.h @@ -14,7 +14,7 @@ namespace Filters { namespace Common { namespace Lua { -template class LuaWrappersTestBase : public testing::Test { +template class LuaWrappersTestBase : public TestBase { public: virtual void setup(const std::string& code) { coroutine_.reset(); diff --git a/test/extensions/filters/common/ratelimit/ratelimit_impl_test.cc b/test/extensions/filters/common/ratelimit/ratelimit_impl_test.cc index a2db5f48367c..6b21bd4f69bc 100644 --- a/test/extensions/filters/common/ratelimit/ratelimit_impl_test.cc +++ b/test/extensions/filters/common/ratelimit/ratelimit_impl_test.cc @@ -14,10 +14,10 @@ #include "test/mocks/grpc/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AtLeast; @@ -41,7 +41,7 @@ class MockRequestCallbacks : public RequestCallbacks { MOCK_METHOD2(complete_, void(LimitStatus status, const Http::HeaderMap* headers)); }; -class RateLimitGrpcClientTest : public testing::Test { +class RateLimitGrpcClientTest : public TestBase { public: RateLimitGrpcClientTest() : async_client_(new Grpc::MockAsyncClient()), diff --git a/test/extensions/filters/common/rbac/engine_impl_test.cc b/test/extensions/filters/common/rbac/engine_impl_test.cc index 5f86e7678513..cab08a096eeb 100644 --- a/test/extensions/filters/common/rbac/engine_impl_test.cc +++ b/test/extensions/filters/common/rbac/engine_impl_test.cc @@ -4,9 +4,9 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/ssl/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Const; diff --git a/test/extensions/filters/common/rbac/matchers_test.cc b/test/extensions/filters/common/rbac/matchers_test.cc index d38b17a86803..95438862b482 100644 --- a/test/extensions/filters/common/rbac/matchers_test.cc +++ b/test/extensions/filters/common/rbac/matchers_test.cc @@ -4,9 +4,9 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/ssl/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Const; diff --git a/test/extensions/filters/http/buffer/buffer_filter_test.cc b/test/extensions/filters/http/buffer/buffer_filter_test.cc index 34c1bd05298b..4a6ff63dcb64 100644 --- a/test/extensions/filters/http/buffer/buffer_filter_test.cc +++ b/test/extensions/filters/http/buffer/buffer_filter_test.cc @@ -12,9 +12,9 @@ #include "test/mocks/buffer/mocks.h" #include "test/mocks/http/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::DoAll; @@ -28,7 +28,7 @@ namespace Extensions { namespace HttpFilters { namespace BufferFilter { -class BufferFilterTest : public testing::Test { +class BufferFilterTest : public TestBase { public: BufferFilterConfigSharedPtr setupConfig() { envoy::config::filter::http::buffer::v2::Buffer proto_config; diff --git a/test/extensions/filters/http/buffer/config_test.cc b/test/extensions/filters/http/buffer/config_test.cc index 98e87a8d66fd..63b3ea3dff53 100644 --- a/test/extensions/filters/http/buffer/config_test.cc +++ b/test/extensions/filters/http/buffer/config_test.cc @@ -4,9 +4,9 @@ #include "extensions/filters/http/buffer/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/extensions/filters/http/common/aws/signer_impl_test.cc b/test/extensions/filters/http/common/aws/signer_impl_test.cc index 7d8d7331bc3d..e877d764c19b 100644 --- a/test/extensions/filters/http/common/aws/signer_impl_test.cc +++ b/test/extensions/filters/http/common/aws/signer_impl_test.cc @@ -17,7 +17,7 @@ namespace HttpFilters { namespace Common { namespace Aws { -class SignerImplTest : public testing::Test { +class SignerImplTest : public TestBase { public: SignerImplTest() : credentials_provider_(new NiceMock()), diff --git a/test/extensions/filters/http/common/aws/utility_test.cc b/test/extensions/filters/http/common/aws/utility_test.cc index 802e06036d3f..eaf0b483b793 100644 --- a/test/extensions/filters/http/common/aws/utility_test.cc +++ b/test/extensions/filters/http/common/aws/utility_test.cc @@ -1,9 +1,8 @@ #include "extensions/filters/http/common/aws/utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::ElementsAre; using testing::Pair; diff --git a/test/extensions/filters/http/common/jwks_fetcher_test.cc b/test/extensions/filters/http/common/jwks_fetcher_test.cc index 46ce0063b1c0..a1bc4a2d74ed 100644 --- a/test/extensions/filters/http/common/jwks_fetcher_test.cc +++ b/test/extensions/filters/http/common/jwks_fetcher_test.cc @@ -49,7 +49,7 @@ cluster: pubkey_cluster seconds: 5 )"; -class JwksFetcherTest : public ::testing::Test { +class JwksFetcherTest : public TestBase { public: void SetUp() { MessageUtil::loadFromYaml(JwksUri, uri_); } HttpUri uri_; diff --git a/test/extensions/filters/http/cors/cors_filter_integration_test.cc b/test/extensions/filters/http/cors/cors_filter_integration_test.cc index d1008ece992f..b5880df48a80 100644 --- a/test/extensions/filters/http/cors/cors_filter_integration_test.cc +++ b/test/extensions/filters/http/cors/cors_filter_integration_test.cc @@ -1,13 +1,12 @@ #include "test/integration/http_integration.h" #include "test/mocks/http/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { class CorsFilterIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: CorsFilterIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) {} diff --git a/test/extensions/filters/http/cors/cors_filter_test.cc b/test/extensions/filters/http/cors/cors_filter_test.cc index 1558eb3462ab..e2dc13fb0a53 100644 --- a/test/extensions/filters/http/cors/cors_filter_test.cc +++ b/test/extensions/filters/http/cors/cors_filter_test.cc @@ -6,9 +6,9 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/stats/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::DoAll; @@ -24,7 +24,7 @@ namespace Extensions { namespace HttpFilters { namespace Cors { -class CorsFilterTest : public testing::Test { +class CorsFilterTest : public TestBase { public: CorsFilterTest() : config_(new CorsFilterConfig("test.", stats_)), filter_(config_) { cors_policy_ = std::make_unique(); diff --git a/test/extensions/filters/http/dynamo/config_test.cc b/test/extensions/filters/http/dynamo/config_test.cc index f4fba1ccf90d..1e13225ddeaf 100644 --- a/test/extensions/filters/http/dynamo/config_test.cc +++ b/test/extensions/filters/http/dynamo/config_test.cc @@ -1,9 +1,9 @@ #include "extensions/filters/http/dynamo/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; diff --git a/test/extensions/filters/http/dynamo/dynamo_filter_test.cc b/test/extensions/filters/http/dynamo/dynamo_filter_test.cc index 204eba44f9c7..e78590c2e44b 100644 --- a/test/extensions/filters/http/dynamo/dynamo_filter_test.cc +++ b/test/extensions/filters/http/dynamo/dynamo_filter_test.cc @@ -10,10 +10,10 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/stats/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -26,7 +26,7 @@ namespace Extensions { namespace HttpFilters { namespace Dynamo { -class DynamoFilterTest : public testing::Test { +class DynamoFilterTest : public TestBase { public: void setup(bool enabled) { ON_CALL(loader_.snapshot_, featureEnabled("dynamodb.filter_enabled", 100)) diff --git a/test/extensions/filters/http/dynamo/dynamo_request_parser_test.cc b/test/extensions/filters/http/dynamo/dynamo_request_parser_test.cc index 330baed379f4..f9a61b116af5 100644 --- a/test/extensions/filters/http/dynamo/dynamo_request_parser_test.cc +++ b/test/extensions/filters/http/dynamo/dynamo_request_parser_test.cc @@ -7,10 +7,9 @@ #include "extensions/filters/http/dynamo/dynamo_request_parser.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace HttpFilters { diff --git a/test/extensions/filters/http/dynamo/dynamo_utility_test.cc b/test/extensions/filters/http/dynamo/dynamo_utility_test.cc index 83014009e7d8..1834bee14db9 100644 --- a/test/extensions/filters/http/dynamo/dynamo_utility_test.cc +++ b/test/extensions/filters/http/dynamo/dynamo_utility_test.cc @@ -3,9 +3,9 @@ #include "extensions/filters/http/dynamo/dynamo_utility.h" #include "test/mocks/stats/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/extensions/filters/http/ext_authz/config_test.cc b/test/extensions/filters/http/ext_authz/config_test.cc index d6043f785588..a16d7ad9acb2 100644 --- a/test/extensions/filters/http/ext_authz/config_test.cc +++ b/test/extensions/filters/http/ext_authz/config_test.cc @@ -4,9 +4,9 @@ #include "extensions/filters/http/ext_authz/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/extensions/filters/http/ext_authz/ext_authz_test.cc b/test/extensions/filters/http/ext_authz/ext_authz_test.cc index 97c55dc9676c..b064f78ade3d 100644 --- a/test/extensions/filters/http/ext_authz/ext_authz_test.cc +++ b/test/extensions/filters/http/ext_authz/ext_authz_test.cc @@ -25,10 +25,10 @@ #include "test/mocks/tracing/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -36,7 +36,6 @@ using testing::Invoke; using testing::NiceMock; using testing::Return; using testing::ReturnRef; -using testing::TestWithParam; using testing::Values; using testing::WithArgs; @@ -82,12 +81,11 @@ template class HttpFilterTestBase : public T { } }; -class HttpFilterTest : public HttpFilterTestBase {}; +class HttpFilterTest : public HttpFilterTestBase {}; typedef envoy::config::filter::http::ext_authz::v2::ExtAuthz CreateFilterConfigFunc(); -class HttpFilterTestParam - : public HttpFilterTestBase> { +class HttpFilterTestParam : public HttpFilterTestBase> { public: virtual void SetUp() override { initialize(""); } }; diff --git a/test/extensions/filters/http/fault/config_test.cc b/test/extensions/filters/http/fault/config_test.cc index cac94593579a..82bce8efd16e 100644 --- a/test/extensions/filters/http/fault/config_test.cc +++ b/test/extensions/filters/http/fault/config_test.cc @@ -3,9 +3,9 @@ #include "extensions/filters/http/fault/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/extensions/filters/http/fault/fault_filter_test.cc b/test/extensions/filters/http/fault/fault_filter_test.cc index 36963bdc285d..18d464e20e20 100644 --- a/test/extensions/filters/http/fault/fault_filter_test.cc +++ b/test/extensions/filters/http/fault/fault_filter_test.cc @@ -18,10 +18,10 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/runtime/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::DoAll; @@ -36,7 +36,7 @@ namespace Extensions { namespace HttpFilters { namespace Fault { -class FaultFilterTest : public testing::Test { +class FaultFilterTest : public TestBase { public: const std::string fixed_delay_and_abort_nodes_json = R"EOF( { diff --git a/test/extensions/filters/http/grpc_http1_bridge/config_test.cc b/test/extensions/filters/http/grpc_http1_bridge/config_test.cc index 62eac3c9ed09..101aa36ff287 100644 --- a/test/extensions/filters/http/grpc_http1_bridge/config_test.cc +++ b/test/extensions/filters/http/grpc_http1_bridge/config_test.cc @@ -1,9 +1,9 @@ #include "extensions/filters/http/grpc_http1_bridge/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; diff --git a/test/extensions/filters/http/grpc_http1_bridge/http1_bridge_filter_test.cc b/test/extensions/filters/http/grpc_http1_bridge/http1_bridge_filter_test.cc index 49bb87f4e868..ac3bc0398382 100644 --- a/test/extensions/filters/http/grpc_http1_bridge/http1_bridge_filter_test.cc +++ b/test/extensions/filters/http/grpc_http1_bridge/http1_bridge_filter_test.cc @@ -6,10 +6,10 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -22,7 +22,7 @@ namespace Extensions { namespace HttpFilters { namespace GrpcHttp1Bridge { -class GrpcHttp1BridgeFilterTest : public testing::Test { +class GrpcHttp1BridgeFilterTest : public TestBase { public: GrpcHttp1BridgeFilterTest() : filter_() { filter_.setDecoderFilterCallbacks(decoder_callbacks_); diff --git a/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_integration_test.cc b/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_integration_test.cc index e46b5c84e75f..eb07083c764e 100644 --- a/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_integration_test.cc +++ b/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_integration_test.cc @@ -6,10 +6,10 @@ #include "test/integration/http_integration.h" #include "test/mocks/http/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/strings/match.h" -#include "gtest/gtest.h" using Envoy::Http::HeaderValueOf; @@ -18,7 +18,7 @@ namespace Envoy { // Tests a downstream HTTP2 client sending gRPC requests that are converted into HTTP/1.1 for a // HTTP1 upstream. class ReverseBridgeIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: ReverseBridgeIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP2, GetParam(), realTime()) {} diff --git a/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_test.cc b/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_test.cc index c9fc1527d05e..8e36ee5ad757 100644 --- a/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_test.cc +++ b/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_test.cc @@ -12,10 +12,10 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/stats/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using Envoy::Http::HeaderValueOf; using testing::_; @@ -27,7 +27,7 @@ namespace Extensions { namespace HttpFilters { namespace GrpcHttp1ReverseBridge { -class ReverseBridgeTest : public testing::Test { +class ReverseBridgeTest : public TestBase { protected: void initialize(bool withhold_grpc_headers = true) { filter_ = std::make_unique("application/x-protobuf", withhold_grpc_headers); diff --git a/test/extensions/filters/http/grpc_json_transcoder/config_test.cc b/test/extensions/filters/http/grpc_json_transcoder/config_test.cc index 1a431615d669..31f12b47d1cd 100644 --- a/test/extensions/filters/http/grpc_json_transcoder/config_test.cc +++ b/test/extensions/filters/http/grpc_json_transcoder/config_test.cc @@ -3,9 +3,9 @@ #include "extensions/filters/http/grpc_json_transcoder/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/filters/http/grpc_json_transcoder/grpc_json_transcoder_integration_test.cc b/test/extensions/filters/http/grpc_json_transcoder/grpc_json_transcoder_integration_test.cc index b2477934ba2a..64c63b6cbfdc 100644 --- a/test/extensions/filters/http/grpc_json_transcoder/grpc_json_transcoder_integration_test.cc +++ b/test/extensions/filters/http/grpc_json_transcoder/grpc_json_transcoder_integration_test.cc @@ -6,10 +6,10 @@ #include "test/integration/http_integration.h" #include "test/mocks/http/mocks.h" #include "test/proto/bookstore.pb.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/strings/match.h" -#include "gtest/gtest.h" using Envoy::Protobuf::Message; using Envoy::Protobuf::TextFormat; @@ -20,9 +20,8 @@ using Envoy::ProtobufWkt::Empty; namespace Envoy { -class GrpcJsonTranscoderIntegrationTest - : public HttpIntegrationTest, - public testing::TestWithParam { +class GrpcJsonTranscoderIntegrationTest : public HttpIntegrationTest, + public TestBaseWithParam { public: GrpcJsonTranscoderIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) {} diff --git a/test/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter_test.cc b/test/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter_test.cc index 3fc56f08a66d..f5ad48329dea 100644 --- a/test/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter_test.cc +++ b/test/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter_test.cc @@ -15,10 +15,10 @@ #include "test/proto/bookstore.pb.h" #include "test/test_common/environment.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -50,7 +50,7 @@ class GrpcJsonTranscoderFilterTestBase { Api::ApiPtr api_; }; -class GrpcJsonTranscoderConfigTest : public testing::Test, public GrpcJsonTranscoderFilterTestBase { +class GrpcJsonTranscoderConfigTest : public TestBase, public GrpcJsonTranscoderFilterTestBase { protected: const envoy::config::filter::http::transcoder::v2::GrpcJsonTranscoder getProtoConfig(const std::string& descriptor_path, const std::string& service_name, @@ -271,7 +271,7 @@ TEST_F(GrpcJsonTranscoderConfigTest, InvalidVariableBinding) { EXPECT_FALSE(transcoder); } -class GrpcJsonTranscoderFilterTest : public testing::Test, public GrpcJsonTranscoderFilterTestBase { +class GrpcJsonTranscoderFilterTest : public TestBase, public GrpcJsonTranscoderFilterTestBase { protected: GrpcJsonTranscoderFilterTest(const bool match_incoming_request_route = false) : config_(bookstoreProtoConfig(match_incoming_request_route), *api_), filter_(config_) { @@ -702,7 +702,7 @@ struct GrpcJsonTranscoderFilterPrintTestParam { }; class GrpcJsonTranscoderFilterPrintTest - : public testing::TestWithParam, + : public TestBaseWithParam, public GrpcJsonTranscoderFilterTestBase { protected: GrpcJsonTranscoderFilterPrintTest() { diff --git a/test/extensions/filters/http/grpc_json_transcoder/transcoder_input_stream_test.cc b/test/extensions/filters/http/grpc_json_transcoder/transcoder_input_stream_test.cc index e72c8beaa24f..9d2d8aab8d80 100644 --- a/test/extensions/filters/http/grpc_json_transcoder/transcoder_input_stream_test.cc +++ b/test/extensions/filters/http/grpc_json_transcoder/transcoder_input_stream_test.cc @@ -2,7 +2,7 @@ #include "extensions/filters/http/grpc_json_transcoder/transcoder_input_stream_impl.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Extensions { @@ -10,7 +10,7 @@ namespace HttpFilters { namespace GrpcJsonTranscoder { namespace { -class TranscoderInputStreamTest : public testing::Test { +class TranscoderInputStreamTest : public TestBase { public: TranscoderInputStreamTest() { Buffer::OwnedImpl buffer{"abcd"}; diff --git a/test/extensions/filters/http/grpc_web/config_test.cc b/test/extensions/filters/http/grpc_web/config_test.cc index 6035cd312dc5..8c1aa3729a56 100644 --- a/test/extensions/filters/http/grpc_web/config_test.cc +++ b/test/extensions/filters/http/grpc_web/config_test.cc @@ -1,9 +1,9 @@ #include "extensions/filters/http/grpc_web/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; diff --git a/test/extensions/filters/http/grpc_web/grpc_web_filter_test.cc b/test/extensions/filters/http/grpc_web/grpc_web_filter_test.cc index c9bad9b824a6..b9fcb90c96d5 100644 --- a/test/extensions/filters/http/grpc_web/grpc_web_filter_test.cc +++ b/test/extensions/filters/http/grpc_web/grpc_web_filter_test.cc @@ -12,10 +12,10 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Combine; @@ -45,7 +45,7 @@ const size_t TRAILERS_SIZE = sizeof(TRAILERS) - 1; } // namespace -class GrpcWebFilterTest : public testing::TestWithParam> { +class GrpcWebFilterTest : public TestBaseWithParam> { public: GrpcWebFilterTest() : filter_() { filter_.setDecoderFilterCallbacks(decoder_callbacks_); diff --git a/test/extensions/filters/http/gzip/gzip_filter_integration_test.cc b/test/extensions/filters/http/gzip/gzip_filter_integration_test.cc index 00e24d9bab55..aa56d03ee1e9 100644 --- a/test/extensions/filters/http/gzip/gzip_filter_integration_test.cc +++ b/test/extensions/filters/http/gzip/gzip_filter_integration_test.cc @@ -4,14 +4,13 @@ #include "test/integration/http_integration.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { class GzipIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: GzipIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), simTime()) {} diff --git a/test/extensions/filters/http/gzip/gzip_filter_test.cc b/test/extensions/filters/http/gzip/gzip_filter_test.cc index bfe1389dd7aa..6161e095e546 100644 --- a/test/extensions/filters/http/gzip/gzip_filter_test.cc +++ b/test/extensions/filters/http/gzip/gzip_filter_test.cc @@ -9,10 +9,9 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/runtime/mocks.h" #include "test/mocks/stats/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::Return; namespace Envoy { @@ -20,7 +19,7 @@ namespace Extensions { namespace HttpFilters { namespace Gzip { -class GzipFilterTest : public testing::Test { +class GzipFilterTest : public TestBase { protected: GzipFilterTest() { ON_CALL(runtime_.snapshot_, featureEnabled("gzip.filter_enabled", 100)) diff --git a/test/extensions/filters/http/header_to_metadata/header_to_metadata_filter_test.cc b/test/extensions/filters/http/header_to_metadata/header_to_metadata_filter_test.cc index f756d9c5f37b..42f3973b4f54 100644 --- a/test/extensions/filters/http/header_to_metadata/header_to_metadata_filter_test.cc +++ b/test/extensions/filters/http/header_to_metadata/header_to_metadata_filter_test.cc @@ -4,10 +4,10 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/stream_info/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -17,7 +17,7 @@ namespace Extensions { namespace HttpFilters { namespace HeaderToMetadataFilter { -class HeaderToMetadataTest : public testing::Test { +class HeaderToMetadataTest : public TestBase { public: HeaderToMetadataTest() {} diff --git a/test/extensions/filters/http/health_check/config_test.cc b/test/extensions/filters/http/health_check/config_test.cc index b2b7b3393560..fd7cb7bad3cd 100644 --- a/test/extensions/filters/http/health_check/config_test.cc +++ b/test/extensions/filters/http/health_check/config_test.cc @@ -1,10 +1,10 @@ #include "extensions/filters/http/health_check/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/extensions/filters/http/health_check/health_check_test.cc b/test/extensions/filters/http/health_check/health_check_test.cc index 8c1339319715..6aa280d235c6 100644 --- a/test/extensions/filters/http/health_check/health_check_test.cc +++ b/test/extensions/filters/http/health_check/health_check_test.cc @@ -10,10 +10,10 @@ #include "test/mocks/server/mocks.h" #include "test/mocks/upstream/cluster_info.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::DoAll; @@ -28,7 +28,7 @@ namespace Extensions { namespace HttpFilters { namespace HealthCheck { -class HealthCheckFilterTest : public testing::Test { +class HealthCheckFilterTest : public TestBase { public: HealthCheckFilterTest(bool pass_through, bool caching) : request_headers_{{":path", "/healthcheck"}}, request_headers_no_hc_{{":path", "/foo"}} { diff --git a/test/extensions/filters/http/ip_tagging/ip_tagging_filter_test.cc b/test/extensions/filters/http/ip_tagging/ip_tagging_filter_test.cc index b48b9a9f3ead..69a47eb221e0 100644 --- a/test/extensions/filters/http/ip_tagging/ip_tagging_filter_test.cc +++ b/test/extensions/filters/http/ip_tagging/ip_tagging_filter_test.cc @@ -11,10 +11,10 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/runtime/mocks.h" #include "test/mocks/stats/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Return; @@ -25,7 +25,7 @@ namespace Extensions { namespace HttpFilters { namespace IpTagging { -class IpTaggingFilterTest : public testing::Test { +class IpTaggingFilterTest : public TestBase { public: IpTaggingFilterTest() { ON_CALL(runtime_.snapshot_, featureEnabled("ip_tagging.http_filter_enabled", 100)) diff --git a/test/extensions/filters/http/jwt_authn/all_verifier_test.cc b/test/extensions/filters/http/jwt_authn/all_verifier_test.cc index 59db8de2d870..06f7f8ac9903 100644 --- a/test/extensions/filters/http/jwt_authn/all_verifier_test.cc +++ b/test/extensions/filters/http/jwt_authn/all_verifier_test.cc @@ -17,7 +17,7 @@ namespace Extensions { namespace HttpFilters { namespace JwtAuthn { -class AllVerifierTest : public ::testing::Test { +class AllVerifierTest : public TestBase { public: void SetUp() { MessageUtil::loadFromYaml(ExampleConfig, proto_config_); } diff --git a/test/extensions/filters/http/jwt_authn/authenticator_test.cc b/test/extensions/filters/http/jwt_authn/authenticator_test.cc index e0d52927e2bc..143120ff0c31 100644 --- a/test/extensions/filters/http/jwt_authn/authenticator_test.cc +++ b/test/extensions/filters/http/jwt_authn/authenticator_test.cc @@ -9,10 +9,9 @@ #include "test/extensions/filters/http/jwt_authn/mock.h" #include "test/extensions/filters/http/jwt_authn/test_common.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using ::envoy::config::filter::http::jwt_authn::v2alpha::JwtAuthentication; using Envoy::Extensions::HttpFilters::Common::JwksFetcher; using Envoy::Extensions::HttpFilters::Common::JwksFetcherPtr; @@ -28,7 +27,7 @@ namespace Extensions { namespace HttpFilters { namespace JwtAuthn { -class AuthenticatorTest : public ::testing::Test { +class AuthenticatorTest : public TestBase { public: void SetUp() { MessageUtil::loadFromYaml(ExampleConfig, proto_config_); diff --git a/test/extensions/filters/http/jwt_authn/extractor_test.cc b/test/extensions/filters/http/jwt_authn/extractor_test.cc index 49f9dfe3ea43..11aa484583fc 100644 --- a/test/extensions/filters/http/jwt_authn/extractor_test.cc +++ b/test/extensions/filters/http/jwt_authn/extractor_test.cc @@ -48,7 +48,7 @@ const char ExampleConfig[] = R"( value_prefix: AAABBB )"; -class ExtractorTest : public ::testing::Test { +class ExtractorTest : public TestBase { public: void SetUp() { MessageUtil::loadFromYaml(ExampleConfig, config_); diff --git a/test/extensions/filters/http/jwt_authn/filter_factory_test.cc b/test/extensions/filters/http/jwt_authn/filter_factory_test.cc index dfb2c94ff584..6f1b60f22768 100644 --- a/test/extensions/filters/http/jwt_authn/filter_factory_test.cc +++ b/test/extensions/filters/http/jwt_authn/filter_factory_test.cc @@ -4,9 +4,9 @@ #include "test/extensions/filters/http/jwt_authn/test_common.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using ::envoy::config::filter::http::jwt_authn::v2alpha::JwtAuthentication; using ::envoy::config::filter::http::jwt_authn::v2alpha::JwtProvider; diff --git a/test/extensions/filters/http/jwt_authn/filter_test.cc b/test/extensions/filters/http/jwt_authn/filter_test.cc index 71f758969833..7c988a5ee91a 100644 --- a/test/extensions/filters/http/jwt_authn/filter_test.cc +++ b/test/extensions/filters/http/jwt_authn/filter_test.cc @@ -3,10 +3,10 @@ #include "test/extensions/filters/http/jwt_authn/mock.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using ::envoy::config::filter::http::jwt_authn::v2alpha::JwtAuthentication; using ::google::jwt_verify::Status; @@ -33,7 +33,7 @@ class MockFilterConfig : public FilterConfig { MOCK_CONST_METHOD1(findVerifier, const Verifier*(const Http::HeaderMap& headers)); }; -class FilterTest : public ::testing::Test { +class FilterTest : public TestBase { public: void SetUp() { mock_config_ = ::std::make_shared(proto_config_, "", mock_context_); diff --git a/test/extensions/filters/http/jwt_authn/group_verifier_test.cc b/test/extensions/filters/http/jwt_authn/group_verifier_test.cc index 1f7b2ad14c4f..66855054ef8f 100644 --- a/test/extensions/filters/http/jwt_authn/group_verifier_test.cc +++ b/test/extensions/filters/http/jwt_authn/group_verifier_test.cc @@ -64,7 +64,7 @@ typedef std::unordered_map StatusMap; constexpr auto allowfailed = "_allow_failed_"; -class GroupVerifierTest : public ::testing::Test { +class GroupVerifierTest : public TestBase { public: void createVerifier() { ON_CALL(mock_factory_, create(_, _, _)) diff --git a/test/extensions/filters/http/jwt_authn/jwks_cache_test.cc b/test/extensions/filters/http/jwt_authn/jwks_cache_test.cc index 37871daea086..b8daf0214ea6 100644 --- a/test/extensions/filters/http/jwt_authn/jwks_cache_test.cc +++ b/test/extensions/filters/http/jwt_authn/jwks_cache_test.cc @@ -19,7 +19,7 @@ namespace HttpFilters { namespace JwtAuthn { namespace { -class JwksCacheTest : public ::testing::Test { +class JwksCacheTest : public TestBase { protected: JwksCacheTest() : api_(Api::createApiForTest(stats_)) {} void SetUp() { diff --git a/test/extensions/filters/http/jwt_authn/matcher_test.cc b/test/extensions/filters/http/jwt_authn/matcher_test.cc index 8adc79dbbc40..f0f916c78fd1 100644 --- a/test/extensions/filters/http/jwt_authn/matcher_test.cc +++ b/test/extensions/filters/http/jwt_authn/matcher_test.cc @@ -23,7 +23,7 @@ namespace HttpFilters { namespace JwtAuthn { namespace { -class MatcherTest : public ::testing::Test { +class MatcherTest : public TestBase { public: }; diff --git a/test/extensions/filters/http/jwt_authn/provider_verifier_test.cc b/test/extensions/filters/http/jwt_authn/provider_verifier_test.cc index b0da46ef6b66..33954a27453c 100644 --- a/test/extensions/filters/http/jwt_authn/provider_verifier_test.cc +++ b/test/extensions/filters/http/jwt_authn/provider_verifier_test.cc @@ -27,7 +27,7 @@ ProtobufWkt::Struct getExpectedPayload(const std::string& name) { return struct_obj; } -class ProviderVerifierTest : public ::testing::Test { +class ProviderVerifierTest : public TestBase { public: void createVerifier() { filter_config_ = ::std::make_shared(proto_config_, "", mock_factory_ctx_); diff --git a/test/extensions/filters/http/lua/config_test.cc b/test/extensions/filters/http/lua/config_test.cc index f9c113fc1449..e1de99b6f32c 100644 --- a/test/extensions/filters/http/lua/config_test.cc +++ b/test/extensions/filters/http/lua/config_test.cc @@ -3,9 +3,9 @@ #include "extensions/filters/http/lua/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; diff --git a/test/extensions/filters/http/lua/lua_filter_test.cc b/test/extensions/filters/http/lua/lua_filter_test.cc index 7e9d9486d3fd..4955cb1b4ffc 100644 --- a/test/extensions/filters/http/lua/lua_filter_test.cc +++ b/test/extensions/filters/http/lua/lua_filter_test.cc @@ -37,7 +37,7 @@ class TestFilter : public Filter { MOCK_METHOD2(scriptLog, void(spdlog::level::level_enum level, const char* message)); }; -class LuaHttpFilterTest : public testing::Test { +class LuaHttpFilterTest : public TestBase { public: LuaHttpFilterTest() { // Avoid strict mock failures for the following calls. We want strict for other calls. diff --git a/test/extensions/filters/http/lua/lua_integration_test.cc b/test/extensions/filters/http/lua/lua_integration_test.cc index cc7d04ac871d..9af429f4aef6 100644 --- a/test/extensions/filters/http/lua/lua_integration_test.cc +++ b/test/extensions/filters/http/lua/lua_integration_test.cc @@ -1,15 +1,14 @@ #include "extensions/filters/http/well_known_names.h" #include "test/integration/http_integration.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace { class LuaIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: LuaIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) {} diff --git a/test/extensions/filters/http/ratelimit/config_test.cc b/test/extensions/filters/http/ratelimit/config_test.cc index 8ce784acf917..7b6ae66567a4 100644 --- a/test/extensions/filters/http/ratelimit/config_test.cc +++ b/test/extensions/filters/http/ratelimit/config_test.cc @@ -6,9 +6,9 @@ #include "extensions/filters/http/ratelimit/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::ReturnRef; diff --git a/test/extensions/filters/http/ratelimit/ratelimit_test.cc b/test/extensions/filters/http/ratelimit/ratelimit_test.cc index 5ee6c2881c49..ca5583c2569b 100644 --- a/test/extensions/filters/http/ratelimit/ratelimit_test.cc +++ b/test/extensions/filters/http/ratelimit/ratelimit_test.cc @@ -18,10 +18,10 @@ #include "test/mocks/tracing/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -37,7 +37,7 @@ namespace Extensions { namespace HttpFilters { namespace RateLimitFilter { -class HttpRateLimitFilterTest : public testing::Test { +class HttpRateLimitFilterTest : public TestBase { public: HttpRateLimitFilterTest() { ON_CALL(runtime_.snapshot_, featureEnabled("ratelimit.http_filter_enabled", 100)) diff --git a/test/extensions/filters/http/rbac/config_test.cc b/test/extensions/filters/http/rbac/config_test.cc index 6085958c1071..646b527f0fed 100644 --- a/test/extensions/filters/http/rbac/config_test.cc +++ b/test/extensions/filters/http/rbac/config_test.cc @@ -2,9 +2,9 @@ #include "extensions/filters/http/rbac/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/extensions/filters/http/rbac/rbac_filter_test.cc b/test/extensions/filters/http/rbac/rbac_filter_test.cc index bdeb72975287..0ff7ddc7bede 100644 --- a/test/extensions/filters/http/rbac/rbac_filter_test.cc +++ b/test/extensions/filters/http/rbac/rbac_filter_test.cc @@ -21,7 +21,7 @@ namespace HttpFilters { namespace RBACFilter { namespace { -class RoleBasedAccessControlFilterTest : public testing::Test { +class RoleBasedAccessControlFilterTest : public TestBase { public: RoleBasedAccessControlFilterConfigSharedPtr setupConfig() { envoy::config::filter::http::rbac::v2::RBAC config; diff --git a/test/extensions/filters/http/router/config_test.cc b/test/extensions/filters/http/router/config_test.cc index 89732808e578..5c444d16e0ce 100644 --- a/test/extensions/filters/http/router/config_test.cc +++ b/test/extensions/filters/http/router/config_test.cc @@ -4,9 +4,9 @@ #include "extensions/filters/http/router/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; diff --git a/test/extensions/filters/http/squash/config_test.cc b/test/extensions/filters/http/squash/config_test.cc index 278cd0e50996..71e0828690c7 100644 --- a/test/extensions/filters/http/squash/config_test.cc +++ b/test/extensions/filters/http/squash/config_test.cc @@ -3,9 +3,9 @@ #include "extensions/filters/http/squash/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; diff --git a/test/extensions/filters/http/squash/squash_filter_integration_test.cc b/test/extensions/filters/http/squash/squash_filter_integration_test.cc index af6823c1f963..1ad01eb2283d 100644 --- a/test/extensions/filters/http/squash/squash_filter_integration_test.cc +++ b/test/extensions/filters/http/squash/squash_filter_integration_test.cc @@ -17,7 +17,7 @@ using Envoy::Protobuf::util::MessageDifferencer; namespace Envoy { class SquashFilterIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: SquashFilterIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) {} diff --git a/test/extensions/filters/http/squash/squash_filter_test.cc b/test/extensions/filters/http/squash/squash_filter_test.cc index c7f2c7fcf4e8..f9289e3269bd 100644 --- a/test/extensions/filters/http/squash/squash_filter_test.cc +++ b/test/extensions/filters/http/squash/squash_filter_test.cc @@ -11,11 +11,11 @@ #include "test/mocks/server/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "fmt/format.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -164,7 +164,7 @@ TEST(SoloFilterConfigTest, ParsesEnvironmentInComplexTemplate) { EXPECT_JSON_EQ(expected_json, config.attachmentJson()); } -class SquashFilterTest : public testing::Test { +class SquashFilterTest : public TestBase { public: SquashFilterTest() : request_(&cm_.async_client_) {} diff --git a/test/extensions/filters/http/tap/tap_filter_integration_test.cc b/test/extensions/filters/http/tap/tap_filter_integration_test.cc index dc258d3ef67a..84c3623d640d 100644 --- a/test/extensions/filters/http/tap/tap_filter_integration_test.cc +++ b/test/extensions/filters/http/tap/tap_filter_integration_test.cc @@ -1,15 +1,15 @@ #include "envoy/data/tap/v2alpha/wrapper.pb.h" #include "test/integration/http_integration.h" +#include "test/test_common/test_base.h" #include "absl/strings/match.h" -#include "gtest/gtest.h" namespace Envoy { namespace { class TapIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: TapIntegrationTest() // Note: This test must use HTTP/2 because of the lack of early close detection for diff --git a/test/extensions/filters/http/tap/tap_filter_test.cc b/test/extensions/filters/http/tap/tap_filter_test.cc index d605488ea68b..2c982c71fddb 100644 --- a/test/extensions/filters/http/tap/tap_filter_test.cc +++ b/test/extensions/filters/http/tap/tap_filter_test.cc @@ -2,10 +2,10 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/stream_info/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::InSequence; using testing::Return; @@ -46,7 +46,7 @@ class MockHttpPerRequestTapper : public HttpPerRequestTapper { const Http::HeaderMap* response_trailers)); }; -class TapFilterTest : public testing::Test { +class TapFilterTest : public TestBase { public: void setup(bool has_config) { if (has_config) { diff --git a/test/extensions/filters/listener/original_src/config_test.cc b/test/extensions/filters/listener/original_src/config_test.cc index 4efe2c2c0f67..59f0e483f857 100644 --- a/test/extensions/filters/listener/original_src/config_test.cc +++ b/test/extensions/filters/listener/original_src/config_test.cc @@ -5,7 +5,7 @@ #include "extensions/filters/listener/original_src/config.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Extensions { @@ -15,7 +15,7 @@ namespace { // In keeping with the class under test, it would have made sense to call this ConfigTest. However, // when running coverage tests, that conflicts with tests elsewhere in the codebase. -class OriginalSrcConfigTest : public testing::Test { +class OriginalSrcConfigTest : public TestBase { public: Config makeConfigFromProto( const envoy::config::filter::listener::original_src::v2alpha1::OriginalSrc& proto_config) { diff --git a/test/extensions/filters/listener/original_src/original_src_config_factory_test.cc b/test/extensions/filters/listener/original_src/original_src_config_factory_test.cc index 5fe8755dce72..4ef3c0735373 100644 --- a/test/extensions/filters/listener/original_src/original_src_config_factory_test.cc +++ b/test/extensions/filters/listener/original_src/original_src_config_factory_test.cc @@ -6,9 +6,9 @@ #include "extensions/filters/listener/original_src/original_src_config_factory.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::Invoke; diff --git a/test/extensions/filters/listener/original_src/original_src_socket_option_test.cc b/test/extensions/filters/listener/original_src/original_src_socket_option_test.cc index 98e0c8c71a97..fdf555e7f404 100644 --- a/test/extensions/filters/listener/original_src/original_src_socket_option_test.cc +++ b/test/extensions/filters/listener/original_src/original_src_socket_option_test.cc @@ -7,9 +7,9 @@ #include "test/mocks/common.h" #include "test/mocks/network/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Eq; @@ -20,7 +20,7 @@ namespace ListenerFilters { namespace OriginalSrc { namespace { -class OriginalSrcSocketOptionTest : public testing::Test { +class OriginalSrcSocketOptionTest : public TestBase { public: std::unique_ptr makeOptionByAddress(const Network::Address::InstanceConstSharedPtr& address) { diff --git a/test/extensions/filters/listener/original_src/original_src_test.cc b/test/extensions/filters/listener/original_src/original_src_test.cc index 23b5f700248b..c76dd4ee6a4f 100644 --- a/test/extensions/filters/listener/original_src/original_src_test.cc +++ b/test/extensions/filters/listener/original_src/original_src_test.cc @@ -10,9 +10,9 @@ #include "test/mocks/common.h" #include "test/mocks/network/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Exactly; @@ -24,7 +24,7 @@ namespace ListenerFilters { namespace OriginalSrc { namespace { -class OriginalSrcTest : public testing::Test { +class OriginalSrcTest : public TestBase { public: std::unique_ptr makeDefaultFilter() { Config default_config; diff --git a/test/extensions/filters/listener/proxy_protocol/proxy_protocol_test.cc b/test/extensions/filters/listener/proxy_protocol/proxy_protocol_test.cc index 6420a10e2138..50fae0a43756 100644 --- a/test/extensions/filters/listener/proxy_protocol/proxy_protocol_test.cc +++ b/test/extensions/filters/listener/proxy_protocol/proxy_protocol_test.cc @@ -22,12 +22,12 @@ #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/threadsafe_singleton_injector.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AnyNumber; @@ -44,7 +44,7 @@ namespace ProxyProtocol { // Build again on the basis of the connection_handler_test.cc -class ProxyProtocolTest : public testing::TestWithParam, +class ProxyProtocolTest : public TestBaseWithParam, public Network::ListenerConfig, public Network::FilterChainManager, protected Logger::Loggable { @@ -865,7 +865,7 @@ TEST_P(ProxyProtocolTest, ClosedEmpty) { dispatcher_.run(Event::Dispatcher::RunType::NonBlock); } -class WildcardProxyProtocolTest : public testing::TestWithParam, +class WildcardProxyProtocolTest : public TestBaseWithParam, public Network::ListenerConfig, public Network::FilterChainManager, protected Logger::Loggable { diff --git a/test/extensions/filters/listener/tls_inspector/tls_inspector_benchmark.cc b/test/extensions/filters/listener/tls_inspector/tls_inspector_benchmark.cc index f2bc9964595d..880edc3066fd 100644 --- a/test/extensions/filters/listener/tls_inspector/tls_inspector_benchmark.cc +++ b/test/extensions/filters/listener/tls_inspector/tls_inspector_benchmark.cc @@ -9,10 +9,10 @@ #include "test/mocks/api/mocks.h" #include "test/mocks/network/mocks.h" #include "test/mocks/stats/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" #include "benchmark/benchmark.h" -#include "gtest/gtest.h" #include "openssl/ssl.h" using testing::_; diff --git a/test/extensions/filters/listener/tls_inspector/tls_inspector_test.cc b/test/extensions/filters/listener/tls_inspector/tls_inspector_test.cc index a5a8fe37a726..d51d1d9fa441 100644 --- a/test/extensions/filters/listener/tls_inspector/tls_inspector_test.cc +++ b/test/extensions/filters/listener/tls_inspector/tls_inspector_test.cc @@ -6,9 +6,9 @@ #include "test/mocks/api/mocks.h" #include "test/mocks/network/mocks.h" #include "test/mocks/stats/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" -#include "gtest/gtest.h" #include "openssl/ssl.h" using testing::_; @@ -28,7 +28,7 @@ namespace Extensions { namespace ListenerFilters { namespace TlsInspector { -class TlsInspectorTest : public testing::Test { +class TlsInspectorTest : public TestBase { public: TlsInspectorTest() : cfg_(std::make_shared(store_)), diff --git a/test/extensions/filters/network/client_ssl_auth/client_ssl_auth_test.cc b/test/extensions/filters/network/client_ssl_auth/client_ssl_auth_test.cc index dce254914ad3..2c6a78b380ac 100644 --- a/test/extensions/filters/network/client_ssl_auth/client_ssl_auth_test.cc +++ b/test/extensions/filters/network/client_ssl_auth/client_ssl_auth_test.cc @@ -15,10 +15,10 @@ #include "test/mocks/upstream/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -55,7 +55,7 @@ TEST(ClientSslAuthConfigTest, BadClientSslAuthConfig) { Json::Exception); } -class ClientSslAuthFilterTest : public testing::Test { +class ClientSslAuthFilterTest : public TestBase { protected: ClientSslAuthFilterTest() : request_(&cm_.async_client_), interval_timer_(new Event::MockTimer(&dispatcher_)), diff --git a/test/extensions/filters/network/client_ssl_auth/config_test.cc b/test/extensions/filters/network/client_ssl_auth/config_test.cc index f25758b1b3cb..bca273c01dd5 100644 --- a/test/extensions/filters/network/client_ssl_auth/config_test.cc +++ b/test/extensions/filters/network/client_ssl_auth/config_test.cc @@ -6,9 +6,9 @@ #include "extensions/filters/network/well_known_names.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; @@ -17,7 +17,7 @@ namespace Extensions { namespace NetworkFilters { namespace ClientSslAuth { -class IpWhiteListConfigTest : public ::testing::TestWithParam {}; +class IpWhiteListConfigTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpList, IpWhiteListConfigTest, ::testing::Values(R"EOF(["192.168.3.0/24"])EOF", diff --git a/test/extensions/filters/network/dubbo_proxy/config_test.cc b/test/extensions/filters/network/dubbo_proxy/config_test.cc index 11e5e3f5ef01..fd21b7c40979 100644 --- a/test/extensions/filters/network/dubbo_proxy/config_test.cc +++ b/test/extensions/filters/network/dubbo_proxy/config_test.cc @@ -3,9 +3,9 @@ #include "extensions/filters/network/dubbo_proxy/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; diff --git a/test/extensions/filters/network/dubbo_proxy/dubbo_protocol_impl_test.cc b/test/extensions/filters/network/dubbo_proxy/dubbo_protocol_impl_test.cc index 44ba352e6e00..387b25bab241 100644 --- a/test/extensions/filters/network/dubbo_proxy/dubbo_protocol_impl_test.cc +++ b/test/extensions/filters/network/dubbo_proxy/dubbo_protocol_impl_test.cc @@ -4,10 +4,10 @@ #include "test/extensions/filters/network/dubbo_proxy/mocks.h" #include "test/extensions/filters/network/dubbo_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/filters/network/dubbo_proxy/filter_test.cc b/test/extensions/filters/network/dubbo_proxy/filter_test.cc index 024224ce6335..32eda7490e80 100644 --- a/test/extensions/filters/network/dubbo_proxy/filter_test.cc +++ b/test/extensions/filters/network/dubbo_proxy/filter_test.cc @@ -10,9 +10,9 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; @@ -25,7 +25,7 @@ using ConfigProtocolType = envoy::config::filter::network::dubbo_proxy::v2alpha1 using ConfigSerializationType = envoy::config::filter::network::dubbo_proxy::v2alpha1::SerializationType; -class DubboFilterTest : public testing::Test { +class DubboFilterTest : public TestBase { public: DubboFilterTest() {} diff --git a/test/extensions/filters/network/dubbo_proxy/hessian_deserializer_impl_test.cc b/test/extensions/filters/network/dubbo_proxy/hessian_deserializer_impl_test.cc index a2c5b22a08c8..370ab9c1c588 100644 --- a/test/extensions/filters/network/dubbo_proxy/hessian_deserializer_impl_test.cc +++ b/test/extensions/filters/network/dubbo_proxy/hessian_deserializer_impl_test.cc @@ -3,10 +3,10 @@ #include "test/extensions/filters/network/dubbo_proxy/mocks.h" #include "test/extensions/filters/network/dubbo_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NotNull; diff --git a/test/extensions/filters/network/dubbo_proxy/hessian_utils_test.cc b/test/extensions/filters/network/dubbo_proxy/hessian_utils_test.cc index dfb721f30f4b..080e61e8f5c8 100644 --- a/test/extensions/filters/network/dubbo_proxy/hessian_utils_test.cc +++ b/test/extensions/filters/network/dubbo_proxy/hessian_utils_test.cc @@ -3,10 +3,9 @@ #include "extensions/filters/network/dubbo_proxy/hessian_utils.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace NetworkFilters { diff --git a/test/extensions/filters/network/dubbo_proxy/metadata_test.cc b/test/extensions/filters/network/dubbo_proxy/metadata_test.cc index f89179cd637c..834094161036 100644 --- a/test/extensions/filters/network/dubbo_proxy/metadata_test.cc +++ b/test/extensions/filters/network/dubbo_proxy/metadata_test.cc @@ -1,6 +1,6 @@ #include "extensions/filters/network/dubbo_proxy/metadata.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/filters/network/dubbo_proxy/mocks.cc b/test/extensions/filters/network/dubbo_proxy/mocks.cc index 2075536058f4..2cc0a101e242 100644 --- a/test/extensions/filters/network/dubbo_proxy/mocks.cc +++ b/test/extensions/filters/network/dubbo_proxy/mocks.cc @@ -4,7 +4,7 @@ #include "common/protobuf/utility.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::_; using testing::Invoke; diff --git a/test/extensions/filters/network/dubbo_proxy/route_matcher_test.cc b/test/extensions/filters/network/dubbo_proxy/route_matcher_test.cc index ebf53c63914e..b5e8df89812f 100644 --- a/test/extensions/filters/network/dubbo_proxy/route_matcher_test.cc +++ b/test/extensions/filters/network/dubbo_proxy/route_matcher_test.cc @@ -7,7 +7,7 @@ #include "extensions/filters/network/dubbo_proxy/router/route_matcher.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/filters/network/ext_authz/config_test.cc b/test/extensions/filters/network/ext_authz/config_test.cc index 2d955119a1a7..8ae3c47dd39f 100644 --- a/test/extensions/filters/network/ext_authz/config_test.cc +++ b/test/extensions/filters/network/ext_authz/config_test.cc @@ -4,9 +4,9 @@ #include "extensions/filters/network/ext_authz/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/extensions/filters/network/ext_authz/ext_authz_test.cc b/test/extensions/filters/network/ext_authz/ext_authz_test.cc index e334b75a4649..06440f8d8a14 100644 --- a/test/extensions/filters/network/ext_authz/ext_authz_test.cc +++ b/test/extensions/filters/network/ext_authz/ext_authz_test.cc @@ -18,9 +18,9 @@ #include "test/mocks/tracing/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -35,7 +35,7 @@ namespace Extensions { namespace NetworkFilters { namespace ExtAuthz { -class ExtAuthzFilterTest : public testing::Test { +class ExtAuthzFilterTest : public TestBase { public: ExtAuthzFilterTest() { std::string json = R"EOF( diff --git a/test/extensions/filters/network/http_connection_manager/config_test.cc b/test/extensions/filters/network/http_connection_manager/config_test.cc index 8f1cbb7b16d6..4fe6b5d7cc92 100644 --- a/test/extensions/filters/network/http_connection_manager/config_test.cc +++ b/test/extensions/filters/network/http_connection_manager/config_test.cc @@ -10,10 +10,10 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::ContainerEq; @@ -43,7 +43,7 @@ parseHttpConnectionManagerFromV2Yaml(const std::string& yaml) { return http_connection_manager; } -class HttpConnectionManagerConfigTest : public testing::Test { +class HttpConnectionManagerConfigTest : public TestBase { public: NiceMock context_; Http::SlowDateProviderImpl date_provider_{context_.dispatcher().timeSystem()}; diff --git a/test/extensions/filters/network/mongo_proxy/bson_impl_test.cc b/test/extensions/filters/network/mongo_proxy/bson_impl_test.cc index 9bbe1a1bbc66..df3afaf5ccba 100644 --- a/test/extensions/filters/network/mongo_proxy/bson_impl_test.cc +++ b/test/extensions/filters/network/mongo_proxy/bson_impl_test.cc @@ -5,8 +5,7 @@ #include "extensions/filters/network/mongo_proxy/bson_impl.h" #include "test/test_common/printers.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/filters/network/mongo_proxy/codec_impl_test.cc b/test/extensions/filters/network/mongo_proxy/codec_impl_test.cc index 350af0c22f4a..231ec814ef4e 100644 --- a/test/extensions/filters/network/mongo_proxy/codec_impl_test.cc +++ b/test/extensions/filters/network/mongo_proxy/codec_impl_test.cc @@ -7,9 +7,9 @@ #include "extensions/filters/network/mongo_proxy/codec_impl.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::Eq; using testing::NiceMock; @@ -41,7 +41,7 @@ class TestDecoderCallbacks : public DecoderCallbacks { MOCK_METHOD1(decodeCommandReply_, void(CommandReplyMessagePtr& message)); }; -class MongoCodecImplTest : public testing::Test { +class MongoCodecImplTest : public TestBase { public: Buffer::OwnedImpl output_; EncoderImpl encoder_{output_}; diff --git a/test/extensions/filters/network/mongo_proxy/config_test.cc b/test/extensions/filters/network/mongo_proxy/config_test.cc index 2c2c20379b69..b830022b6c24 100644 --- a/test/extensions/filters/network/mongo_proxy/config_test.cc +++ b/test/extensions/filters/network/mongo_proxy/config_test.cc @@ -3,9 +3,9 @@ #include "extensions/filters/network/mongo_proxy/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; diff --git a/test/extensions/filters/network/mongo_proxy/proxy_test.cc b/test/extensions/filters/network/mongo_proxy/proxy_test.cc index 740bc4fc32c1..63dddf1a4194 100644 --- a/test/extensions/filters/network/mongo_proxy/proxy_test.cc +++ b/test/extensions/filters/network/mongo_proxy/proxy_test.cc @@ -18,9 +18,9 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/runtime/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AnyNumber; @@ -60,7 +60,7 @@ class TestProxyFilter : public ProxyFilter { DecoderCallbacks* callbacks_{}; }; -class MongoProxyFilterTest : public testing::Test { +class MongoProxyFilterTest : public TestBase { public: MongoProxyFilterTest() { setup(); } diff --git a/test/extensions/filters/network/mongo_proxy/utility_test.cc b/test/extensions/filters/network/mongo_proxy/utility_test.cc index d297f9394c8b..f15524711c82 100644 --- a/test/extensions/filters/network/mongo_proxy/utility_test.cc +++ b/test/extensions/filters/network/mongo_proxy/utility_test.cc @@ -4,7 +4,7 @@ #include "extensions/filters/network/mongo_proxy/codec_impl.h" #include "extensions/filters/network/mongo_proxy/utility.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/filters/network/mysql_proxy/mysql_codec_test.cc b/test/extensions/filters/network/mysql_proxy/mysql_codec_test.cc index 97a17d4b96a9..e724eb601199 100644 --- a/test/extensions/filters/network/mysql_proxy/mysql_codec_test.cc +++ b/test/extensions/filters/network/mysql_proxy/mysql_codec_test.cc @@ -5,8 +5,9 @@ #include "extensions/filters/network/mysql_proxy/mysql_codec_greeting.h" #include "extensions/filters/network/mysql_proxy/mysql_utils.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "mysql_test_utils.h" namespace Envoy { @@ -19,7 +20,7 @@ constexpr int MYSQL_UT_LAST_ID = 0; constexpr int MYSQL_UT_SERVER_OK = 0; constexpr int MYSQL_UT_SERVER_WARNINGS = 0x0001; -class MySQLCodecTest : public MySQLTestUtils, public testing::Test { +class MySQLCodecTest : public MySQLTestUtils, public TestBase { protected: uint64_t offset_{0}; }; diff --git a/test/extensions/filters/network/mysql_proxy/mysql_command_test.cc b/test/extensions/filters/network/mysql_proxy/mysql_command_test.cc index a0c6ca81d7f8..ce6cc1795045 100644 --- a/test/extensions/filters/network/mysql_proxy/mysql_command_test.cc +++ b/test/extensions/filters/network/mysql_proxy/mysql_command_test.cc @@ -5,8 +5,9 @@ #include "extensions/filters/network/mysql_proxy/mysql_codec_greeting.h" #include "extensions/filters/network/mysql_proxy/mysql_utils.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "include/sqlparser/SQLParser.h" #include "mysql_test_utils.h" @@ -15,7 +16,7 @@ namespace Extensions { namespace NetworkFilters { namespace MySQLProxy { -class MySQLCommandTest : public MySQLTestUtils, public testing::Test { +class MySQLCommandTest : public MySQLTestUtils, public TestBase { public: int encodeQuery(std::string query, hsql::SQLParserResult& result) { Command mysql_cmd_encode{}; diff --git a/test/extensions/filters/network/mysql_proxy/mysql_filter_test.cc b/test/extensions/filters/network/mysql_proxy/mysql_filter_test.cc index 11e6e1c335ae..cd5e80a547f5 100644 --- a/test/extensions/filters/network/mysql_proxy/mysql_filter_test.cc +++ b/test/extensions/filters/network/mysql_proxy/mysql_filter_test.cc @@ -3,9 +3,9 @@ #include "extensions/filters/network/mysql_proxy/mysql_utils.h" #include "test/mocks/network/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "mysql_test_utils.h" using testing::NiceMock; @@ -17,7 +17,7 @@ namespace MySQLProxy { constexpr int SESSIONS = 5; -class MySQLFilterTest : public MySQLTestUtils, public testing::Test { +class MySQLFilterTest : public MySQLTestUtils, public TestBase { public: MySQLFilterTest() { ENVOY_LOG_MISC(info, "test"); } diff --git a/test/extensions/filters/network/mysql_proxy/mysql_integration_test.cc b/test/extensions/filters/network/mysql_proxy/mysql_integration_test.cc index 02e72eb07cb0..0c5adcb1691c 100644 --- a/test/extensions/filters/network/mysql_proxy/mysql_integration_test.cc +++ b/test/extensions/filters/network/mysql_proxy/mysql_integration_test.cc @@ -11,9 +11,9 @@ #include "test/integration/utility.h" #include "test/mocks/network/mocks.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "mysql_test_utils.h" #include "rapidjson/document.h" @@ -28,7 +28,7 @@ constexpr int SESSIONS = 5; class MySQLIntegrationTest : public MySQLTestUtils, public BaseIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { std::string mysqlConfig() { return TestEnvironment::readFileToStringForTest(TestEnvironment::runfilesPath( "test/extensions/filters/network/mysql_proxy/mysql_test_config.yaml")); diff --git a/test/extensions/filters/network/ratelimit/config_test.cc b/test/extensions/filters/network/ratelimit/config_test.cc index c15553fa49db..1019092538dc 100644 --- a/test/extensions/filters/network/ratelimit/config_test.cc +++ b/test/extensions/filters/network/ratelimit/config_test.cc @@ -6,9 +6,9 @@ #include "extensions/filters/network/ratelimit/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::ReturnRef; diff --git a/test/extensions/filters/network/ratelimit/ratelimit_test.cc b/test/extensions/filters/network/ratelimit/ratelimit_test.cc index eb6b9ee4db80..2d3babd20ddd 100644 --- a/test/extensions/filters/network/ratelimit/ratelimit_test.cc +++ b/test/extensions/filters/network/ratelimit/ratelimit_test.cc @@ -16,9 +16,9 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/tracing/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -32,7 +32,7 @@ namespace Extensions { namespace NetworkFilters { namespace RateLimitFilter { -class RateLimitFilterTest : public testing::Test { +class RateLimitFilterTest : public TestBase { public: RateLimitFilterTest() {} diff --git a/test/extensions/filters/network/rbac/config_test.cc b/test/extensions/filters/network/rbac/config_test.cc index 3479f43d032a..62e1bc9bde11 100644 --- a/test/extensions/filters/network/rbac/config_test.cc +++ b/test/extensions/filters/network/rbac/config_test.cc @@ -3,10 +3,10 @@ #include "extensions/filters/network/rbac/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "fmt/printf.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -23,7 +23,7 @@ const std::string header = R"EOF( } // namespace -class RoleBasedAccessControlNetworkFilterConfigFactoryTest : public testing::Test { +class RoleBasedAccessControlNetworkFilterConfigFactoryTest : public TestBase { public: void validateRule(const std::string& policy_json) { checkRule(fmt::sprintf(policy_json, header)); diff --git a/test/extensions/filters/network/rbac/filter_test.cc b/test/extensions/filters/network/rbac/filter_test.cc index feb084d5714c..031db15b7aba 100644 --- a/test/extensions/filters/network/rbac/filter_test.cc +++ b/test/extensions/filters/network/rbac/filter_test.cc @@ -17,7 +17,7 @@ namespace Extensions { namespace NetworkFilters { namespace RBACFilter { -class RoleBasedAccessControlNetworkFilterTest : public testing::Test { +class RoleBasedAccessControlNetworkFilterTest : public TestBase { public: RoleBasedAccessControlFilterConfigSharedPtr setupConfig(bool with_policy = true, bool continuous = false) { diff --git a/test/extensions/filters/network/rbac/integration_test.cc b/test/extensions/filters/network/rbac/integration_test.cc index 753eb2c7b6f2..2e1d83186b9b 100644 --- a/test/extensions/filters/network/rbac/integration_test.cc +++ b/test/extensions/filters/network/rbac/integration_test.cc @@ -16,7 +16,7 @@ std::string rbac_config; class RoleBasedAccessControlNetworkFilterIntegrationTest : public BaseIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: RoleBasedAccessControlNetworkFilterIntegrationTest() : BaseIntegrationTest(GetParam(), realTime(), rbac_config) {} diff --git a/test/extensions/filters/network/redis_proxy/codec_impl_test.cc b/test/extensions/filters/network/redis_proxy/codec_impl_test.cc index 9ecf21470763..1a53711ac9df 100644 --- a/test/extensions/filters/network/redis_proxy/codec_impl_test.cc +++ b/test/extensions/filters/network/redis_proxy/codec_impl_test.cc @@ -7,16 +7,15 @@ #include "test/extensions/filters/network/redis_proxy/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace NetworkFilters { namespace RedisProxy { -class RedisEncoderDecoderImplTest : public testing::Test, public DecoderCallbacks { +class RedisEncoderDecoderImplTest : public TestBase, public DecoderCallbacks { public: RedisEncoderDecoderImplTest() : decoder_(*this) {} diff --git a/test/extensions/filters/network/redis_proxy/command_splitter_impl_test.cc b/test/extensions/filters/network/redis_proxy/command_splitter_impl_test.cc index 2fc502a26ebf..0e4b53d16eb2 100644 --- a/test/extensions/filters/network/redis_proxy/command_splitter_impl_test.cc +++ b/test/extensions/filters/network/redis_proxy/command_splitter_impl_test.cc @@ -14,9 +14,9 @@ #include "test/mocks/stats/mocks.h" #include "test/test_common/printers.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::ByRef; @@ -35,7 +35,7 @@ namespace NetworkFilters { namespace RedisProxy { namespace CommandSplitter { -class RedisCommandSplitterImplTest : public testing::Test { +class RedisCommandSplitterImplTest : public TestBase { public: void makeBulkStringArray(RespValue& value, const std::vector& strings) { std::vector values(strings.size()); diff --git a/test/extensions/filters/network/redis_proxy/config_test.cc b/test/extensions/filters/network/redis_proxy/config_test.cc index 074862e5718c..ca5a7b5305cb 100644 --- a/test/extensions/filters/network/redis_proxy/config_test.cc +++ b/test/extensions/filters/network/redis_proxy/config_test.cc @@ -5,9 +5,9 @@ #include "extensions/filters/network/redis_proxy/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; diff --git a/test/extensions/filters/network/redis_proxy/conn_pool_impl_test.cc b/test/extensions/filters/network/redis_proxy/conn_pool_impl_test.cc index eaa065ac28f9..95f0d84dfa4d 100644 --- a/test/extensions/filters/network/redis_proxy/conn_pool_impl_test.cc +++ b/test/extensions/filters/network/redis_proxy/conn_pool_impl_test.cc @@ -11,9 +11,9 @@ #include "test/mocks/thread_local/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::DoAll; @@ -39,7 +39,7 @@ createConnPoolSettings() { return setting; } -class RedisClientImplTest : public testing::Test, public DecoderFactory { +class RedisClientImplTest : public TestBase, public DecoderFactory { public: // RedisProxy::DecoderFactory DecoderPtr create(DecoderCallbacks& callbacks) override { @@ -380,7 +380,7 @@ TEST(RedisClientFactoryImplTest, Basic) { client->close(); } -class RedisConnPoolImplTest : public testing::Test, public ClientFactory { +class RedisConnPoolImplTest : public TestBase, public ClientFactory { public: void setup(bool cluster_exists = true) { EXPECT_CALL(cm_, addThreadLocalClusterUpdateCallbacks_(_)) diff --git a/test/extensions/filters/network/redis_proxy/mocks.cc b/test/extensions/filters/network/redis_proxy/mocks.cc index c3283870c80d..b18f0efed0e1 100644 --- a/test/extensions/filters/network/redis_proxy/mocks.cc +++ b/test/extensions/filters/network/redis_proxy/mocks.cc @@ -4,8 +4,9 @@ #include "common/common/assert.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/extensions/filters/network/redis_proxy/proxy_filter_test.cc b/test/extensions/filters/network/redis_proxy/proxy_filter_test.cc index 9861b10e88f0..b1a097f4386c 100644 --- a/test/extensions/filters/network/redis_proxy/proxy_filter_test.cc +++ b/test/extensions/filters/network/redis_proxy/proxy_filter_test.cc @@ -10,10 +10,10 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::ByRef; @@ -40,7 +40,7 @@ parseProtoFromJson(const std::string& json_string) { return config; } -class RedisProxyFilterConfigTest : public testing::Test { +class RedisProxyFilterConfigTest : public TestBase { public: Stats::IsolatedStoreImpl store_; Network::MockDrainDecision drain_decision_; @@ -73,7 +73,7 @@ TEST_F(RedisProxyFilterConfigTest, BadRedisProxyConfig) { EXPECT_THROW(parseProtoFromJson(json_string), Json::Exception); } -class RedisProxyFilterTest : public testing::Test, public DecoderFactory { +class RedisProxyFilterTest : public TestBase, public DecoderFactory { public: RedisProxyFilterTest() { std::string json_string = R"EOF( diff --git a/test/extensions/filters/network/sni_cluster/sni_cluster_test.cc b/test/extensions/filters/network/sni_cluster/sni_cluster_test.cc index 9cc39bd6d2e6..4ce86542422d 100644 --- a/test/extensions/filters/network/sni_cluster/sni_cluster_test.cc +++ b/test/extensions/filters/network/sni_cluster/sni_cluster_test.cc @@ -6,9 +6,9 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/server/mocks.h" #include "test/mocks/stream_info/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Matcher; diff --git a/test/extensions/filters/network/tcp_proxy/config_test.cc b/test/extensions/filters/network/tcp_proxy/config_test.cc index 542b4414044f..5300b146f2df 100644 --- a/test/extensions/filters/network/tcp_proxy/config_test.cc +++ b/test/extensions/filters/network/tcp_proxy/config_test.cc @@ -1,9 +1,9 @@ #include "extensions/filters/network/tcp_proxy/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; @@ -12,7 +12,7 @@ namespace Extensions { namespace NetworkFilters { namespace TcpProxy { -class RouteIpListConfigTest : public ::testing::TestWithParam {}; +class RouteIpListConfigTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpList, RouteIpListConfigTest, ::testing::Values(R"EOF("destination_ip_list": [ diff --git a/test/extensions/filters/network/thrift_proxy/app_exception_impl_test.cc b/test/extensions/filters/network/thrift_proxy/app_exception_impl_test.cc index 245ecd9423ab..c755f35a5a8e 100644 --- a/test/extensions/filters/network/thrift_proxy/app_exception_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/app_exception_impl_test.cc @@ -3,9 +3,9 @@ #include "extensions/filters/network/thrift_proxy/app_exception_impl.h" #include "test/extensions/filters/network/thrift_proxy/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::InSequence; using testing::Ref; diff --git a/test/extensions/filters/network/thrift_proxy/auto_protocol_impl_test.cc b/test/extensions/filters/network/thrift_proxy/auto_protocol_impl_test.cc index ffb756103f0d..93a61e1f4a18 100644 --- a/test/extensions/filters/network/thrift_proxy/auto_protocol_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/auto_protocol_impl_test.cc @@ -10,10 +10,10 @@ #include "test/extensions/filters/network/thrift_proxy/mocks.h" #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; using testing::Ref; @@ -25,7 +25,7 @@ namespace Extensions { namespace NetworkFilters { namespace ThriftProxy { -class AutoProtocolTest : public testing::Test { +class AutoProtocolTest : public TestBase { public: void resetMetadata() { metadata_.setMethodName("-"); diff --git a/test/extensions/filters/network/thrift_proxy/auto_transport_impl_test.cc b/test/extensions/filters/network/thrift_proxy/auto_transport_impl_test.cc index e451dbdd6f85..ae5d12408aaa 100644 --- a/test/extensions/filters/network/thrift_proxy/auto_transport_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/auto_transport_impl_test.cc @@ -7,10 +7,10 @@ #include "test/extensions/filters/network/thrift_proxy/mocks.h" #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; using testing::Ref; diff --git a/test/extensions/filters/network/thrift_proxy/binary_protocol_impl_test.cc b/test/extensions/filters/network/thrift_proxy/binary_protocol_impl_test.cc index a3ea1d80a0cb..68052ae7abc2 100644 --- a/test/extensions/filters/network/thrift_proxy/binary_protocol_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/binary_protocol_impl_test.cc @@ -6,16 +6,15 @@ #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace NetworkFilters { namespace ThriftProxy { -class BinaryProtocolTest : public testing::Test { +class BinaryProtocolTest : public TestBase { public: void resetMetadata() { metadata_.setMethodName("-"); diff --git a/test/extensions/filters/network/thrift_proxy/buffer_helper_test.cc b/test/extensions/filters/network/thrift_proxy/buffer_helper_test.cc index 0f2a1b0cdb3a..8cdcf8453b2d 100644 --- a/test/extensions/filters/network/thrift_proxy/buffer_helper_test.cc +++ b/test/extensions/filters/network/thrift_proxy/buffer_helper_test.cc @@ -8,10 +8,9 @@ #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace NetworkFilters { diff --git a/test/extensions/filters/network/thrift_proxy/compact_protocol_impl_test.cc b/test/extensions/filters/network/thrift_proxy/compact_protocol_impl_test.cc index 4ceed3eec028..70ba1cb05b9c 100644 --- a/test/extensions/filters/network/thrift_proxy/compact_protocol_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/compact_protocol_impl_test.cc @@ -6,11 +6,9 @@ #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - -using testing::TestWithParam; using testing::Values; namespace Envoy { @@ -18,7 +16,7 @@ namespace Extensions { namespace NetworkFilters { namespace ThriftProxy { -class CompactProtocolTest : public testing::Test { +class CompactProtocolTest : public TestBase { public: void resetMetadata() { metadata_.setMethodName("-"); @@ -998,7 +996,7 @@ TEST_F(CompactProtocolTest, ReadBinary) { EXPECT_EQ(buffer.length(), 0); } -class CompactProtocolFieldTypeTest : public TestWithParam {}; +class CompactProtocolFieldTypeTest : public TestBaseWithParam {}; TEST_P(CompactProtocolFieldTypeTest, ConvertsToFieldType) { uint8_t compact_field_type = GetParam(); diff --git a/test/extensions/filters/network/thrift_proxy/config_test.cc b/test/extensions/filters/network/thrift_proxy/config_test.cc index 823c9ba56d05..df1765741e06 100644 --- a/test/extensions/filters/network/thrift_proxy/config_test.cc +++ b/test/extensions/filters/network/thrift_proxy/config_test.cc @@ -6,9 +6,9 @@ #include "test/extensions/filters/network/thrift_proxy/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/registry.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; @@ -67,11 +67,11 @@ class ThriftFilterConfigTestBase { ThriftProxyFilterConfigFactory factory_; }; -class ThriftFilterConfigTest : public ThriftFilterConfigTestBase, public testing::Test {}; +class ThriftFilterConfigTest : public ThriftFilterConfigTestBase, public TestBase {}; class ThriftFilterTransportConfigTest : public ThriftFilterConfigTestBase, - public testing::TestWithParam< + public TestBaseWithParam< envoy::config::filter::network::thrift_proxy::v2alpha1::TransportType> {}; INSTANTIATE_TEST_SUITE_P(TransportTypes, ThriftFilterTransportConfigTest, @@ -79,7 +79,7 @@ INSTANTIATE_TEST_SUITE_P(TransportTypes, ThriftFilterTransportConfigTest, class ThriftFilterProtocolConfigTest : public ThriftFilterConfigTestBase, - public testing::TestWithParam< + public TestBaseWithParam< envoy::config::filter::network::thrift_proxy::v2alpha1::ProtocolType> {}; INSTANTIATE_TEST_SUITE_P(ProtocolTypes, ThriftFilterProtocolConfigTest, diff --git a/test/extensions/filters/network/thrift_proxy/conn_manager_test.cc b/test/extensions/filters/network/thrift_proxy/conn_manager_test.cc index fc5d156b3cca..45dfc7e78b85 100644 --- a/test/extensions/filters/network/thrift_proxy/conn_manager_test.cc +++ b/test/extensions/filters/network/thrift_proxy/conn_manager_test.cc @@ -17,9 +17,9 @@ #include "test/mocks/server/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AnyNumber; @@ -70,7 +70,7 @@ class TestConfigImpl : public ConfigImpl { MockProtocol* protocol_{}; }; -class ThriftConnectionManagerTest : public testing::Test { +class ThriftConnectionManagerTest : public TestBase { public: ThriftConnectionManagerTest() : stats_(ThriftFilterStats::generateStats("test.", store_)) {} ~ThriftConnectionManagerTest() { diff --git a/test/extensions/filters/network/thrift_proxy/conn_state_test.cc b/test/extensions/filters/network/thrift_proxy/conn_state_test.cc index 5a875e9cc987..63d71848e9e3 100644 --- a/test/extensions/filters/network/thrift_proxy/conn_state_test.cc +++ b/test/extensions/filters/network/thrift_proxy/conn_state_test.cc @@ -1,6 +1,6 @@ #include "extensions/filters/network/thrift_proxy/conn_state.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/filters/network/thrift_proxy/decoder_test.cc b/test/extensions/filters/network/thrift_proxy/decoder_test.cc index ad2670c1af21..8cfa92bc3743 100644 --- a/test/extensions/filters/network/thrift_proxy/decoder_test.cc +++ b/test/extensions/filters/network/thrift_proxy/decoder_test.cc @@ -6,11 +6,11 @@ #include "test/extensions/filters/network/thrift_proxy/mocks.h" #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/strings/string_view.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AnyNumber; @@ -26,8 +26,7 @@ using testing::Return; using testing::ReturnRef; using testing::SetArgReferee; using testing::StrictMock; -using testing::TestParamInfo; -using testing::TestWithParam; +using ::testing::TestParamInfo; using testing::Values; namespace Envoy { @@ -190,7 +189,7 @@ class DecoderStateMachineTestBase { }; class DecoderStateMachineNonValueTest : public DecoderStateMachineTestBase, - public TestWithParam {}; + public TestBaseWithParam {}; static std::string protoStateParamToString(const TestParamInfo& params) { return ProtocolStateNameValues::name(params.param); @@ -205,10 +204,10 @@ INSTANTIATE_TEST_SUITE_P(NonValueProtocolStates, DecoderStateMachineNonValueTest ProtocolState::SetBegin, ProtocolState::SetEnd), protoStateParamToString); -class DecoderStateMachineTest : public DecoderStateMachineTestBase, public testing::Test {}; +class DecoderStateMachineTest : public DecoderStateMachineTestBase, public TestBase {}; class DecoderStateMachineValueTest : public DecoderStateMachineTestBase, - public TestWithParam {}; + public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(PrimitiveFieldTypes, DecoderStateMachineValueTest, Values(FieldType::Bool, FieldType::Byte, FieldType::Double, FieldType::I16, @@ -217,7 +216,7 @@ INSTANTIATE_TEST_SUITE_P(PrimitiveFieldTypes, DecoderStateMachineValueTest, class DecoderStateMachineNestingTest : public DecoderStateMachineTestBase, - public TestWithParam> {}; + public TestBaseWithParam> {}; static std::string nestedFieldTypesParamToString( const TestParamInfo>& params) { diff --git a/test/extensions/filters/network/thrift_proxy/filters/ratelimit/config_test.cc b/test/extensions/filters/network/thrift_proxy/filters/ratelimit/config_test.cc index 93ad98c5202d..d3913a8c2f3e 100644 --- a/test/extensions/filters/network/thrift_proxy/filters/ratelimit/config_test.cc +++ b/test/extensions/filters/network/thrift_proxy/filters/ratelimit/config_test.cc @@ -5,9 +5,9 @@ #include "test/extensions/filters/network/thrift_proxy/mocks.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::ReturnRef; diff --git a/test/extensions/filters/network/thrift_proxy/filters/ratelimit/ratelimit_test.cc b/test/extensions/filters/network/thrift_proxy/filters/ratelimit/ratelimit_test.cc index 76ec64e8ab1c..06fbdd7c4776 100644 --- a/test/extensions/filters/network/thrift_proxy/filters/ratelimit/ratelimit_test.cc +++ b/test/extensions/filters/network/thrift_proxy/filters/ratelimit/ratelimit_test.cc @@ -18,10 +18,10 @@ #include "test/mocks/tracing/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -39,7 +39,7 @@ namespace RateLimitFilter { using namespace Envoy::Extensions::NetworkFilters; -class ThriftRateLimitFilterTest : public testing::Test { +class ThriftRateLimitFilterTest : public TestBase { public: ThriftRateLimitFilterTest() { ON_CALL(runtime_.snapshot_, featureEnabled("ratelimit.thrift_filter_enabled", 100)) diff --git a/test/extensions/filters/network/thrift_proxy/framed_transport_impl_test.cc b/test/extensions/filters/network/thrift_proxy/framed_transport_impl_test.cc index f3afa26d2f10..ff4401140cdc 100644 --- a/test/extensions/filters/network/thrift_proxy/framed_transport_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/framed_transport_impl_test.cc @@ -6,10 +6,9 @@ #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace NetworkFilters { diff --git a/test/extensions/filters/network/thrift_proxy/header_transport_impl_test.cc b/test/extensions/filters/network/thrift_proxy/header_transport_impl_test.cc index 3884eac7862d..83296dd6e9c0 100644 --- a/test/extensions/filters/network/thrift_proxy/header_transport_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/header_transport_impl_test.cc @@ -8,10 +8,10 @@ #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/mocks/buffer/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; using testing::Return; diff --git a/test/extensions/filters/network/thrift_proxy/integration_test.cc b/test/extensions/filters/network/thrift_proxy/integration_test.cc index bfea576f2872..afe0d34a869f 100644 --- a/test/extensions/filters/network/thrift_proxy/integration_test.cc +++ b/test/extensions/filters/network/thrift_proxy/integration_test.cc @@ -3,12 +3,10 @@ #include "test/extensions/filters/network/thrift_proxy/integration.h" #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/network_utility.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::Combine; -using testing::TestParamInfo; -using testing::TestWithParam; +using ::testing::TestParamInfo; using testing::Values; namespace Envoy { @@ -18,7 +16,7 @@ namespace ThriftProxy { class ThriftConnManagerIntegrationTest : public BaseThriftIntegrationTest, - public TestWithParam> { + public TestBaseWithParam> { public: static void SetUpTestSuite() { thrift_config_ = ConfigHelper::BASE_CONFIG + R"EOF( diff --git a/test/extensions/filters/network/thrift_proxy/metadata_test.cc b/test/extensions/filters/network/thrift_proxy/metadata_test.cc index 17bd4a0aaeb8..a4eb46415cc6 100644 --- a/test/extensions/filters/network/thrift_proxy/metadata_test.cc +++ b/test/extensions/filters/network/thrift_proxy/metadata_test.cc @@ -1,10 +1,9 @@ #include "extensions/filters/network/thrift_proxy/metadata.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace NetworkFilters { diff --git a/test/extensions/filters/network/thrift_proxy/mocks.cc b/test/extensions/filters/network/thrift_proxy/mocks.cc index e32c0a654782..fa4b6c13301b 100644 --- a/test/extensions/filters/network/thrift_proxy/mocks.cc +++ b/test/extensions/filters/network/thrift_proxy/mocks.cc @@ -2,7 +2,7 @@ #include "common/protobuf/protobuf.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::_; using testing::Invoke; diff --git a/test/extensions/filters/network/thrift_proxy/route_matcher_test.cc b/test/extensions/filters/network/thrift_proxy/route_matcher_test.cc index 274285884f04..8025b5ecf145 100644 --- a/test/extensions/filters/network/thrift_proxy/route_matcher_test.cc +++ b/test/extensions/filters/network/thrift_proxy/route_matcher_test.cc @@ -5,10 +5,9 @@ #include "extensions/filters/network/thrift_proxy/router/router_impl.h" #include "test/extensions/filters/network/thrift_proxy/utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::_; namespace Envoy { diff --git a/test/extensions/filters/network/thrift_proxy/router_ratelimit_test.cc b/test/extensions/filters/network/thrift_proxy/router_ratelimit_test.cc index 92b2a3be00ce..9bd8bda64689 100644 --- a/test/extensions/filters/network/thrift_proxy/router_ratelimit_test.cc +++ b/test/extensions/filters/network/thrift_proxy/router_ratelimit_test.cc @@ -13,9 +13,9 @@ #include "test/extensions/filters/network/thrift_proxy/mocks.h" #include "test/mocks/ratelimit/mocks.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::ContainerEq; using testing::NiceMock; @@ -27,7 +27,7 @@ namespace ThriftProxy { namespace Router { namespace { -class ThriftRateLimitConfigurationTest : public testing::Test { +class ThriftRateLimitConfigurationTest : public TestBase { public: void initialize(const std::string& yaml) { envoy::config::filter::network::thrift_proxy::v2alpha1::ThriftProxy config; @@ -168,7 +168,7 @@ TEST_F(ThriftRateLimitConfigurationTest, Stages) { EXPECT_TRUE(rate_limits.empty()); } -class ThriftRateLimitPolicyEntryTest : public testing::Test { +class ThriftRateLimitPolicyEntryTest : public TestBase { public: void initialize(const std::string yaml) { envoy::api::v2::route::RateLimit rate_limit; diff --git a/test/extensions/filters/network/thrift_proxy/router_test.cc b/test/extensions/filters/network/thrift_proxy/router_test.cc index 8082baed3f71..082328dfad5d 100644 --- a/test/extensions/filters/network/thrift_proxy/router_test.cc +++ b/test/extensions/filters/network/thrift_proxy/router_test.cc @@ -17,9 +17,9 @@ #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" #include "test/test_common/registry.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::ContainsRegex; @@ -29,7 +29,6 @@ using testing::NiceMock; using testing::Ref; using testing::Return; using testing::ReturnRef; -using testing::TestWithParam; using testing::Values; namespace Envoy { @@ -329,11 +328,11 @@ class ThriftRouterTestBase { NiceMock upstream_connection_; }; -class ThriftRouterTest : public ThriftRouterTestBase, public testing::Test { +class ThriftRouterTest : public ThriftRouterTestBase, public TestBase { public: }; -class ThriftRouterFieldTypeTest : public ThriftRouterTestBase, public TestWithParam { +class ThriftRouterFieldTypeTest : public ThriftRouterTestBase, public TestBaseWithParam { public: }; @@ -342,7 +341,7 @@ INSTANTIATE_TEST_SUITE_P(PrimitiveFieldTypes, ThriftRouterFieldTypeTest, FieldType::I64, FieldType::Double, FieldType::String), fieldTypeParamToString); -class ThriftRouterContainerTest : public ThriftRouterTestBase, public TestWithParam { +class ThriftRouterContainerTest : public ThriftRouterTestBase, public TestBaseWithParam { public: }; diff --git a/test/extensions/filters/network/thrift_proxy/thrift_object_impl_test.cc b/test/extensions/filters/network/thrift_proxy/thrift_object_impl_test.cc index f0df6641e6bc..6b209fcc54bd 100644 --- a/test/extensions/filters/network/thrift_proxy/thrift_object_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/thrift_object_impl_test.cc @@ -5,10 +5,10 @@ #include "test/extensions/filters/network/thrift_proxy/mocks.h" #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::AnyNumber; using testing::Expectation; @@ -18,7 +18,6 @@ using testing::NiceMock; using testing::Ref; using testing::Return; using testing::ReturnRef; -using testing::TestWithParam; using testing::Values; namespace Envoy { @@ -143,7 +142,7 @@ class ThriftObjectImplTestBase { Buffer::OwnedImpl buffer_; }; -class ThriftObjectImplTest : public ThriftObjectImplTestBase, public testing::Test {}; +class ThriftObjectImplTest : public ThriftObjectImplTestBase, public TestBase {}; // Test parsing an empty struct (just a stop field). TEST_F(ThriftObjectImplTest, ParseEmptyStruct) { @@ -163,7 +162,7 @@ TEST_F(ThriftObjectImplTest, ParseEmptyStruct) { } class ThriftObjectImplValueTest : public ThriftObjectImplTestBase, - public TestWithParam {}; + public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(PrimitiveFieldTypes, ThriftObjectImplValueTest, Values(FieldType::Bool, FieldType::Byte, FieldType::Double, FieldType::I16, diff --git a/test/extensions/filters/network/thrift_proxy/translation_integration_test.cc b/test/extensions/filters/network/thrift_proxy/translation_integration_test.cc index 6997d9345ce0..3db1c54e6ba7 100644 --- a/test/extensions/filters/network/thrift_proxy/translation_integration_test.cc +++ b/test/extensions/filters/network/thrift_proxy/translation_integration_test.cc @@ -5,12 +5,10 @@ #include "test/extensions/filters/network/thrift_proxy/integration.h" #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/network_utility.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::Combine; -using testing::TestParamInfo; -using testing::TestWithParam; +using ::testing::TestParamInfo; using testing::Values; namespace Envoy { @@ -20,7 +18,8 @@ namespace ThriftProxy { class ThriftTranslationIntegrationTest : public BaseThriftIntegrationTest, - public TestWithParam> { + public TestBaseWithParam< + std::tuple> { public: static void SetUpTestSuite() { thrift_config_ = ConfigHelper::BASE_CONFIG + R"EOF( diff --git a/test/extensions/filters/network/thrift_proxy/twitter_protocol_impl_test.cc b/test/extensions/filters/network/thrift_proxy/twitter_protocol_impl_test.cc index 5b1b77b9ae78..388ce5e5fa7f 100644 --- a/test/extensions/filters/network/thrift_proxy/twitter_protocol_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/twitter_protocol_impl_test.cc @@ -7,10 +7,9 @@ #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace NetworkFilters { @@ -36,7 +35,7 @@ class TestTwitterProtocolImpl : public TwitterProtocolImpl { } }; -class TwitterProtocolTest : public testing::Test { +class TwitterProtocolTest : public TestBase { public: void clearMetadata() { metadata_.reset(new MessageMetadata()); } diff --git a/test/extensions/filters/network/thrift_proxy/unframed_transport_impl_test.cc b/test/extensions/filters/network/thrift_proxy/unframed_transport_impl_test.cc index 48097a6f1c2a..564c3df40130 100644 --- a/test/extensions/filters/network/thrift_proxy/unframed_transport_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/unframed_transport_impl_test.cc @@ -4,10 +4,9 @@ #include "test/extensions/filters/network/thrift_proxy/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace NetworkFilters { diff --git a/test/extensions/filters/network/thrift_proxy/utility.h b/test/extensions/filters/network/thrift_proxy/utility.h index d4fd19bb537e..384337592576 100644 --- a/test/extensions/filters/network/thrift_proxy/utility.h +++ b/test/extensions/filters/network/thrift_proxy/utility.h @@ -10,12 +10,12 @@ #include "extensions/filters/network/thrift_proxy/thrift.h" #include "test/common/buffer/utility.h" +#include "test/test_common/test_base.h" #include "absl/strings/ascii.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" -using testing::TestParamInfo; +using ::testing::TestParamInfo; namespace Envoy { namespace Extensions { diff --git a/test/extensions/health_checkers/redis/redis_test.cc b/test/extensions/health_checkers/redis/redis_test.cc index 1fa714c68d90..31579144ae37 100644 --- a/test/extensions/health_checkers/redis/redis_test.cc +++ b/test/extensions/health_checkers/redis/redis_test.cc @@ -25,7 +25,7 @@ namespace HealthCheckers { namespace RedisHealthChecker { class RedisHealthCheckerTest - : public testing::Test, + : public TestBase, public Extensions::NetworkFilters::RedisProxy::ConnPool::ClientFactory { public: RedisHealthCheckerTest() diff --git a/test/extensions/quic_listeners/quiche/dummy_test.cc b/test/extensions/quic_listeners/quiche/dummy_test.cc index 1d454c41e6a9..1624fd52ff94 100644 --- a/test/extensions/quic_listeners/quiche/dummy_test.cc +++ b/test/extensions/quic_listeners/quiche/dummy_test.cc @@ -1,6 +1,7 @@ #include "extensions/quic_listeners/quiche/dummy.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" + #include "quiche/http2/platform/api/http2_string.h" namespace Envoy { diff --git a/test/extensions/quic_listeners/quiche/platform/http2_platform_test.cc b/test/extensions/quic_listeners/quiche/platform/http2_platform_test.cc index 788c0c53921e..4f16a1a16442 100644 --- a/test/extensions/quic_listeners/quiche/platform/http2_platform_test.cc +++ b/test/extensions/quic_listeners/quiche/platform/http2_platform_test.cc @@ -1,6 +1,7 @@ #include -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" + #include "quiche/http2/platform/api/http2_arraysize.h" #include "quiche/http2/platform/api/http2_containers.h" #include "quiche/http2/platform/api/http2_estimate_memory_usage.h" diff --git a/test/extensions/quic_listeners/quiche/platform/quic_platform_test.cc b/test/extensions/quic_listeners/quiche/platform/quic_platform_test.cc index b13e141ea222..ed5222930ebb 100644 --- a/test/extensions/quic_listeners/quiche/platform/quic_platform_test.cc +++ b/test/extensions/quic_listeners/quiche/platform/quic_platform_test.cc @@ -1,4 +1,5 @@ -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" + #include "quiche/quic/platform/api/quic_aligned.h" #include "quiche/quic/platform/api/quic_arraysize.h" #include "quiche/quic/platform/api/quic_containers.h" diff --git a/test/extensions/quic_listeners/quiche/platform/spdy_platform_test.cc b/test/extensions/quic_listeners/quiche/platform/spdy_platform_test.cc index 7e6ff7a6494b..c2322424f53e 100644 --- a/test/extensions/quic_listeners/quiche/platform/spdy_platform_test.cc +++ b/test/extensions/quic_listeners/quiche/platform/spdy_platform_test.cc @@ -1,6 +1,7 @@ #include -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" + #include "quiche/spdy/platform/api/spdy_arraysize.h" #include "quiche/spdy/platform/api/spdy_containers.h" #include "quiche/spdy/platform/api/spdy_endianness_util.h" diff --git a/test/extensions/resource_monitors/fixed_heap/config_test.cc b/test/extensions/resource_monitors/fixed_heap/config_test.cc index fb73abee200f..edc9e54d44f6 100644 --- a/test/extensions/resource_monitors/fixed_heap/config_test.cc +++ b/test/extensions/resource_monitors/fixed_heap/config_test.cc @@ -8,8 +8,7 @@ #include "extensions/resource_monitors/fixed_heap/config.h" #include "test/mocks/event/mocks.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/resource_monitors/fixed_heap/fixed_heap_monitor_test.cc b/test/extensions/resource_monitors/fixed_heap/fixed_heap_monitor_test.cc index 637d5fe2a943..699d119bc75b 100644 --- a/test/extensions/resource_monitors/fixed_heap/fixed_heap_monitor_test.cc +++ b/test/extensions/resource_monitors/fixed_heap/fixed_heap_monitor_test.cc @@ -1,8 +1,9 @@ #include "extensions/resource_monitors/fixed_heap/fixed_heap_monitor.h" +#include "test/test_common/test_base.h" + #include "absl/types/optional.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/resource_monitors/injected_resource/config_test.cc b/test/extensions/resource_monitors/injected_resource/config_test.cc index 371ad3b11514..59f9cbfb3713 100644 --- a/test/extensions/resource_monitors/injected_resource/config_test.cc +++ b/test/extensions/resource_monitors/injected_resource/config_test.cc @@ -9,11 +9,10 @@ #include "extensions/resource_monitors/injected_resource/config.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace ResourceMonitors { diff --git a/test/extensions/resource_monitors/injected_resource/injected_resource_monitor_test.cc b/test/extensions/resource_monitors/injected_resource/injected_resource_monitor_test.cc index c0fa0dd7c8ae..5b2c5d862d98 100644 --- a/test/extensions/resource_monitors/injected_resource/injected_resource_monitor_test.cc +++ b/test/extensions/resource_monitors/injected_resource/injected_resource_monitor_test.cc @@ -6,13 +6,13 @@ #include "extensions/resource_monitors/injected_resource/injected_resource_monitor.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" #include "absl/strings/match.h" #include "absl/strings/str_cat.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Extensions { @@ -43,7 +43,7 @@ class MockedCallbacks : public Server::ResourceMonitor::Callbacks { MOCK_METHOD1(onFailure, void(const EnvoyException&)); }; -class InjectedResourceMonitorTest : public testing::Test { +class InjectedResourceMonitorTest : public TestBase { protected: InjectedResourceMonitorTest() : api_(Api::createApiForTest(stats_store_)), dispatcher_(test_time_.timeSystem(), *api_), diff --git a/test/extensions/retry/host/previous_hosts/config_test.cc b/test/extensions/retry/host/previous_hosts/config_test.cc index aed15a272c44..02621aabba0e 100644 --- a/test/extensions/retry/host/previous_hosts/config_test.cc +++ b/test/extensions/retry/host/previous_hosts/config_test.cc @@ -5,9 +5,9 @@ #include "extensions/retry/host/well_known_names.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using namespace testing; diff --git a/test/extensions/retry/priority/previous_priorities/config_test.cc b/test/extensions/retry/priority/previous_priorities/config_test.cc index 9d4f0bfe0904..76933ba71092 100644 --- a/test/extensions/retry/priority/previous_priorities/config_test.cc +++ b/test/extensions/retry/priority/previous_priorities/config_test.cc @@ -6,9 +6,9 @@ #include "extensions/retry/priority/well_known_names.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using namespace testing; @@ -17,7 +17,7 @@ namespace Extensions { namespace Retry { namespace Priority { -class RetryPriorityTest : public ::testing::Test { +class RetryPriorityTest : public TestBase { public: void initialize(const Upstream::HealthyLoad& original_healthy_priority_load, const Upstream::DegradedLoad& original_degraded_priority_load) { diff --git a/test/extensions/stats_sinks/common/statsd/statsd_test.cc b/test/extensions/stats_sinks/common/statsd/statsd_test.cc index 28e8cf180893..4aa7c7f597c0 100644 --- a/test/extensions/stats_sinks/common/statsd/statsd_test.cc +++ b/test/extensions/stats_sinks/common/statsd/statsd_test.cc @@ -13,9 +13,9 @@ #include "test/mocks/stats/mocks.h" #include "test/mocks/thread_local/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -29,7 +29,7 @@ namespace StatSinks { namespace Common { namespace Statsd { -class TcpStatsdSinkTest : public testing::Test { +class TcpStatsdSinkTest : public TestBase { public: TcpStatsdSinkTest() { sink_ = std::make_unique( diff --git a/test/extensions/stats_sinks/common/statsd/udp_statsd_test.cc b/test/extensions/stats_sinks/common/statsd/udp_statsd_test.cc index 85454d3fd661..dbf8bac660b2 100644 --- a/test/extensions/stats_sinks/common/statsd/udp_statsd_test.cc +++ b/test/extensions/stats_sinks/common/statsd/udp_statsd_test.cc @@ -9,10 +9,10 @@ #include "test/mocks/thread_local/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "spdlog/spdlog.h" using testing::NiceMock; @@ -28,7 +28,7 @@ class MockWriter : public Writer { MOCK_METHOD1(write, void(const std::string& message)); }; -class UdpStatsdSinkTest : public testing::TestWithParam {}; +class UdpStatsdSinkTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpVersions, UdpStatsdSinkTest, testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), TestUtility::ipTestParamsToString); @@ -72,7 +72,7 @@ TEST_P(UdpStatsdSinkTest, InitWithIpAddress) { tls_.shutdownThread(); } -class UdpStatsdSinkWithTagsTest : public testing::TestWithParam {}; +class UdpStatsdSinkWithTagsTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpVersions, UdpStatsdSinkWithTagsTest, testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), TestUtility::ipTestParamsToString); diff --git a/test/extensions/stats_sinks/dog_statsd/config_test.cc b/test/extensions/stats_sinks/dog_statsd/config_test.cc index a7d00a70f4d3..f73630a470bd 100644 --- a/test/extensions/stats_sinks/dog_statsd/config_test.cc +++ b/test/extensions/stats_sinks/dog_statsd/config_test.cc @@ -11,10 +11,10 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -26,7 +26,7 @@ namespace Extensions { namespace StatSinks { namespace DogStatsd { -class DogStatsdConfigLoopbackTest : public testing::TestWithParam {}; +class DogStatsdConfigLoopbackTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpVersions, DogStatsdConfigLoopbackTest, testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), TestUtility::ipTestParamsToString); diff --git a/test/extensions/stats_sinks/hystrix/config_test.cc b/test/extensions/stats_sinks/hystrix/config_test.cc index abcdcca16910..f1a0557f610d 100644 --- a/test/extensions/stats_sinks/hystrix/config_test.cc +++ b/test/extensions/stats_sinks/hystrix/config_test.cc @@ -10,10 +10,10 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/extensions/stats_sinks/hystrix/hystrix_test.cc b/test/extensions/stats_sinks/hystrix/hystrix_test.cc index baf24727a0b3..1e20bc4effb0 100644 --- a/test/extensions/stats_sinks/hystrix/hystrix_test.cc +++ b/test/extensions/stats_sinks/hystrix/hystrix_test.cc @@ -8,12 +8,12 @@ #include "test/mocks/server/mocks.h" #include "test/mocks/stats/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "absl/strings/str_split.h" #include "circllhist.h" #include "fmt/printf.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::HasSubstr; @@ -116,7 +116,7 @@ class HistogramWrapper { histogram_t* histogram_; }; -class HystrixSinkTest : public testing::Test { +class HystrixSinkTest : public TestBase { public: HystrixSinkTest() { sink_ = std::make_unique(server_, window_size_); } diff --git a/test/extensions/stats_sinks/metrics_service/grpc_metrics_service_impl_test.cc b/test/extensions/stats_sinks/metrics_service/grpc_metrics_service_impl_test.cc index 932a5ee8adb3..6b9d66f19569 100644 --- a/test/extensions/stats_sinks/metrics_service/grpc_metrics_service_impl_test.cc +++ b/test/extensions/stats_sinks/metrics_service/grpc_metrics_service_impl_test.cc @@ -19,7 +19,7 @@ namespace Extensions { namespace StatSinks { namespace MetricsService { -class GrpcMetricsStreamerImplTest : public testing::Test { +class GrpcMetricsStreamerImplTest : public TestBase { public: typedef Grpc::MockAsyncStream MockMetricsStream; typedef Grpc::TypedAsyncStreamCallbacks @@ -95,7 +95,7 @@ class TestGrpcMetricsStreamer : public GrpcMetricsStreamer { } }; -class MetricsServiceSinkTest : public testing::Test {}; +class MetricsServiceSinkTest : public TestBase {}; TEST(MetricsServiceSinkTest, CheckSendCall) { NiceMock source; diff --git a/test/extensions/stats_sinks/metrics_service/metrics_service_integration_test.cc b/test/extensions/stats_sinks/metrics_service/metrics_service_integration_test.cc index 696bdceb3e97..476dce27a5d4 100644 --- a/test/extensions/stats_sinks/metrics_service/metrics_service_integration_test.cc +++ b/test/extensions/stats_sinks/metrics_service/metrics_service_integration_test.cc @@ -8,10 +8,9 @@ #include "test/common/grpc/grpc_client_integration.h" #include "test/integration/http_integration.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::AssertionResult; namespace Envoy { diff --git a/test/extensions/stats_sinks/statsd/config_test.cc b/test/extensions/stats_sinks/statsd/config_test.cc index 17bc912432c3..66c249445c61 100644 --- a/test/extensions/stats_sinks/statsd/config_test.cc +++ b/test/extensions/stats_sinks/statsd/config_test.cc @@ -12,10 +12,10 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; @@ -46,7 +46,7 @@ TEST(StatsConfigTest, ValidTcpStatsd) { EXPECT_NE(dynamic_cast(sink.get()), nullptr); } -class StatsConfigParameterizedTest : public testing::TestWithParam {}; +class StatsConfigParameterizedTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpVersions, StatsConfigParameterizedTest, testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), @@ -163,7 +163,7 @@ TEST(StatsConfigTest, TcpSinkCustomPrefix) { EXPECT_EQ(tcp_sink->getPrefix(), prefix); } -class StatsConfigLoopbackTest : public testing::TestWithParam {}; +class StatsConfigLoopbackTest : public TestBaseWithParam {}; INSTANTIATE_TEST_SUITE_P(IpVersions, StatsConfigLoopbackTest, testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), TestUtility::ipTestParamsToString); diff --git a/test/extensions/tracers/common/ot/opentracing_driver_impl_test.cc b/test/extensions/tracers/common/ot/opentracing_driver_impl_test.cc index c826495f54bc..fb9aa7c1228a 100644 --- a/test/extensions/tracers/common/ot/opentracing_driver_impl_test.cc +++ b/test/extensions/tracers/common/ot/opentracing_driver_impl_test.cc @@ -5,9 +5,9 @@ #include "test/mocks/http/mocks.h" #include "test/mocks/stats/mocks.h" #include "test/mocks/tracing/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "opentracing/mocktracer/in_memory_recorder.h" #include "opentracing/mocktracer/tracer.h" @@ -44,7 +44,7 @@ class TestDriver : public OpenTracingDriver { std::shared_ptr tracer_; }; -class OpenTracingDriverTest : public testing::Test { +class OpenTracingDriverTest : public TestBase { public: void setupValidDriver(OpenTracingDriver::PropagationMode propagation_mode = diff --git a/test/extensions/tracers/datadog/config_test.cc b/test/extensions/tracers/datadog/config_test.cc index a4f9b1947000..49659cda9c18 100644 --- a/test/extensions/tracers/datadog/config_test.cc +++ b/test/extensions/tracers/datadog/config_test.cc @@ -1,9 +1,9 @@ #include "extensions/tracers/datadog/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/extensions/tracers/datadog/datadog_tracer_impl_test.cc b/test/extensions/tracers/datadog/datadog_tracer_impl_test.cc index f9cd337dc5ff..951b4ec673f9 100644 --- a/test/extensions/tracers/datadog/datadog_tracer_impl_test.cc +++ b/test/extensions/tracers/datadog/datadog_tracer_impl_test.cc @@ -21,10 +21,10 @@ #include "test/mocks/tracing/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AtLeast; @@ -38,7 +38,7 @@ namespace Extensions { namespace Tracers { namespace Datadog { -class DatadogDriverTest : public testing::Test { +class DatadogDriverTest : public TestBase { public: void setup(envoy::config::trace::v2::DatadogConfig& datadog_config, bool init_timer) { ON_CALL(cm_, httpAsyncClientForCluster("fake_cluster")) diff --git a/test/extensions/tracers/dynamic_ot/config_test.cc b/test/extensions/tracers/dynamic_ot/config_test.cc index abe86ef70579..074efca2258e 100644 --- a/test/extensions/tracers/dynamic_ot/config_test.cc +++ b/test/extensions/tracers/dynamic_ot/config_test.cc @@ -2,10 +2,10 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "fmt/printf.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/extensions/tracers/dynamic_ot/dynamic_opentracing_driver_impl_test.cc b/test/extensions/tracers/dynamic_ot/dynamic_opentracing_driver_impl_test.cc index 3e75240289bc..a4789b82b76f 100644 --- a/test/extensions/tracers/dynamic_ot/dynamic_opentracing_driver_impl_test.cc +++ b/test/extensions/tracers/dynamic_ot/dynamic_opentracing_driver_impl_test.cc @@ -8,17 +8,17 @@ #include "test/mocks/stats/mocks.h" #include "test/mocks/tracing/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "fmt/printf.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Extensions { namespace Tracers { namespace DynamicOt { -class DynamicOpenTracingDriverTest : public testing::Test { +class DynamicOpenTracingDriverTest : public TestBase { public: void setup(const std::string& library, const std::string& tracer_config) { driver_ = std::make_unique(stats_, library, tracer_config); diff --git a/test/extensions/tracers/lightstep/config_test.cc b/test/extensions/tracers/lightstep/config_test.cc index 173d3b1c1bc6..ec0f129d4efc 100644 --- a/test/extensions/tracers/lightstep/config_test.cc +++ b/test/extensions/tracers/lightstep/config_test.cc @@ -1,9 +1,9 @@ #include "extensions/tracers/lightstep/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/extensions/tracers/lightstep/lightstep_tracer_impl_test.cc b/test/extensions/tracers/lightstep/lightstep_tracer_impl_test.cc index 5bbd6c6c2e02..ac34b3bb8abd 100644 --- a/test/extensions/tracers/lightstep/lightstep_tracer_impl_test.cc +++ b/test/extensions/tracers/lightstep/lightstep_tracer_impl_test.cc @@ -22,10 +22,10 @@ #include "test/mocks/tracing/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AtLeast; @@ -39,7 +39,7 @@ namespace Extensions { namespace Tracers { namespace Lightstep { -class LightStepDriverTest : public testing::Test { +class LightStepDriverTest : public TestBase { public: void setup(envoy::config::trace::v2::LightstepConfig& lightstep_config, bool init_timer, Common::Ot::OpenTracingDriver::PropagationMode propagation_mode = diff --git a/test/extensions/tracers/zipkin/config_test.cc b/test/extensions/tracers/zipkin/config_test.cc index 017c7344f6b9..f9ced3f65611 100644 --- a/test/extensions/tracers/zipkin/config_test.cc +++ b/test/extensions/tracers/zipkin/config_test.cc @@ -3,9 +3,9 @@ #include "extensions/tracers/zipkin/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Extensions { diff --git a/test/extensions/tracers/zipkin/span_buffer_test.cc b/test/extensions/tracers/zipkin/span_buffer_test.cc index 987e059efdbb..4e31f1574592 100644 --- a/test/extensions/tracers/zipkin/span_buffer_test.cc +++ b/test/extensions/tracers/zipkin/span_buffer_test.cc @@ -1,9 +1,8 @@ #include "extensions/tracers/zipkin/span_buffer.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace Tracers { diff --git a/test/extensions/tracers/zipkin/span_context_extractor_test.cc b/test/extensions/tracers/zipkin/span_context_extractor_test.cc index a88815b173c5..19f47d6ad4cf 100644 --- a/test/extensions/tracers/zipkin/span_context_extractor_test.cc +++ b/test/extensions/tracers/zipkin/span_context_extractor_test.cc @@ -3,10 +3,9 @@ #include "extensions/tracers/zipkin/span_context.h" #include "extensions/tracers/zipkin/span_context_extractor.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace Tracers { diff --git a/test/extensions/tracers/zipkin/tracer_test.cc b/test/extensions/tracers/zipkin/tracer_test.cc index d564ea71a3d8..5f8683f02b8b 100644 --- a/test/extensions/tracers/zipkin/tracer_test.cc +++ b/test/extensions/tracers/zipkin/tracer_test.cc @@ -11,10 +11,10 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/tracing/mocks.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; using testing::Return; @@ -36,7 +36,7 @@ class TestReporterImpl : public Reporter { std::vector reported_spans_; }; -class ZipkinTracerTest : public testing::Test { +class ZipkinTracerTest : public TestBase { protected: Event::SimulatedTimeSystem time_system_; }; diff --git a/test/extensions/tracers/zipkin/util_test.cc b/test/extensions/tracers/zipkin/util_test.cc index 3383409837e3..da23564fcdf1 100644 --- a/test/extensions/tracers/zipkin/util_test.cc +++ b/test/extensions/tracers/zipkin/util_test.cc @@ -1,9 +1,8 @@ #include "extensions/tracers/zipkin/util.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace Tracers { diff --git a/test/extensions/tracers/zipkin/zipkin_core_types_test.cc b/test/extensions/tracers/zipkin/zipkin_core_types_test.cc index a534e6b6e9c0..8ee41672f36e 100644 --- a/test/extensions/tracers/zipkin/zipkin_core_types_test.cc +++ b/test/extensions/tracers/zipkin/zipkin_core_types_test.cc @@ -5,10 +5,9 @@ #include "extensions/tracers/zipkin/zipkin_core_constants.h" #include "extensions/tracers/zipkin/zipkin_core_types.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Extensions { namespace Tracers { diff --git a/test/extensions/tracers/zipkin/zipkin_tracer_impl_test.cc b/test/extensions/tracers/zipkin/zipkin_tracer_impl_test.cc index 28fb6d208765..5b65d2650ff1 100644 --- a/test/extensions/tracers/zipkin/zipkin_tracer_impl_test.cc +++ b/test/extensions/tracers/zipkin/zipkin_tracer_impl_test.cc @@ -21,10 +21,10 @@ #include "test/mocks/thread_local/mocks.h" #include "test/mocks/tracing/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -37,7 +37,7 @@ namespace Extensions { namespace Tracers { namespace Zipkin { -class ZipkinDriverTest : public testing::Test { +class ZipkinDriverTest : public TestBase { public: ZipkinDriverTest() : time_source_(test_time_.timeSystem()) {} diff --git a/test/extensions/transport_sockets/alts/alts_integration_test.cc b/test/extensions/transport_sockets/alts/alts_integration_test.cc index 39a2884e6d73..c4edaaac6d92 100644 --- a/test/extensions/transport_sockets/alts/alts_integration_test.cc +++ b/test/extensions/transport_sockets/alts/alts_integration_test.cc @@ -11,6 +11,7 @@ #include "test/integration/utility.h" #include "test/mocks/server/mocks.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/strings/match.h" @@ -18,7 +19,6 @@ #include "gmock/gmock.h" #include "grpcpp/grpcpp.h" #include "grpcpp/impl/codegen/service_type.h" -#include "gtest/gtest.h" namespace Envoy { namespace Extensions { @@ -26,7 +26,7 @@ namespace TransportSockets { namespace Alts { class AltsIntegrationTestBase : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: AltsIntegrationTestBase(const std::string& server_peer_identity, const std::string& client_peer_identity, bool server_connect_handshaker, diff --git a/test/extensions/transport_sockets/alts/config_test.cc b/test/extensions/transport_sockets/alts/config_test.cc index ec73769e2547..01b5a4bd4962 100644 --- a/test/extensions/transport_sockets/alts/config_test.cc +++ b/test/extensions/transport_sockets/alts/config_test.cc @@ -5,9 +5,9 @@ #include "extensions/transport_sockets/alts/config.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using Envoy::Server::Configuration::MockTransportSocketFactoryContext; using testing::_; diff --git a/test/extensions/transport_sockets/alts/noop_transport_socket_callbacks_test.cc b/test/extensions/transport_sockets/alts/noop_transport_socket_callbacks_test.cc index e9a3b6bdfb3c..7bcd43dee910 100644 --- a/test/extensions/transport_sockets/alts/noop_transport_socket_callbacks_test.cc +++ b/test/extensions/transport_sockets/alts/noop_transport_socket_callbacks_test.cc @@ -5,8 +5,7 @@ #include "extensions/transport_sockets/alts/noop_transport_socket_callbacks.h" #include "test/mocks/network/mocks.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Extensions { @@ -37,7 +36,7 @@ class TestTransportSocketCallbacks : public Network::TransportSocketCallbacks { Network::Connection& connection_; }; -class NoOpTransportSocketCallbacksTest : public testing::Test { +class NoOpTransportSocketCallbacksTest : public TestBase { protected: NoOpTransportSocketCallbacksTest() : wrapper_callbacks_(connection_), wrapped_callbacks_(wrapper_callbacks_) {} diff --git a/test/extensions/transport_sockets/alts/tsi_frame_protector_test.cc b/test/extensions/transport_sockets/alts/tsi_frame_protector_test.cc index 724638b3d4a1..a82d33a11afd 100644 --- a/test/extensions/transport_sockets/alts/tsi_frame_protector_test.cc +++ b/test/extensions/transport_sockets/alts/tsi_frame_protector_test.cc @@ -2,8 +2,9 @@ #include "extensions/transport_sockets/alts/tsi_frame_protector.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "src/core/tsi/fake_transport_security.h" namespace Envoy { @@ -22,7 +23,7 @@ using namespace std::string_literals; * Test with fake frame protector. The protected frame header is 4 byte length (little endian, * include header itself) and following the body. */ -class TsiFrameProtectorTest : public testing::Test { +class TsiFrameProtectorTest : public TestBase { public: TsiFrameProtectorTest() : raw_frame_protector_(tsi_create_fake_frame_protector(nullptr)), diff --git a/test/extensions/transport_sockets/alts/tsi_handshaker_test.cc b/test/extensions/transport_sockets/alts/tsi_handshaker_test.cc index 75ff19c0f32e..a07ce881bed1 100644 --- a/test/extensions/transport_sockets/alts/tsi_handshaker_test.cc +++ b/test/extensions/transport_sockets/alts/tsi_handshaker_test.cc @@ -1,9 +1,9 @@ #include "extensions/transport_sockets/alts/tsi_handshaker.h" #include "test/mocks/event/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "src/core/tsi/fake_transport_security.h" namespace Envoy { @@ -32,7 +32,7 @@ class MockTsiHandshakerCallbacks : public TsiHandshakerCallbacks { } }; -class TsiHandshakerTest : public testing::Test { +class TsiHandshakerTest : public TestBase { public: TsiHandshakerTest() : server_handshaker_({tsi_create_fake_handshaker(0)}, dispatcher_), diff --git a/test/extensions/transport_sockets/alts/tsi_socket_test.cc b/test/extensions/transport_sockets/alts/tsi_socket_test.cc index f3e42b231f95..032207fd8a12 100644 --- a/test/extensions/transport_sockets/alts/tsi_socket_test.cc +++ b/test/extensions/transport_sockets/alts/tsi_socket_test.cc @@ -3,9 +3,9 @@ #include "extensions/transport_sockets/alts/tsi_socket.h" #include "test/mocks/network/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "src/core/tsi/fake_transport_security.h" namespace Envoy { @@ -18,7 +18,7 @@ using testing::Return; using testing::ReturnRef; using testing::StrictMock; -class TsiSocketTest : public testing::Test { +class TsiSocketTest : public TestBase { protected: TsiSocketTest() { server_.handshaker_factory_ = [](Event::Dispatcher& dispatcher, @@ -382,7 +382,7 @@ TEST_F(TsiSocketTest, HandshakeWithInternalError) { raw_handshaker->vtable = vtable; } -class TsiSocketFactoryTest : public testing::Test { +class TsiSocketFactoryTest : public TestBase { protected: void SetUp() override { auto handshaker_factory = [](Event::Dispatcher& dispatcher, diff --git a/test/extensions/transport_sockets/tls/context_impl_test.cc b/test/extensions/transport_sockets/tls/context_impl_test.cc index 274f4d0a9add..bfa059bb2a29 100644 --- a/test/extensions/transport_sockets/tls/context_impl_test.cc +++ b/test/extensions/transport_sockets/tls/context_impl_test.cc @@ -19,9 +19,9 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" #include "openssl/x509v3.h" using Envoy::Protobuf::util::MessageDifferencer; diff --git a/test/extensions/transport_sockets/tls/ssl_certs_test.h b/test/extensions/transport_sockets/tls/ssl_certs_test.h index 94b6dc206c39..339716fe9223 100644 --- a/test/extensions/transport_sockets/tls/ssl_certs_test.h +++ b/test/extensions/transport_sockets/tls/ssl_certs_test.h @@ -2,13 +2,12 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::ReturnRef; namespace Envoy { -class SslCertsTest : public testing::Test { +class SslCertsTest : public TestBase { public: static void SetUpTestSuite() { TestEnvironment::exec({TestEnvironment::runfilesPath( diff --git a/test/extensions/transport_sockets/tls/ssl_socket_test.cc b/test/extensions/transport_sockets/tls/ssl_socket_test.cc index 0e1d6152df0d..10d4d6e064d4 100644 --- a/test/extensions/transport_sockets/tls/ssl_socket_test.cc +++ b/test/extensions/transport_sockets/tls/ssl_socket_test.cc @@ -33,11 +33,11 @@ #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/strings/str_replace.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "openssl/ssl.h" using testing::_; diff --git a/test/extensions/transport_sockets/tls/ssl_test_utility.h b/test/extensions/transport_sockets/tls/ssl_test_utility.h index 7fa071c800bf..7d41cbbdcd69 100644 --- a/test/extensions/transport_sockets/tls/ssl_test_utility.h +++ b/test/extensions/transport_sockets/tls/ssl_test_utility.h @@ -4,8 +4,8 @@ #include #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" -#include "gtest/gtest.h" #include "openssl/ssl.h" #include "openssl/x509v3.h" diff --git a/test/extensions/transport_sockets/tls/utility_test.cc b/test/extensions/transport_sockets/tls/utility_test.cc index 494170a21ba0..385ad365f2b6 100644 --- a/test/extensions/transport_sockets/tls/utility_test.cc +++ b/test/extensions/transport_sockets/tls/utility_test.cc @@ -7,10 +7,10 @@ #include "test/extensions/transport_sockets/tls/test_data/san_dns_cert_info.h" #include "test/test_common/environment.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/time/time.h" -#include "gtest/gtest.h" #include "openssl/x509v3.h" namespace Envoy { diff --git a/test/fuzz/main.cc b/test/fuzz/main.cc index 61d53dd7b22e..023a5078cc1c 100644 --- a/test/fuzz/main.cc +++ b/test/fuzz/main.cc @@ -18,17 +18,16 @@ #include "test/fuzz/fuzz_runner.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace { // List of paths for files in the test corpus. std::vector test_corpus_; -class FuzzerCorpusTest : public ::testing::TestWithParam { +class FuzzerCorpusTest : public TestBaseWithParam { protected: FuzzerCorpusTest() : api_(Api::createApiForTest(stats_store_)) {} diff --git a/test/integration/ads_integration_test.cc b/test/integration/ads_integration_test.cc index 9455793f8eb0..e2f7294b9ee3 100644 --- a/test/integration/ads_integration_test.cc +++ b/test/integration/ads_integration_test.cc @@ -20,10 +20,9 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/network_utility.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::AssertionFailure; using testing::AssertionResult; using testing::AssertionSuccess; diff --git a/test/integration/cds_integration_test.cc b/test/integration/cds_integration_test.cc index 455d58a46ddf..9958c2d58c9c 100644 --- a/test/integration/cds_integration_test.cc +++ b/test/integration/cds_integration_test.cc @@ -14,10 +14,10 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/network_utility.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/synchronization/notification.h" -#include "gtest/gtest.h" using testing::AssertionFailure; using testing::AssertionResult; diff --git a/test/integration/echo_integration_test.cc b/test/integration/echo_integration_test.cc index 55dae2942a08..da64a3127077 100644 --- a/test/integration/echo_integration_test.cc +++ b/test/integration/echo_integration_test.cc @@ -8,7 +8,7 @@ namespace Envoy { std::string echo_config; class EchoIntegrationTest : public BaseIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: EchoIntegrationTest() : BaseIntegrationTest(GetParam(), realTime(), echo_config) {} diff --git a/test/integration/eds_integration_test.cc b/test/integration/eds_integration_test.cc index ebfacb27906d..7412163d7661 100644 --- a/test/integration/eds_integration_test.cc +++ b/test/integration/eds_integration_test.cc @@ -5,8 +5,7 @@ #include "test/config/utility.h" #include "test/integration/http_integration.h" #include "test/test_common/network_utility.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace { @@ -14,7 +13,7 @@ namespace { // Integration test for EDS features. EDS is consumed via filesystem // subscription. class EdsIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: EdsIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) {} diff --git a/test/integration/hds_integration_test.cc b/test/integration/hds_integration_test.cc index bd3d6de7607a..8b0e9468c1ca 100644 --- a/test/integration/hds_integration_test.cc +++ b/test/integration/hds_integration_test.cc @@ -16,15 +16,15 @@ #include "test/config/utility.h" #include "test/integration/http_integration.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace { class HdsIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: HdsIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) {} diff --git a/test/integration/header_integration_test.cc b/test/integration/header_integration_test.cc index bc665df7c72a..40c0672504c8 100644 --- a/test/integration/header_integration_test.cc +++ b/test/integration/header_integration_test.cc @@ -8,19 +8,18 @@ #include "test/integration/http_integration.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace { std::string ipSuppressEnvoyHeadersTestParamsToString( - const testing::TestParamInfo>& params) { + const ::testing::TestParamInfo>& params) { return fmt::format( "{}_{}", TestUtility::ipTestParamsToString( - testing::TestParamInfo(std::get<0>(params.param), 0)), + ::testing::TestParamInfo(std::get<0>(params.param), 0)), std::get<1>(params.param) ? "with_x_envoy_from_router" : "without_x_envoy_from_router"); } @@ -151,7 +150,7 @@ stat_prefix: header_test class HeaderIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam> { + public TestBaseWithParam> { public: HeaderIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, std::get<0>(GetParam()), realTime()) {} diff --git a/test/integration/http2_integration_test.cc b/test/integration/http2_integration_test.cc index 3665698d89da..cdcd637b5550 100644 --- a/test/integration/http2_integration_test.cc +++ b/test/integration/http2_integration_test.cc @@ -9,10 +9,9 @@ #include "test/mocks/http/mocks.h" #include "test/test_common/network_utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using ::testing::HasSubstr; using ::testing::MatchesRegex; diff --git a/test/integration/http2_integration_test.h b/test/integration/http2_integration_test.h index 9319cc27fd98..c63d60ba0dfe 100644 --- a/test/integration/http2_integration_test.h +++ b/test/integration/http2_integration_test.h @@ -1,12 +1,11 @@ #pragma once #include "test/integration/http_integration.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { class Http2IntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: Http2IntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP2, GetParam(), realTime()) {} diff --git a/test/integration/http2_upstream_integration_test.cc b/test/integration/http2_upstream_integration_test.cc index 0e0ba792cb48..155dd9f0386a 100644 --- a/test/integration/http2_upstream_integration_test.cc +++ b/test/integration/http2_upstream_integration_test.cc @@ -6,10 +6,9 @@ #include "test/integration/autonomous_upstream.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { INSTANTIATE_TEST_SUITE_P(IpVersions, Http2UpstreamIntegrationTest, diff --git a/test/integration/http2_upstream_integration_test.h b/test/integration/http2_upstream_integration_test.h index 4a7779580bc2..0bcb228acbd7 100644 --- a/test/integration/http2_upstream_integration_test.h +++ b/test/integration/http2_upstream_integration_test.h @@ -1,12 +1,11 @@ #pragma once #include "test/integration/http_integration.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { class Http2UpstreamIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: Http2UpstreamIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP2, GetParam(), realTime()) {} diff --git a/test/integration/http_integration.cc b/test/integration/http_integration.cc index 0cee15a59494..2815e2e59d21 100644 --- a/test/integration/http_integration.cc +++ b/test/integration/http_integration.cc @@ -30,8 +30,7 @@ #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" #include "test/test_common/registry.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::_; using testing::AnyNumber; diff --git a/test/integration/http_protocol_integration.h b/test/integration/http_protocol_integration.h index 4f587c7e839b..36d47b7a038e 100644 --- a/test/integration/http_protocol_integration.h +++ b/test/integration/http_protocol_integration.h @@ -1,8 +1,7 @@ #pragma once #include "test/integration/http_integration.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { @@ -27,7 +26,7 @@ struct HttpProtocolTestParams { // .... // } class HttpProtocolIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: // By default returns 8 combinations of // [HTTP upstream / HTTP downstream] x [Ipv4, IPv6] @@ -46,7 +45,7 @@ class HttpProtocolIntegrationTest : public HttpIntegrationTest, // Allows pretty printed test names of the form // FooTestCase.BarInstance/IPv4_Http2Downstream_HttpUpstream static std::string - protocolTestParamsToString(const testing::TestParamInfo& p); + protocolTestParamsToString(const ::testing::TestParamInfo& p); HttpProtocolIntegrationTest() : HttpIntegrationTest(GetParam().downstream_protocol, GetParam().version, realTime()) {} diff --git a/test/integration/integration.cc b/test/integration/integration.cc index 84859fd73a45..ac57ca81079d 100644 --- a/test/integration/integration.cc +++ b/test/integration/integration.cc @@ -30,8 +30,7 @@ #include "test/integration/utility.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::_; using testing::AnyNumber; diff --git a/test/integration/integration_admin_test.cc b/test/integration/integration_admin_test.cc index 3e940e82a7c6..0dcdf795a00c 100644 --- a/test/integration/integration_admin_test.cc +++ b/test/integration/integration_admin_test.cc @@ -9,9 +9,9 @@ #include "common/stats/stats_matcher_impl.h" #include "test/integration/utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" #include "spdlog/spdlog.h" namespace Envoy { @@ -416,7 +416,7 @@ TEST_P(IntegrationAdminTest, AdminCpuProfilerStart) { EXPECT_STREQ("200", response->headers().Status()->value().c_str()); } -class IntegrationAdminIpv4Ipv6Test : public HttpIntegrationTest, public testing::Test { +class IntegrationAdminIpv4Ipv6Test : public HttpIntegrationTest, public TestBase { public: IntegrationAdminIpv4Ipv6Test() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, Network::Address::IpVersion::v4, @@ -451,7 +451,7 @@ TEST_F(IntegrationAdminIpv4Ipv6Test, Ipv4Ipv6Listen) { // restrictions on their names. class StatsMatcherIntegrationTest : public HttpIntegrationTest, - public testing::Test, + public TestBase, public testing::WithParamInterface { public: StatsMatcherIntegrationTest() diff --git a/test/integration/integration_admin_test.h b/test/integration/integration_admin_test.h index 0bc34fbe72d4..d8d21a9ce129 100644 --- a/test/integration/integration_admin_test.h +++ b/test/integration/integration_admin_test.h @@ -3,8 +3,7 @@ #include "common/json/json_loader.h" #include "test/integration/http_protocol_integration.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { diff --git a/test/integration/integration_test.cc b/test/integration/integration_test.cc index b1c2c984fc47..6efef370306f 100644 --- a/test/integration/integration_test.cc +++ b/test/integration/integration_test.cc @@ -12,10 +12,9 @@ #include "test/mocks/http/mocks.h" #include "test/test_common/network_utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using Envoy::Http::Headers; using Envoy::Http::HeaderValueOf; using Envoy::Http::HttpStatusIs; diff --git a/test/integration/integration_test.h b/test/integration/integration_test.h index 96f17288e171..13352ca960e7 100644 --- a/test/integration/integration_test.h +++ b/test/integration/integration_test.h @@ -1,12 +1,11 @@ #pragma once #include "test/integration/http_integration.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { class IntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: IntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) {} }; diff --git a/test/integration/load_stats_integration_test.cc b/test/integration/load_stats_integration_test.cc index fe0bcceeab9e..aeef4cc7ee8a 100644 --- a/test/integration/load_stats_integration_test.cc +++ b/test/integration/load_stats_integration_test.cc @@ -8,15 +8,14 @@ #include "test/config/utility.h" #include "test/integration/http_integration.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace { class LoadStatsIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: LoadStatsIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) { diff --git a/test/integration/proxy_proto_integration_test.cc b/test/integration/proxy_proto_integration_test.cc index 691abd149b13..d5fe3a79e6c7 100644 --- a/test/integration/proxy_proto_integration_test.cc +++ b/test/integration/proxy_proto_integration_test.cc @@ -4,10 +4,10 @@ #include "test/test_common/network_utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "fmt/format.h" -#include "gtest/gtest.h" namespace Envoy { diff --git a/test/integration/proxy_proto_integration_test.h b/test/integration/proxy_proto_integration_test.h index d12badf470ad..5f663e6b9f51 100644 --- a/test/integration/proxy_proto_integration_test.h +++ b/test/integration/proxy_proto_integration_test.h @@ -5,12 +5,11 @@ #include "test/integration/fake_upstream.h" #include "test/integration/http_integration.h" #include "test/integration/server.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { class ProxyProtoIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: ProxyProtoIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) { diff --git a/test/integration/ratelimit_integration_test.cc b/test/integration/ratelimit_integration_test.cc index ed855fe5a402..ae0bc73b5fca 100644 --- a/test/integration/ratelimit_integration_test.cc +++ b/test/integration/ratelimit_integration_test.cc @@ -8,8 +8,7 @@ #include "test/common/grpc/grpc_client_integration.h" #include "test/integration/http_integration.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace { diff --git a/test/integration/sds_dynamic_integration_test.cc b/test/integration/sds_dynamic_integration_test.cc index 2c2ffe5135e4..e1d026a10def 100644 --- a/test/integration/sds_dynamic_integration_test.cc +++ b/test/integration/sds_dynamic_integration_test.cc @@ -20,12 +20,12 @@ #include "test/mocks/secret/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time_system.h" #include "test/test_common/utility.h" #include "absl/strings/match.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "integration.h" #include "utility.h" diff --git a/test/integration/sds_static_integration_test.cc b/test/integration/sds_static_integration_test.cc index 462094696737..9fa494a7992e 100644 --- a/test/integration/sds_static_integration_test.cc +++ b/test/integration/sds_static_integration_test.cc @@ -18,12 +18,12 @@ #include "test/mocks/secret/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time_system.h" #include "test/test_common/utility.h" #include "absl/strings/match.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "integration.h" #include "utility.h" @@ -33,9 +33,8 @@ using testing::Return; namespace Envoy { namespace Ssl { -class SdsStaticDownstreamIntegrationTest - : public HttpIntegrationTest, - public testing::TestWithParam { +class SdsStaticDownstreamIntegrationTest : public HttpIntegrationTest, + public TestBaseWithParam { public: SdsStaticDownstreamIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) {} @@ -106,9 +105,8 @@ TEST_P(SdsStaticDownstreamIntegrationTest, RouterRequestAndResponseWithGiantBody testRouterRequestAndResponseWithBody(16 * 1024 * 1024, 16 * 1024 * 1024, false, &creator); } -class SdsStaticUpstreamIntegrationTest - : public HttpIntegrationTest, - public testing::TestWithParam { +class SdsStaticUpstreamIntegrationTest : public HttpIntegrationTest, + public TestBaseWithParam { public: SdsStaticUpstreamIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), realTime()) {} diff --git a/test/integration/server.cc b/test/integration/server.cc index 251438fb242d..4fa5551d9fa0 100644 --- a/test/integration/server.cc +++ b/test/integration/server.cc @@ -19,9 +19,9 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "absl/strings/str_replace.h" -#include "gtest/gtest.h" namespace Envoy { namespace Server { diff --git a/test/integration/ssl_integration_test.cc b/test/integration/ssl_integration_test.cc index 97083b02b7da..99d13f7b62a2 100644 --- a/test/integration/ssl_integration_test.cc +++ b/test/integration/ssl_integration_test.cc @@ -14,11 +14,11 @@ #include "extensions/transport_sockets/tls/context_manager_impl.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/strings/match.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "integration.h" #include "utility.h" @@ -176,8 +176,8 @@ TEST_P(SslIntegrationTest, AdminCertEndpoint) { // Validate certificate selection across different certificate types and client TLS versions. class SslCertficateIntegrationTest : public SslIntegrationTestBase, - public testing::TestWithParam> { + public TestBaseWithParam> { public: SslCertficateIntegrationTest() : SslIntegrationTestBase(std::get<0>(GetParam())) { server_tlsv1_3_ = true; @@ -210,7 +210,7 @@ class SslCertficateIntegrationTest } static std::string ipClientVersionTestParamsToString( - const testing::TestParamInfo< + const ::testing::TestParamInfo< std::tuple>& params) { return fmt::format("{}_TLSv1_{}", diff --git a/test/integration/ssl_integration_test.h b/test/integration/ssl_integration_test.h index 4acbb234f747..f28a9343803b 100644 --- a/test/integration/ssl_integration_test.h +++ b/test/integration/ssl_integration_test.h @@ -7,9 +7,9 @@ #include "test/integration/server.h" #include "test/integration/ssl_utility.h" #include "test/mocks/secret/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; @@ -44,7 +44,7 @@ class SslIntegrationTestBase : public HttpIntegrationTest { }; class SslIntegrationTest : public SslIntegrationTestBase, - public testing::TestWithParam { + public TestBaseWithParam { public: SslIntegrationTest() : SslIntegrationTestBase(GetParam()) {} void TearDown() override { SslIntegrationTestBase::TearDown(); }; diff --git a/test/integration/ssl_utility.cc b/test/integration/ssl_utility.cc index 59c036109ead..4254a7c27314 100644 --- a/test/integration/ssl_utility.cc +++ b/test/integration/ssl_utility.cc @@ -12,8 +12,7 @@ #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::ReturnRef; diff --git a/test/integration/stats_integration_test.cc b/test/integration/stats_integration_test.cc index a90fa5115d72..4d36b4d8c5a7 100644 --- a/test/integration/stats_integration_test.cc +++ b/test/integration/stats_integration_test.cc @@ -5,15 +5,14 @@ #include "test/integration/integration.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace { class StatsIntegrationTest : public BaseIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: StatsIntegrationTest() : BaseIntegrationTest(GetParam(), realTime()) {} diff --git a/test/integration/tcp_conn_pool_integration_test.cc b/test/integration/tcp_conn_pool_integration_test.cc index 1335ebc1d5d7..5ca30b0e8ed7 100644 --- a/test/integration/tcp_conn_pool_integration_test.cc +++ b/test/integration/tcp_conn_pool_integration_test.cc @@ -112,7 +112,7 @@ class TestFilterConfigFactory : public Server::Configuration::NamedNetworkFilter } // namespace class TcpConnPoolIntegrationTest : public BaseIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: TcpConnPoolIntegrationTest() : BaseIntegrationTest(GetParam(), realTime(), tcp_conn_pool_config), diff --git a/test/integration/tcp_proxy_integration_test.cc b/test/integration/tcp_proxy_integration_test.cc index 2d9862983762..d2de9a7d1282 100644 --- a/test/integration/tcp_proxy_integration_test.cc +++ b/test/integration/tcp_proxy_integration_test.cc @@ -11,8 +11,7 @@ #include "test/integration/ssl_utility.h" #include "test/integration/utility.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::_; using testing::Invoke; diff --git a/test/integration/tcp_proxy_integration_test.h b/test/integration/tcp_proxy_integration_test.h index 5e7fb5c29b36..af0156821e87 100644 --- a/test/integration/tcp_proxy_integration_test.h +++ b/test/integration/tcp_proxy_integration_test.h @@ -5,13 +5,12 @@ #include "test/integration/integration.h" #include "test/mocks/secret/mocks.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace { class TcpProxyIntegrationTest : public BaseIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: TcpProxyIntegrationTest() : BaseIntegrationTest(GetParam(), realTime(), ConfigHelper::TCP_PROXY_CONFIG) { diff --git a/test/integration/uds_integration_test.cc b/test/integration/uds_integration_test.cc index 8c93f738ea05..f4d70a81e07b 100644 --- a/test/integration/uds_integration_test.cc +++ b/test/integration/uds_integration_test.cc @@ -4,8 +4,7 @@ #include "common/network/utility.h" #include "test/test_common/network_utility.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { diff --git a/test/integration/uds_integration_test.h b/test/integration/uds_integration_test.h index 85891bd18d98..7cb73485c220 100644 --- a/test/integration/uds_integration_test.h +++ b/test/integration/uds_integration_test.h @@ -9,14 +9,13 @@ #include "test/integration/http_integration.h" #include "test/integration/server.h" #include "test/test_common/environment.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { class UdsUpstreamIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam> { + public TestBaseWithParam> { public: UdsUpstreamIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, std::get<0>(GetParam()), realTime()), @@ -47,7 +46,7 @@ class UdsUpstreamIntegrationTest class UdsListenerIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam> { + public TestBaseWithParam> { public: UdsListenerIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, std::get<0>(GetParam()), realTime()), diff --git a/test/integration/websocket_integration_test.cc b/test/integration/websocket_integration_test.cc index 92d1f696403e..0473e41a6573 100644 --- a/test/integration/websocket_integration_test.cc +++ b/test/integration/websocket_integration_test.cc @@ -10,10 +10,10 @@ #include "test/integration/utility.h" #include "test/test_common/network_utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/strings/str_cat.h" -#include "gtest/gtest.h" using testing::MatchesRegex; diff --git a/test/integration/websocket_integration_test.h b/test/integration/websocket_integration_test.h index 69f88ccb1f1b..398d478d9c2d 100644 --- a/test/integration/websocket_integration_test.h +++ b/test/integration/websocket_integration_test.h @@ -1,8 +1,7 @@ #pragma once #include "test/integration/http_protocol_integration.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { diff --git a/test/integration/xds_integration_test.cc b/test/integration/xds_integration_test.cc index 68bde1631235..ebe86cb9332c 100644 --- a/test/integration/xds_integration_test.cc +++ b/test/integration/xds_integration_test.cc @@ -1,14 +1,13 @@ #include "test/integration/http_integration.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace { // This is a minimal litmus test for the v2 xDS APIs. class XdsIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: XdsIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP2, GetParam(), realTime()) { diff --git a/test/integration/xfcc_integration_test.cc b/test/integration/xfcc_integration_test.cc index b31660b46e84..2d98a774389b 100644 --- a/test/integration/xfcc_integration_test.cc +++ b/test/integration/xfcc_integration_test.cc @@ -17,10 +17,10 @@ #include "test/test_common/network_utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "integration.h" #include "ssl_integration_test.h" #include "utility.h" diff --git a/test/integration/xfcc_integration_test.h b/test/integration/xfcc_integration_test.h index 055b76132b07..780e36f6ebbf 100644 --- a/test/integration/xfcc_integration_test.h +++ b/test/integration/xfcc_integration_test.h @@ -7,11 +7,11 @@ #include "test/integration/http_integration.h" #include "test/integration/server.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "absl/strings/ascii.h" #include "absl/strings/str_replace.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; using testing::ReturnRef; @@ -20,7 +20,7 @@ namespace Envoy { namespace Xfcc { class XfccIntegrationTest : public HttpIntegrationTest, - public testing::TestWithParam { + public TestBaseWithParam { public: const std::string previous_xfcc_ = "By=spiffe://lyft.com/frontend;Hash=123456;URI=spiffe://lyft.com/testclient"; diff --git a/test/mocks/access_log/mocks.cc b/test/mocks/access_log/mocks.cc index 6f7edb0232aa..d1e10758c3fb 100644 --- a/test/mocks/access_log/mocks.cc +++ b/test/mocks/access_log/mocks.cc @@ -1,7 +1,8 @@ #include "test/mocks/access_log/mocks.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Return; diff --git a/test/mocks/api/mocks.cc b/test/mocks/api/mocks.cc index a805a623d7c3..4aab4c9c1759 100644 --- a/test/mocks/api/mocks.cc +++ b/test/mocks/api/mocks.cc @@ -3,8 +3,9 @@ #include "common/common/assert.h" #include "common/common/lock_guard.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Return; diff --git a/test/mocks/common.h b/test/mocks/common.h index 5908a0f9a804..41bf7fe903cd 100644 --- a/test/mocks/common.h +++ b/test/mocks/common.h @@ -8,6 +8,7 @@ #include "common/common/logger.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "absl/strings/string_view.h" diff --git a/test/mocks/event/mocks.cc b/test/mocks/event/mocks.cc index 59d724f85e4d..13c929af64d5 100644 --- a/test/mocks/event/mocks.cc +++ b/test/mocks/event/mocks.cc @@ -1,7 +1,8 @@ #include "mocks.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/mocks/http/mocks.cc b/test/mocks/http/mocks.cc index 2e071d5a11c0..77c29ff6ffe3 100644 --- a/test/mocks/http/mocks.cc +++ b/test/mocks/http/mocks.cc @@ -3,8 +3,9 @@ #include "envoy/buffer/buffer.h" #include "envoy/event/dispatcher.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/mocks/init/mocks.cc b/test/mocks/init/mocks.cc index ce0cb291ebca..6eeac3f5e2c7 100644 --- a/test/mocks/init/mocks.cc +++ b/test/mocks/init/mocks.cc @@ -2,8 +2,9 @@ #include +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/mocks/local_info/mocks.cc b/test/mocks/local_info/mocks.cc index c5addcc3912c..26329ccf1dad 100644 --- a/test/mocks/local_info/mocks.cc +++ b/test/mocks/local_info/mocks.cc @@ -2,8 +2,9 @@ #include "common/network/address_impl.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::Invoke; using testing::Return; diff --git a/test/mocks/network/mocks.cc b/test/mocks/network/mocks.cc index 538c5c36cd31..268053547040 100644 --- a/test/mocks/network/mocks.cc +++ b/test/mocks/network/mocks.cc @@ -10,9 +10,9 @@ #include "common/network/utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/mocks/router/mocks.cc b/test/mocks/router/mocks.cc index 17b94a4b97f2..278a4084a433 100644 --- a/test/mocks/router/mocks.cc +++ b/test/mocks/router/mocks.cc @@ -2,8 +2,9 @@ #include +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::NiceMock; diff --git a/test/mocks/runtime/mocks.cc b/test/mocks/runtime/mocks.cc index acc39e811d86..c9e9793dcbb4 100644 --- a/test/mocks/runtime/mocks.cc +++ b/test/mocks/runtime/mocks.cc @@ -1,7 +1,8 @@ #include "mocks.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Return; diff --git a/test/mocks/secret/mocks.h b/test/mocks/secret/mocks.h index 428f1ec28faa..b69fa6897a52 100644 --- a/test/mocks/secret/mocks.h +++ b/test/mocks/secret/mocks.h @@ -5,8 +5,9 @@ #include "envoy/server/transport_socket_config.h" #include "envoy/ssl/tls_certificate_config.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { namespace Secret { diff --git a/test/mocks/server/mocks.cc b/test/mocks/server/mocks.cc index b0523c36fa53..c0ab9e59f422 100644 --- a/test/mocks/server/mocks.cc +++ b/test/mocks/server/mocks.cc @@ -4,8 +4,9 @@ #include "common/singleton/manager_impl.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/mocks/server/mocks.h b/test/mocks/server/mocks.h index 0e8dfde93f5c..74d48128444e 100644 --- a/test/mocks/server/mocks.h +++ b/test/mocks/server/mocks.h @@ -39,11 +39,11 @@ #include "test/mocks/thread_local/mocks.h" #include "test/mocks/tracing/mocks.h" #include "test/mocks/upstream/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time_system.h" #include "absl/strings/string_view.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "spdlog/spdlog.h" namespace Envoy { diff --git a/test/mocks/stats/mocks.cc b/test/mocks/stats/mocks.cc index 5b1dbf98df98..860ccee04e0b 100644 --- a/test/mocks/stats/mocks.cc +++ b/test/mocks/stats/mocks.cc @@ -1,7 +1,8 @@ #include "mocks.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/mocks/stream_info/mocks.cc b/test/mocks/stream_info/mocks.cc index 7a17c006bd2a..ac27d97443a9 100644 --- a/test/mocks/stream_info/mocks.cc +++ b/test/mocks/stream_info/mocks.cc @@ -2,8 +2,9 @@ #include "common/network/address_impl.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Const; diff --git a/test/mocks/thread_local/mocks.cc b/test/mocks/thread_local/mocks.cc index cfabd7a7f52f..713855d3ce30 100644 --- a/test/mocks/thread_local/mocks.cc +++ b/test/mocks/thread_local/mocks.cc @@ -1,7 +1,8 @@ #include "mocks.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/mocks/tracing/mocks.cc b/test/mocks/tracing/mocks.cc index f35c98b38356..ee157fc212bd 100644 --- a/test/mocks/tracing/mocks.cc +++ b/test/mocks/tracing/mocks.cc @@ -1,7 +1,8 @@ #include "mocks.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::Return; using testing::ReturnRef; diff --git a/test/mocks/upstream/cluster_info.h b/test/mocks/upstream/cluster_info.h index 0aa4f3627e71..df09688a5bc7 100644 --- a/test/mocks/upstream/cluster_info.h +++ b/test/mocks/upstream/cluster_info.h @@ -14,9 +14,9 @@ #include "test/mocks/runtime/mocks.h" #include "test/mocks/stats/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; diff --git a/test/mocks/upstream/mocks.cc b/test/mocks/upstream/mocks.cc index 0e32283276a0..cf84f12047da 100644 --- a/test/mocks/upstream/mocks.cc +++ b/test/mocks/upstream/mocks.cc @@ -5,8 +5,9 @@ #include "envoy/upstream/load_balancer.h" +#include "test/test_common/test_base.h" + #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; diff --git a/test/mocks/upstream/mocks.h b/test/mocks/upstream/mocks.h index 0800d58f5629..ed0546f1b482 100644 --- a/test/mocks/upstream/mocks.h +++ b/test/mocks/upstream/mocks.h @@ -25,9 +25,9 @@ #include "test/mocks/tcp/mocks.h" #include "test/mocks/upstream/cluster_info.h" #include "test/mocks/upstream/load_balancer_context.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::NiceMock; diff --git a/test/server/backtrace_test.cc b/test/server/backtrace_test.cc index cfcc2cc2c81e..894ec568bfc1 100644 --- a/test/server/backtrace_test.cc +++ b/test/server/backtrace_test.cc @@ -1,6 +1,6 @@ #include "server/backtrace.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { TEST(Backward, Basic) { diff --git a/test/server/config_validation/dispatcher_test.cc b/test/server/config_validation/dispatcher_test.cc index d30db3ad8ba3..7f7342380e72 100644 --- a/test/server/config_validation/dispatcher_test.cc +++ b/test/server/config_validation/dispatcher_test.cc @@ -19,7 +19,7 @@ namespace Envoy { // Define fixture which allocates ValidationDispatcher. -class ConfigValidation : public ::testing::TestWithParam { +class ConfigValidation : public TestBaseWithParam { public: ConfigValidation() { Event::Libevent::Global::initialize(); diff --git a/test/server/config_validation/server_test.cc b/test/server/config_validation/server_test.cc index 209965351023..0479b9d2cc10 100644 --- a/test/server/config_validation/server_test.cc +++ b/test/server/config_validation/server_test.cc @@ -11,7 +11,7 @@ namespace Envoy { namespace Server { // Test param is the path to the config file to validate. -class ValidationServerTest : public testing::TestWithParam { +class ValidationServerTest : public TestBaseWithParam { public: static void SetupTestDirectory() { TestEnvironment::exec( diff --git a/test/server/configuration_impl_test.cc b/test/server/configuration_impl_test.cc index 032fe30c4709..2b6b6217bee9 100644 --- a/test/server/configuration_impl_test.cc +++ b/test/server/configuration_impl_test.cc @@ -16,11 +16,11 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "fmt/printf.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::InSequence; using testing::Return; @@ -50,7 +50,7 @@ TEST(FilterChainUtility, buildFilterChainFailWithBadFilters) { EXPECT_EQ(FilterChainUtility::buildFilterChain(connection, factories), false); } -class ConfigurationImplTest : public testing::Test { +class ConfigurationImplTest : public TestBase { protected: ConfigurationImplTest() : api_(Api::createApiForTest(stats_store_)), diff --git a/test/server/connection_handler_test.cc b/test/server/connection_handler_test.cc index c22078eee68b..4ebe8816cb43 100644 --- a/test/server/connection_handler_test.cc +++ b/test/server/connection_handler_test.cc @@ -10,9 +10,9 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/network_utility.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::ByRef; @@ -25,7 +25,7 @@ using testing::ReturnRef; namespace Envoy { namespace Server { -class ConnectionHandlerTest : public testing::Test, protected Logger::Loggable { +class ConnectionHandlerTest : public TestBase, protected Logger::Loggable { public: ConnectionHandlerTest() : handler_(new ConnectionHandlerImpl(ENVOY_LOGGER(), dispatcher_)), diff --git a/test/server/drain_manager_impl_test.cc b/test/server/drain_manager_impl_test.cc index 29ba7fd65991..b74f26bda343 100644 --- a/test/server/drain_manager_impl_test.cc +++ b/test/server/drain_manager_impl_test.cc @@ -3,9 +3,9 @@ #include "server/drain_manager_impl.h" #include "test/mocks/server/mocks.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -15,7 +15,7 @@ using testing::SaveArg; namespace Envoy { namespace Server { -class DrainManagerImplTest : public testing::Test { +class DrainManagerImplTest : public TestBase { public: DrainManagerImplTest() { ON_CALL(server_.options_, drainTime()).WillByDefault(Return(std::chrono::seconds(600))); diff --git a/test/server/guarddog_impl_test.cc b/test/server/guarddog_impl_test.cc index 4b27653cc780..b2bd21eef329 100644 --- a/test/server/guarddog_impl_test.cc +++ b/test/server/guarddog_impl_test.cc @@ -13,10 +13,10 @@ #include "test/mocks/server/mocks.h" #include "test/mocks/stats/mocks.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::InSequence; using testing::NiceMock; @@ -24,7 +24,7 @@ using testing::NiceMock; namespace Envoy { namespace Server { -class GuardDogTestBase : public testing::Test { +class GuardDogTestBase : public TestBase { protected: GuardDogTestBase() : api_(Api::createApiForTest(stats_store_)) {} diff --git a/test/server/hot_restart_impl_test.cc b/test/server/hot_restart_impl_test.cc index a22392b56ad5..7bb5ed4e7f4a 100644 --- a/test/server/hot_restart_impl_test.cc +++ b/test/server/hot_restart_impl_test.cc @@ -8,11 +8,11 @@ #include "test/mocks/api/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/logging.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" #include "absl/strings/match.h" #include "absl/strings/string_view.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -24,7 +24,7 @@ using testing::WithArg; namespace Envoy { namespace Server { -class HotRestartImplTest : public testing::Test { +class HotRestartImplTest : public TestBase { public: void setup() { EXPECT_CALL(os_sys_calls_, shmUnlink(_)); diff --git a/test/server/http/admin_test.cc b/test/server/http/admin_test.cc index a13a93629c4a..1ac6f062b462 100644 --- a/test/server/http/admin_test.cc +++ b/test/server/http/admin_test.cc @@ -26,11 +26,11 @@ #include "test/test_common/logging.h" #include "test/test_common/network_utility.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "absl/strings/match.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AllOf; @@ -48,7 +48,7 @@ using testing::ReturnRef; namespace Envoy { namespace Server { -class AdminStatsTest : public testing::TestWithParam { +class AdminStatsTest : public TestBaseWithParam { public: AdminStatsTest() : alloc_(options_) { store_ = std::make_unique(options_, alloc_); @@ -71,7 +71,7 @@ class AdminStatsTest : public testing::TestWithParam store_; }; -class AdminFilterTest : public testing::TestWithParam { +class AdminFilterTest : public TestBaseWithParam { public: AdminFilterTest() : admin_(TestEnvironment::temporaryPath("envoy.prof"), server_), @@ -588,7 +588,7 @@ TEST_P(AdminFilterTest, Trailers) { EXPECT_EQ(Http::FilterTrailersStatus::StopIteration, filter_.decodeTrailers(request_headers_)); } -class AdminInstanceTest : public testing::TestWithParam { +class AdminInstanceTest : public TestBaseWithParam { public: AdminInstanceTest() : address_out_path_(TestEnvironment::temporaryPath("admin.address")), @@ -1219,7 +1219,7 @@ class HistogramWrapper { histogram_t* histogram_; }; -class PrometheusStatsFormatterTest : public testing::Test { +class PrometheusStatsFormatterTest : public TestBase { protected: PrometheusStatsFormatterTest() /*: alloc_(stats_options_)*/ {} void addCounter(const std::string& name, std::vector cluster_tags) { diff --git a/test/server/http/config_tracker_impl_test.cc b/test/server/http/config_tracker_impl_test.cc index d085e2c962af..c89c9ba4f43a 100644 --- a/test/server/http/config_tracker_impl_test.cc +++ b/test/server/http/config_tracker_impl_test.cc @@ -9,7 +9,7 @@ using testing::_; namespace Envoy { namespace Server { -class ConfigTrackerImplTest : public testing::Test { +class ConfigTrackerImplTest : public TestBase { public: ConfigTrackerImplTest() : cbs_map(tracker.getCallbacksMap()) { EXPECT_TRUE(cbs_map.empty()); diff --git a/test/server/init_manager_impl_test.cc b/test/server/init_manager_impl_test.cc index afaa2e44a017..1bbeac062ac0 100644 --- a/test/server/init_manager_impl_test.cc +++ b/test/server/init_manager_impl_test.cc @@ -12,7 +12,7 @@ using testing::Invoke; namespace Envoy { namespace Server { -class InitManagerImplTest : public testing::Test { +class InitManagerImplTest : public TestBase { public: InitManagerImpl manager_; ReadyWatcher initialized_; diff --git a/test/server/lds_api_test.cc b/test/server/lds_api_test.cc index 597716e6c8c2..73a092984c55 100644 --- a/test/server/lds_api_test.cc +++ b/test/server/lds_api_test.cc @@ -22,7 +22,7 @@ using testing::Throw; namespace Envoy { namespace Server { -class LdsApiTest : public testing::Test { +class LdsApiTest : public TestBase { public: LdsApiTest() : request_(&cluster_manager_.async_client_), api_(Api::createApiForTest(store_)) {} diff --git a/test/server/listener_manager_impl_test.cc b/test/server/listener_manager_impl_test.cc index be4c516e742e..2da958282303 100644 --- a/test/server/listener_manager_impl_test.cc +++ b/test/server/listener_manager_impl_test.cc @@ -25,12 +25,12 @@ #include "test/test_common/environment.h" #include "test/test_common/registry.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/threadsafe_singleton_injector.h" #include "test/test_common/utility.h" #include "absl/strings/escaping.h" #include "absl/strings/match.h" -#include "gtest/gtest.h" using testing::_; using testing::InSequence; @@ -55,7 +55,7 @@ class ListenerHandle { Configuration::FactoryContext* context_{}; }; -class ListenerManagerImplTest : public testing::Test { +class ListenerManagerImplTest : public TestBase { protected: ListenerManagerImplTest() : api_(Api::createApiForTest(stats_)) { ON_CALL(server_, api()).WillByDefault(ReturnRef(*api_)); diff --git a/test/server/options_impl_test.cc b/test/server/options_impl_test.cc index 08bb03ee116e..dd4b6aaeec84 100644 --- a/test/server/options_impl_test.cc +++ b/test/server/options_impl_test.cc @@ -9,17 +9,17 @@ #include "server/options_impl.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" #include "spdlog/spdlog.h" using testing::HasSubstr; namespace Envoy { -class OptionsImplTest : public testing::Test { +class OptionsImplTest : public TestBase { public: // Do the ugly work of turning a std::string into a char** and create an OptionsImpl. Args are diff --git a/test/server/overload_manager_impl_test.cc b/test/server/overload_manager_impl_test.cc index 439103650548..f79598a43ec2 100644 --- a/test/server/overload_manager_impl_test.cc +++ b/test/server/overload_manager_impl_test.cc @@ -10,10 +10,10 @@ #include "test/mocks/event/mocks.h" #include "test/mocks/thread_local/mocks.h" #include "test/test_common/registry.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::Invoke; @@ -69,7 +69,7 @@ class FakeResourceMonitorFactory FakeResourceMonitor* monitor_; // not owned }; -class OverloadManagerImplTest : public testing::Test { +class OverloadManagerImplTest : public TestBase { protected: OverloadManagerImplTest() : factory1_("envoy.resource_monitors.fake_resource1"), diff --git a/test/server/server_test.cc b/test/server/server_test.cc index aebaf8b1e653..a0d036d5d543 100644 --- a/test/server/server_test.cc +++ b/test/server/server_test.cc @@ -11,11 +11,10 @@ #include "test/mocks/server/mocks.h" #include "test/mocks/stats/mocks.h" #include "test/test_common/environment.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::_; using testing::Assign; using testing::HasSubstr; @@ -54,7 +53,7 @@ TEST(ServerInstanceUtil, flushHelper) { InstanceUtil::flushMetricsToSinks(sinks, source); } -class RunHelperTest : public testing::Test { +class RunHelperTest : public TestBase { public: RunHelperTest() : shutdown_(false) { InSequence s; @@ -113,7 +112,7 @@ TEST_F(RunHelperTest, ShutdownBeforeInitManagerInit) { } // Class creates minimally viable server instance for testing. -class ServerInstanceImplTest : public testing::TestWithParam { +class ServerInstanceImplTest : public TestBaseWithParam { protected: ServerInstanceImplTest() : version_(GetParam()) {} diff --git a/test/server/worker_impl_test.cc b/test/server/worker_impl_test.cc index 398e59e2e571..0be4f4873203 100644 --- a/test/server/worker_impl_test.cc +++ b/test/server/worker_impl_test.cc @@ -6,11 +6,10 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/server/mocks.h" #include "test/mocks/thread_local/mocks.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using testing::_; using testing::InSequence; using testing::Invoke; @@ -22,7 +21,7 @@ using testing::Throw; namespace Envoy { namespace Server { -class WorkerImplTest : public testing::Test { +class WorkerImplTest : public TestBase { public: WorkerImplTest() : api_(Api::createApiForTest(stats_store_)) { // In the real worker the watchdog has timers that prevent exit. Here we need to prevent event diff --git a/test/test_common/BUILD b/test/test_common/BUILD index 4b164f56c4b5..0aa8c4956b79 100644 --- a/test/test_common/BUILD +++ b/test/test_common/BUILD @@ -137,7 +137,7 @@ envoy_cc_library( ], ) -envoy_cc_test_library( +envoy_cc_library( name = "global_lib", srcs = ["global.cc"], hdrs = ["global.h"], @@ -155,6 +155,16 @@ envoy_cc_test( ], ) +envoy_cc_library( + name = "test_base", + srcs = ["test_base.cc"], + hdrs = ["test_base.h"], + deps = [ + "//external:googletest", + "//test/test_common:global_lib", + ], +) + envoy_cc_test_library( name = "test_time_lib", srcs = ["test_time.cc"], diff --git a/test/test_common/environment.cc b/test/test_common/environment.cc index 87cdadacb427..5097558f1ff9 100644 --- a/test/test_common/environment.cc +++ b/test/test_common/environment.cc @@ -27,7 +27,7 @@ #include "test/test_common/network_utility.h" #include "absl/strings/match.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" #include "spdlog/spdlog.h" namespace Envoy { diff --git a/test/test_common/global_test.cc b/test/test_common/global_test.cc index bd6bb5674660..901da205f924 100644 --- a/test/test_common/global_test.cc +++ b/test/test_common/global_test.cc @@ -2,13 +2,12 @@ #include #include "test/test_common/global.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Test { -class GlobalTest : public testing::Test { +class GlobalTest : public TestBase { protected: }; diff --git a/test/test_common/network_utility_test.cc b/test/test_common/network_utility_test.cc index 9d58e523abde..97fd38fb24f5 100644 --- a/test/test_common/network_utility_test.cc +++ b/test/test_common/network_utility_test.cc @@ -2,14 +2,13 @@ #include "test/test_common/environment.h" #include "test/test_common/network_utility.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Network { namespace Test { -class NetworkUtilityTest : public testing::TestWithParam { +class NetworkUtilityTest : public TestBaseWithParam { protected: NetworkUtilityTest() : version_(GetParam()) {} const Address::IpVersion version_; diff --git a/test/test_common/registry.h b/test/test_common/registry.h index 0cdcd8f5afd7..c1b04c8ba6f1 100644 --- a/test/test_common/registry.h +++ b/test/test_common/registry.h @@ -2,7 +2,7 @@ #include "envoy/registry/registry.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" namespace Envoy { namespace Registry { diff --git a/test/test_common/simulated_time_system_test.cc b/test/test_common/simulated_time_system_test.cc index 3dcd5a627868..ddc7db5dcae5 100644 --- a/test/test_common/simulated_time_system_test.cc +++ b/test/test_common/simulated_time_system_test.cc @@ -2,16 +2,16 @@ #include "common/event/libevent.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" #include "event2/event.h" -#include "gtest/gtest.h" namespace Envoy { namespace Event { namespace Test { -class SimulatedTimeSystemTest : public testing::Test { +class SimulatedTimeSystemTest : public TestBase { protected: SimulatedTimeSystemTest() : event_system_(event_base_new()), scheduler_(time_system_.createScheduler(event_system_)), diff --git a/test/test_common/test_base.cc b/test/test_common/test_base.cc new file mode 100644 index 000000000000..2e5b9d72bb30 --- /dev/null +++ b/test/test_common/test_base.cc @@ -0,0 +1,19 @@ +#include "test/test_common/test_base.h" + +#include "test/test_common/global.h" + +namespace Envoy { + +bool TestBase::checkSingletonQuiescensce() { + // Check that all singletons have been destroyed. + std::string active_singletons = Envoy::Test::Globals::describeActiveSingletons(); + if (!active_singletons.empty()) { + std::cerr << "\n\nFAIL: Active singletons exist:\n" << active_singletons << std::endl; + return false; + } + return true; +} + +TestBase::~TestBase() { checkSingletonQuiescensce(); } + +} // namespace Envoy diff --git a/test/test_common/test_base.h b/test/test_common/test_base.h new file mode 100644 index 000000000000..c4044fe6b745 --- /dev/null +++ b/test/test_common/test_base.h @@ -0,0 +1,21 @@ +#pragma once + +#include "gtest/gtest.h" + +namespace Envoy { + +// Provides a common test-base class for all tests in Envoy to use. This offers +// a place to put hooks we'd like to run on every tests. +class TestBase : public ::testing::Test { +public: + static bool checkSingletonQuiescensce(); + ~TestBase() override; +}; + +// Templatized version of TestBase. +template class TestBaseWithParam : public ::testing::TestWithParam { +public: + ~TestBaseWithParam() { TestBase::checkSingletonQuiescensce(); } +}; + +} // namespace Envoy diff --git a/test/test_common/test_time_system_test.cc b/test/test_common/test_time_system_test.cc index 30268d3fe6bf..27fc24cab94c 100644 --- a/test/test_common/test_time_system_test.cc +++ b/test/test_common/test_time_system_test.cc @@ -1,15 +1,14 @@ #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_base.h" #include "test/test_common/test_time.h" #include "test/test_common/test_time_system.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - namespace Envoy { namespace Event { namespace Test { -class TestTimeSystemTest : public testing::Test { +class TestTimeSystemTest : public TestBase { protected: }; diff --git a/test/test_common/utility.cc b/test/test_common/utility.cc index 2040262085c7..4b10d5208c44 100644 --- a/test/test_common/utility.cc +++ b/test/test_common/utility.cc @@ -41,7 +41,7 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" using testing::GTEST_FLAG(random_seed); diff --git a/test/test_common/utility.h b/test/test_common/utility.h index 4b36e2082d2c..02726229002c 100644 --- a/test/test_common/utility.h +++ b/test/test_common/utility.h @@ -24,10 +24,10 @@ #include "common/stats/raw_stat_data.h" #include "test/test_common/printers.h" +#include "test/test_common/test_base.h" #include "absl/time/time.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" using testing::_; using testing::AssertionFailure; @@ -285,7 +285,7 @@ class TestUtility { // Tests using this will be of the form IpVersions/SslSocketTest.HalfClose/IPv4 // instead of IpVersions/SslSocketTest.HalfClose/1 static std::string - ipTestParamsToString(const testing::TestParamInfo& params) { + ipTestParamsToString(const ::testing::TestParamInfo& params) { return params.param == Network::Address::IpVersion::v4 ? "IPv4" : "IPv6"; } diff --git a/test/test_common/utility_test.cc b/test/test_common/utility_test.cc index 40083fe33946..347440eea747 100644 --- a/test/test_common/utility_test.cc +++ b/test/test_common/utility_test.cc @@ -1,7 +1,6 @@ +#include "test/test_common/test_base.h" #include "test/test_common/utility.h" -#include "gtest/gtest.h" - using Envoy::Http::HeaderMap; namespace Envoy { diff --git a/test/test_runner.h b/test/test_runner.h index 7893ddf597ab..34754d376de1 100644 --- a/test/test_runner.h +++ b/test/test_runner.h @@ -7,10 +7,9 @@ #include "test/mocks/access_log/mocks.h" #include "test/test_common/environment.h" -#include "test/test_common/global.h" +#include "test/test_common/test_base.h" #include "gmock/gmock.h" -#include "gtest/gtest.h" namespace Envoy { class TestRunner { @@ -27,8 +26,8 @@ class TestRunner { // (https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md#logging-additional-information), // they are available in the test XML. // TODO(htuch): Log these as well? - ::testing::Test::RecordProperty("TemporaryDirectory", TestEnvironment::temporaryDirectory()); - ::testing::Test::RecordProperty("RunfilesDirectory", TestEnvironment::runfilesDirectory()); + TestBase::RecordProperty("TemporaryDirectory", TestEnvironment::temporaryDirectory()); + TestBase::RecordProperty("RunfilesDirectory", TestEnvironment::runfilesDirectory()); TestEnvironment::setEnvVar("TEST_UDSDIR", TestEnvironment::unixDomainSocketDirectory(), 1); @@ -49,9 +48,7 @@ class TestRunner { int exit_status = RUN_ALL_TESTS(); // Check that all singletons have been destroyed. - std::string active_singletons = Test::Globals::describeActiveSingletons(); - if (!active_singletons.empty()) { - std::cerr << "\n\nFAIL: Active singletons exist:\n" << active_singletons << std::endl; + if (!TestBase::checkSingletonQuiescensce()) { exit_status = EXIT_FAILURE; } diff --git a/test/tools/config_load_check/config_load_check.cc b/test/tools/config_load_check/config_load_check.cc index a36e531c53b1..dbbacdb49997 100644 --- a/test/tools/config_load_check/config_load_check.cc +++ b/test/tools/config_load_check/config_load_check.cc @@ -9,8 +9,7 @@ #include "common/event/libevent.h" #include "test/config_test/config_test.h" - -#include "gtest/gtest.h" +#include "test/test_common/test_base.h" int main(int argc, char* argv[]) { if (argc != 2) { diff --git a/tools/check_format.py b/tools/check_format.py index f03defe713ee..c14ce69819a1 100755 --- a/tools/check_format.py +++ b/tools/check_format.py @@ -380,6 +380,11 @@ def checkSourceLine(line, file_path, reportError): reportError("Don't use the '?:' operator, it is a non-standard GCC extension") if line.startswith('using testing::Test;'): reportError("Don't use 'using testing::Test;, elaborate the type instead") + if line.startswith('using testing::TestWithParams;'): + reportError("Don't use 'using testing::Test;, elaborate the type instead") + if file_path != './test/test_common/test_base.h' and (' testing::Test ' in line or + ' testing::TestWithParam' in line): + reportError("Derive test classes from TestBase in test/test_common/test_base.h") def checkBuildLine(line, file_path, reportError):