From 03902d566027b0a4a88960fa099065668ac52476 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Wed, 22 Nov 2023 14:10:58 +0800 Subject: [PATCH] iwyu --- cmake_modules/BaseFunctions.cmake | 6 +++--- run.sh | 2 +- src/aio/disk_engine.cpp | 5 +++++ src/aio/test/aio.cpp | 5 +---- src/base/test/redact_sensitive_string_test.cpp | 4 +--- src/base/test/utils_test.cpp | 4 +--- src/base/test/value_manager_test.cpp | 4 +--- src/base/test/value_schema_test.cpp | 4 +--- .../test/block_service_manager_test.cpp | 6 ++---- src/block_service/test/fds_service_test.cpp | 4 +--- src/block_service/test/hdfs_service_test.cpp | 7 +------ src/block_service/test/local_service_test.cpp | 5 +---- src/client/test/ddl_client_test.cpp | 5 +---- src/common/test/common_test.cpp | 5 ++--- src/common/test/duplication_common_test.cpp | 4 +--- src/common/test/fs_manager_test.cpp | 8 ++------ src/common/test/replication_common_test.cpp | 5 +---- src/failure_detector/test/failure_detector.cpp | 7 +++---- src/geo/test/geo_test.cpp | 5 +---- src/geo/test/latlng_codec_test.cpp | 4 +--- src/http/test/http_client_test.cpp | 3 ++- src/http/test/http_server_test.cpp | 5 +---- .../test/perf_counter_http_service_test.cpp | 4 +--- src/http/test/uri_decoder_test.cpp | 4 +--- src/meta/test/backup_test.cpp | 4 +--- src/meta/test/cluster_balance_policy_test.cpp | 7 ++----- src/meta/test/copy_replica_operation_test.cpp | 5 +---- src/meta/test/dump_file.cpp | 6 ++---- src/meta/test/duplication_info_test.cpp | 5 +---- src/meta/test/ford_fulkerson_test.cpp | 7 ++----- src/meta/test/json_compacity.cpp | 4 +--- src/meta/test/meta_app_envs_test.cpp | 4 +--- src/meta/test/meta_app_operation_test.cpp | 4 +--- src/meta/test/meta_backup_test.cpp | 4 +--- .../test/meta_bulk_load_ingestion_test.cpp | 5 +---- src/meta/test/meta_bulk_load_service_test.cpp | 4 +--- src/meta/test/meta_data.cpp | 5 +---- .../test/meta_duplication_service_test.cpp | 4 +--- src/meta/test/meta_http_service_test.cpp | 5 +---- src/meta/test/meta_mauanl_compaction_test.cpp | 5 +---- src/meta/test/meta_partition_guardian_test.cpp | 4 +--- src/meta/test/meta_service_test.cpp | 5 ++--- src/meta/test/meta_split_service_test.cpp | 4 +--- .../test/meta_state/meta_state_service.cpp | 6 +----- .../test/meta_state_service_utils_test.cpp | 4 +--- src/meta/test/meta_test_base.cpp | 5 +---- src/meta/test/server_state_restore_test.cpp | 4 +--- src/meta/test/server_state_test.cpp | 4 +--- src/meta/test/state_sync_test.cpp | 4 +--- src/meta/test/update_configuration_test.cpp | 6 ++---- src/nfs/test/main.cpp | 5 +---- src/perf_counter/perf_counter_atomic.cpp | 1 + src/perf_counter/test/perf_counter_test.cpp | 7 ++----- src/perf_counter/test/perf_counters_test.cpp | 4 +--- .../proxy_ut/redis_proxy_test.cpp | 4 +--- .../test/replica_backup_manager_test.cpp | 5 +---- .../test/replica_bulk_loader_test.cpp | 5 +---- .../test/dup_replica_http_service_test.cpp | 5 +---- .../test/duplication_sync_timer_test.cpp | 6 +----- .../test/load_from_private_log_test.cpp | 6 +----- .../duplication/test/mutation_batch_test.cpp | 6 ++---- .../test/replica_duplicator_manager_test.cpp | 5 +---- .../test/replica_duplicator_test.cpp | 5 +---- .../duplication/test/replica_follower_test.cpp | 6 +----- .../duplication/test/ship_mutation_test.cpp | 7 ++----- src/replica/split/test/replica_split_test.cpp | 6 +----- src/replica/test/cold_backup_context_test.cpp | 5 +---- src/replica/test/log_block_test.cpp | 5 +---- src/replica/test/log_file_test.cpp | 5 +---- src/replica/test/main.cpp | 3 +-- src/replica/test/mutation_log_learn_test.cpp | 6 +----- src/replica/test/mutation_log_test.cpp | 8 +++----- src/replica/test/open_replica_test.cpp | 6 +----- src/replica/test/replica_disk_migrate_test.cpp | 5 +---- src/replica/test/replica_disk_test.cpp | 5 +---- src/replica/test/replica_http_service_test.cpp | 5 +---- src/replica/test/replica_learn_test.cpp | 6 +----- src/replica/test/replica_test.cpp | 7 ++----- .../test/throttling_controller_test.cpp | 4 +--- src/runtime/rpc/asio_net_provider.cpp | 18 ++++++++++++++++++ src/runtime/rpc/asio_rpc_session.cpp | 13 +++++++++++++ src/runtime/task/hpc_task_queue.cpp | 2 ++ src/runtime/task/simple_task_queue.cpp | 1 + src/runtime/test/address_test.cpp | 4 +--- src/runtime/test/async_call.cpp | 5 +---- src/runtime/test/client_negotiation_test.cpp | 4 +--- src/runtime/test/corrupt_message.cpp | 2 +- src/runtime/test/host_port_test.cpp | 4 +--- src/runtime/test/lpc.cpp | 4 +--- src/runtime/test/message_reader_test.cpp | 4 +--- src/runtime/test/message_utils_test.cpp | 4 +--- .../test/meta_access_controller_test.cpp | 4 +--- src/runtime/test/negotiation_manager_test.cpp | 5 +---- src/runtime/test/netprovider.cpp | 4 +--- src/runtime/test/pipeline_test.cpp | 6 ++---- .../ranger_resource_policy_manager_test.cpp | 4 +--- .../test/ranger_resource_policy_test.cpp | 5 +---- .../test/replica_access_controller_test.cpp | 4 +--- src/runtime/test/rpc.cpp | 4 +--- src/runtime/test/rpc_holder_test.cpp | 4 +--- src/runtime/test/rpc_message.cpp | 4 +--- src/runtime/test/server_negotiation_test.cpp | 4 +--- src/runtime/test/service_api_c.cpp | 4 +--- src/runtime/test/sim_lock.cpp | 4 +--- src/runtime/test/task_engine.cpp | 4 +--- src/runtime/test/task_test.cpp | 5 ++--- .../test/thrift_message_parser_test.cpp | 4 +--- .../test/capacity_unit_calculator_test.cpp | 6 +----- .../test/compaction_filter_rule_test.cpp | 4 +--- src/server/test/compaction_operation_test.cpp | 4 +--- src/server/test/hashkey_transform_test.cpp | 4 +--- src/server/test/hotkey_collector_test.cpp | 5 +---- src/server/test/hotspot_partition_test.cpp | 8 ++------ .../test/manual_compact_service_test.cpp | 5 +---- .../test/pegasus_compression_options_test.cpp | 6 +----- .../test/pegasus_mutation_duplicator_test.cpp | 6 ++---- src/server/test/pegasus_server_impl_test.cpp | 8 ++------ src/server/test/pegasus_server_write_test.cpp | 6 +----- src/server/test/pegasus_value_schema_test.cpp | 5 ++--- .../test/pegasus_write_service_impl_test.cpp | 6 ++---- src/server/test/pegasus_write_service_test.cpp | 6 +----- src/server/test/rocksdb_wrapper_test.cpp | 5 +---- .../backup_restore/test_backup_and_restore.cpp | 4 +--- .../base_api/integration_test.cpp | 4 +--- src/test/function_test/base_api/test_basic.cpp | 4 +--- .../function_test/base_api/test_batch_get.cpp | 7 ++----- .../base_api/test_check_and_mutate.cpp | 4 +--- .../base_api/test_check_and_set.cpp | 4 +--- src/test/function_test/base_api/test_copy.cpp | 6 +----- src/test/function_test/base_api/test_incr.cpp | 4 +--- .../function_test/base_api/test_range_read.cpp | 4 +--- .../function_test/base_api/test_recall.cpp | 6 ++---- src/test/function_test/base_api/test_scan.cpp | 6 +----- src/test/function_test/base_api/test_ttl.cpp | 4 +--- .../function_test/bulk_load/test_bulk_load.cpp | 4 +--- .../detect_hotspot/test_detect_hotspot.cpp | 4 +--- .../partition_split/test_split.cpp | 4 +--- .../function_test/recovery/test_recovery.cpp | 5 +---- .../function_test/restore/test_restore.cpp | 4 +--- .../function_test/throttle/test_throttle.cpp | 5 +---- src/test/function_test/utils/global_env.cpp | 2 +- src/test/function_test/utils/test_util.cpp | 3 --- src/test_util/test_util.cpp | 3 --- src/utils/test/TokenBucketTest.cpp | 6 ++---- src/utils/test/autoref_ptr_test.cpp | 7 ++----- src/utils/test/binary_reader_test.cpp | 5 +---- src/utils/test/command_manager_test.cpp | 5 ++--- src/utils/test/configuration.cpp | 4 +--- src/utils/test/endian_test.cpp | 4 +--- src/utils/test/env.cpp | 6 +----- src/utils/test/fail_point_test.cpp | 6 ++---- src/utils/test/file_system_test.cpp | 5 +---- src/utils/test/file_utils.cpp | 6 +----- src/utils/test/flag_test.cpp | 4 +--- src/utils/test/fmt_logging_test.cpp | 4 +--- src/utils/test/hostname_test.cpp | 4 +--- src/utils/test/join_point_test.cpp | 5 ++--- src/utils/test/json_helper_test.cpp | 5 +---- src/utils/test/latency_tracer_test.cpp | 6 ++---- src/utils/test/lock.std.cpp | 6 ++---- src/utils/test/logger.cpp | 5 +---- src/utils/test/long_adder_test.cpp | 5 +---- src/utils/test/memutil_test.cpp | 7 +++---- src/utils/test/nth_element_test.cpp | 5 +---- src/utils/test/output_utils_test.cpp | 7 +++---- src/utils/test/priority_queue.cpp | 4 +--- src/utils/test/rand_test.cpp | 5 ++--- src/utils/test/sema.cpp | 7 +++---- src/utils/test/smart_pointers_test.cpp | 6 ++---- src/utils/test/string_conv_test.cpp | 5 +---- src/utils/test/string_view_test.cpp | 5 ++--- src/utils/test/time_utils_test.cpp | 4 +--- ...token_bucket_throttling_controller_test.cpp | 5 ++--- src/utils/test/token_buckets_test.cpp | 4 +--- src/utils/test/utils.cpp | 6 ++---- .../test/distributed_lock_zookeeper.cpp | 5 +---- 176 files changed, 254 insertions(+), 620 deletions(-) diff --git a/cmake_modules/BaseFunctions.cmake b/cmake_modules/BaseFunctions.cmake index ad4133e0bc..00ae2f4749 100644 --- a/cmake_modules/BaseFunctions.cmake +++ b/cmake_modules/BaseFunctions.cmake @@ -306,7 +306,7 @@ function(dsn_setup_system_libs) endfunction(dsn_setup_system_libs) function(dsn_setup_include_path)#TODO(huangwei5): remove this - include_directories(${THIRDPARTY_INSTALL_DIR}/include) + include_directories(SYSTEM ${THIRDPARTY_INSTALL_DIR}/include) endfunction(dsn_setup_include_path) function(dsn_setup_thirdparty_libs) @@ -320,7 +320,7 @@ function(dsn_setup_thirdparty_libs) set(CMAKE_PREFIX_PATH ${THIRDPARTY_INSTALL_DIR};${CMAKE_PREFIX_PATH}) message(STATUS "CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}") find_package(Boost COMPONENTS system filesystem regex REQUIRED) - include_directories(${Boost_INCLUDE_DIRS}) + include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) find_library(THRIFT_LIB NAMES libthrift.a PATHS ${THIRDPARTY_INSTALL_DIR}/lib NO_DEFAULT_PATH) if(NOT THRIFT_LIB) @@ -349,7 +349,7 @@ function(dsn_setup_thirdparty_libs) link_libraries(${JAVA_JVM_LIBRARY}) find_package(OpenSSL REQUIRED) - include_directories(${OPENSSL_INCLUDE_DIR}) + include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR}) link_libraries(${OPENSSL_CRYPTO_LIBRARY}) link_libraries(${OPENSSL_SSL_LIBRARY}) diff --git a/run.sh b/run.sh index ab5e9852df..b3d0b49bad 100755 --- a/run.sh +++ b/run.sh @@ -290,7 +290,7 @@ function run_build() echo "Running cmake Pegasus..." pushd $BUILD_DIR if [ ! -z "${IWYU}" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=${IWYU}" + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE='${IWYU};-Xiwyu;--mapping_file=${ROOT}/iwyu/gmock.imp;--mapping_file=${ROOT}/iwyu/gmock.imp'" fi CMAKE_OPTIONS="${CMAKE_OPTIONS} -DBUILD_TEST=${BUILD_TEST}" cmake ${ROOT} -DCMAKE_INSTALL_PREFIX=$BUILD_DIR/output $CMAKE_OPTIONS diff --git a/src/aio/disk_engine.cpp b/src/aio/disk_engine.cpp index 1b104be301..fb133e4c0b 100644 --- a/src/aio/disk_engine.cpp +++ b/src/aio/disk_engine.cpp @@ -45,6 +45,11 @@ #include "utils/link.h" #include "utils/threadpool_code.h" +namespace rocksdb { +class RandomAccessFile; +class RandomRWFile; +} // namespace rocksdb + namespace dsn { DEFINE_TASK_CODE_AIO(LPC_AIO_BATCH_WRITE, TASK_PRIORITY_COMMON, THREAD_POOL_DEFAULT) diff --git a/src/aio/test/aio.cpp b/src/aio/test/aio.cpp index 2fadded6db..93148c6509 100644 --- a/src/aio/test/aio.cpp +++ b/src/aio/test/aio.cpp @@ -25,10 +25,6 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -41,6 +37,7 @@ #include "aio/aio_task.h" #include "aio/file_io.h" +#include "gtest/gtest.h" #include "runtime/task/task_code.h" #include "runtime/tool_api.h" #include "test_util/test_util.h" diff --git a/src/base/test/redact_sensitive_string_test.cpp b/src/base/test/redact_sensitive_string_test.cpp index d0bbcd7c61..b4a9f55a16 100644 --- a/src/base/test/redact_sensitive_string_test.cpp +++ b/src/base/test/redact_sensitive_string_test.cpp @@ -17,12 +17,10 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include "base/pegasus_utils.h" +#include "gtest/gtest.h" const std::string test_string = "pegasus"; diff --git a/src/base/test/utils_test.cpp b/src/base/test/utils_test.cpp index ad7dcc337c..ec5a34cf2a 100644 --- a/src/base/test/utils_test.cpp +++ b/src/base/test/utils_test.cpp @@ -17,13 +17,11 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include "../pegasus_utils.h" +#include "gtest/gtest.h" namespace pegasus { namespace utils { diff --git a/src/base/test/value_manager_test.cpp b/src/base/test/value_manager_test.cpp index 8bfff2c57c..3fbf25e3f2 100644 --- a/src/base/test/value_manager_test.cpp +++ b/src/base/test/value_manager_test.cpp @@ -17,13 +17,11 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include "base/value_schema_manager.h" +#include "gtest/gtest.h" #include "pegasus_value_schema.h" #include "utils/string_view.h" #include "value_field.h" diff --git a/src/base/test/value_schema_test.cpp b/src/base/test/value_schema_test.cpp index 73b8cedd21..5c1fc0804e 100644 --- a/src/base/test/value_schema_test.cpp +++ b/src/base/test/value_schema_test.cpp @@ -17,9 +17,6 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -31,6 +28,7 @@ #include "base/pegasus_value_schema.h" #include "base/value_schema_manager.h" +#include "gtest/gtest.h" #include "utils/blob.h" #include "utils/string_view.h" #include "value_field.h" diff --git a/src/block_service/test/block_service_manager_test.cpp b/src/block_service/test/block_service_manager_test.cpp index a059062b25..ee854a84f1 100644 --- a/src/block_service/test/block_service_manager_test.cpp +++ b/src/block_service/test/block_service_manager_test.cpp @@ -15,10 +15,7 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +// IWYU pragma: no_include #include #include #include @@ -28,6 +25,7 @@ #include "block_service/block_service_manager.h" #include "block_service/local/local_service.h" #include "block_service_mock.h" +#include "gtest/gtest.h" #include "metadata_types.h" #include "test_util/test_util.h" #include "utils/error_code.h" diff --git a/src/block_service/test/fds_service_test.cpp b/src/block_service/test/fds_service_test.cpp index d06f3718a1..3c8d15b2b4 100644 --- a/src/block_service/test/fds_service_test.cpp +++ b/src/block_service/test/fds_service_test.cpp @@ -19,9 +19,6 @@ #include #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -32,6 +29,7 @@ #include #include "block_service/block_service.h" +#include "gtest/gtest.h" #include "utils/autoref_ptr.h" #include "utils/blob.h" #include "utils/enum_helper.h" diff --git a/src/block_service/test/hdfs_service_test.cpp b/src/block_service/test/hdfs_service_test.cpp index b072a25ed8..75f9e77b27 100644 --- a/src/block_service/test/hdfs_service_test.cpp +++ b/src/block_service/test/hdfs_service_test.cpp @@ -16,25 +16,20 @@ // under the License. #include -#include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include #include -#include #include -#include #include #include #include #include "block_service/block_service.h" #include "block_service/hdfs/hdfs_service.h" +#include "gtest/gtest.h" #include "runtime/api_layer1.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" diff --git a/src/block_service/test/local_service_test.cpp b/src/block_service/test/local_service_test.cpp index a852f68ca6..692a2d2c81 100644 --- a/src/block_service/test/local_service_test.cpp +++ b/src/block_service/test/local_service_test.cpp @@ -18,10 +18,6 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -35,6 +31,7 @@ #include #include "block_service/local/local_service.h" +#include "gtest/gtest.h" #include "test_util/test_util.h" #include "utils/env.h" #include "utils/error_code.h" diff --git a/src/client/test/ddl_client_test.cpp b/src/client/test/ddl_client_test.cpp index 414c1f029f..1240caf9b5 100644 --- a/src/client/test/ddl_client_test.cpp +++ b/src/client/test/ddl_client_test.cpp @@ -16,17 +16,14 @@ // under the License. #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include -#include #include #include #include #include "client/replication_ddl_client.h" #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "meta_admin_types.h" #include "runtime/api_layer1.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/common/test/common_test.cpp b/src/common/test/common_test.cpp index c2bf31713a..2bc913fada 100644 --- a/src/common/test/common_test.cpp +++ b/src/common/test/common_test.cpp @@ -19,11 +19,10 @@ #include "common/common.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include +#include "gtest/gtest.h" + namespace dsn { TEST(duplication_common, get_current_cluster_name) { diff --git a/src/common/test/duplication_common_test.cpp b/src/common/test/duplication_common_test.cpp index 538db34da8..8d5fa63541 100644 --- a/src/common/test/duplication_common_test.cpp +++ b/src/common/test/duplication_common_test.cpp @@ -26,11 +26,9 @@ #include "common//duplication_common.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include +#include "gtest/gtest.h" #include "utils/error_code.h" namespace dsn { diff --git a/src/common/test/fs_manager_test.cpp b/src/common/test/fs_manager_test.cpp index 6027c649d6..9474b7df53 100644 --- a/src/common/test/fs_manager_test.cpp +++ b/src/common/test/fs_manager_test.cpp @@ -17,15 +17,10 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include #include #include #include -#include #include #include #include @@ -33,6 +28,7 @@ #include "common/fs_manager.h" #include "common/gpid.h" #include "common/replication_other_types.h" +#include "gtest/gtest.h" #include "metadata_types.h" #include "test_util/test_util.h" #include "utils/fail_point.h" diff --git a/src/common/test/replication_common_test.cpp b/src/common/test/replication_common_test.cpp index a25d9d7d3b..f83eecae39 100644 --- a/src/common/test/replication_common_test.cpp +++ b/src/common/test/replication_common_test.cpp @@ -17,16 +17,13 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include -#include #include #include #include #include "common/replication_common.h" +#include "gtest/gtest.h" #include "utils/filesystem.h" namespace dsn { diff --git a/src/failure_detector/test/failure_detector.cpp b/src/failure_detector/test/failure_detector.cpp index b78b34b9e3..28641e3d09 100644 --- a/src/failure_detector/test/failure_detector.cpp +++ b/src/failure_detector/test/failure_detector.cpp @@ -24,10 +24,7 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include #include #include #include @@ -39,12 +36,14 @@ #include #include #include +#include #include #include #include "failure_detector/failure_detector.h" #include "failure_detector/failure_detector_multimaster.h" #include "fd_types.h" +#include "gtest/gtest.h" #include "meta/meta_options.h" #include "meta/meta_server_failure_detector.h" #include "replica/replica_stub.h" diff --git a/src/geo/test/geo_test.cpp b/src/geo/test/geo_test.cpp index e9df7a422a..a607faa558 100644 --- a/src/geo/test/geo_test.cpp +++ b/src/geo/test/geo_test.cpp @@ -18,10 +18,6 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -43,6 +39,7 @@ #include "client/replication_ddl_client.h" #include "common/replication_other_types.h" #include "geo/lib/geo_client.h" +#include "gtest/gtest.h" #include "pegasus/client.h" #include "runtime/rpc/rpc_address.h" #include "utils/blob.h" diff --git a/src/geo/test/latlng_codec_test.cpp b/src/geo/test/latlng_codec_test.cpp index 22f0243cbe..174d24fe09 100644 --- a/src/geo/test/latlng_codec_test.cpp +++ b/src/geo/test/latlng_codec_test.cpp @@ -17,15 +17,13 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include "geo/lib/latlng_codec.h" +#include "gtest/gtest.h" #include "utils/errors.h" namespace pegasus { diff --git a/src/http/test/http_client_test.cpp b/src/http/test/http_client_test.cpp index d15cb7bdd4..26db8e65bb 100644 --- a/src/http/test/http_client_test.cpp +++ b/src/http/test/http_client_test.cpp @@ -16,15 +16,16 @@ // under the License. #include -#include // IWYU pragma: no_include // IWYU pragma: no_include // IWYU pragma: no_include #include #include #include +#include #include +#include "gtest/gtest.h" #include "http/http_client.h" #include "http/http_method.h" #include "utils/error_code.h" diff --git a/src/http/test/http_server_test.cpp b/src/http/test/http_server_test.cpp index 0c6b9ec6d3..1b01ef1625 100644 --- a/src/http/test/http_server_test.cpp +++ b/src/http/test/http_server_test.cpp @@ -15,18 +15,15 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include -#include #include #include #include #include #include +#include "gtest/gtest.h" #include "http/builtin_http_calls.h" #include "http/http_call_registry.h" #include "http/http_message_parser.h" diff --git a/src/http/test/perf_counter_http_service_test.cpp b/src/http/test/perf_counter_http_service_test.cpp index ec447d761a..0f4da2690b 100644 --- a/src/http/test/perf_counter_http_service_test.cpp +++ b/src/http/test/perf_counter_http_service_test.cpp @@ -15,12 +15,10 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include "gtest/gtest.h" #include "http/builtin_http_calls.h" #include "http/http_server.h" #include "perf_counter/perf_counter.h" diff --git a/src/http/test/uri_decoder_test.cpp b/src/http/test/uri_decoder_test.cpp index 45cfcb7347..b62e5b7bdf 100644 --- a/src/http/test/uri_decoder_test.cpp +++ b/src/http/test/uri_decoder_test.cpp @@ -15,12 +15,10 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include "gtest/gtest.h" #include "utils/error_code.h" #include "utils/errors.h" diff --git a/src/meta/test/backup_test.cpp b/src/meta/test/backup_test.cpp index 70062ba693..9006e441da 100644 --- a/src/meta/test/backup_test.cpp +++ b/src/meta/test/backup_test.cpp @@ -16,9 +16,6 @@ // under the License. #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -36,6 +33,7 @@ #include "common/gpid.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_backup_service.h" #include "meta/meta_data.h" #include "meta/meta_service.h" diff --git a/src/meta/test/cluster_balance_policy_test.cpp b/src/meta/test/cluster_balance_policy_test.cpp index e86c4ce864..85aa65beac 100644 --- a/src/meta/test/cluster_balance_policy_test.cpp +++ b/src/meta/test/cluster_balance_policy_test.cpp @@ -15,11 +15,7 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include +#include #include #include #include @@ -33,6 +29,7 @@ #include "common/gpid.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/cluster_balance_policy.h" #include "meta/load_balance_policy.h" #include "meta/meta_data.h" diff --git a/src/meta/test/copy_replica_operation_test.cpp b/src/meta/test/copy_replica_operation_test.cpp index d20c937d34..c2f681fd32 100644 --- a/src/meta/test/copy_replica_operation_test.cpp +++ b/src/meta/test/copy_replica_operation_test.cpp @@ -15,11 +15,7 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include -#include #include #include #include @@ -30,6 +26,7 @@ #include "common/gpid.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/app_balance_policy.h" #include "meta/load_balance_policy.h" #include "meta/meta_data.h" diff --git a/src/meta/test/dump_file.cpp b/src/meta/test/dump_file.cpp index 33b82ec9be..b1528c8816 100644 --- a/src/meta/test/dump_file.cpp +++ b/src/meta/test/dump_file.cpp @@ -24,16 +24,14 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include -#include #include +#include #include +#include "gtest/gtest.h" #include "meta/dump_file.h" #include "utils/blob.h" #include "utils/strings.h" diff --git a/src/meta/test/duplication_info_test.cpp b/src/meta/test/duplication_info_test.cpp index 3ce1b9c8ea..6ac67d090c 100644 --- a/src/meta/test/duplication_info_test.cpp +++ b/src/meta/test/duplication_info_test.cpp @@ -27,11 +27,8 @@ #include "meta/duplication/duplication_info.h" #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include +#include "gtest/gtest.h" #include "runtime/app_model.h" namespace dsn { diff --git a/src/meta/test/ford_fulkerson_test.cpp b/src/meta/test/ford_fulkerson_test.cpp index 858ce3d11d..dc05eede66 100644 --- a/src/meta/test/ford_fulkerson_test.cpp +++ b/src/meta/test/ford_fulkerson_test.cpp @@ -15,18 +15,15 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include #include -#include #include #include #include #include "common/gpid.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/load_balance_policy.h" #include "meta/meta_data.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/meta/test/json_compacity.cpp b/src/meta/test/json_compacity.cpp index dfe9828f73..66b870ede9 100644 --- a/src/meta/test/json_compacity.cpp +++ b/src/meta/test/json_compacity.cpp @@ -24,9 +24,6 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -38,6 +35,7 @@ #include "common/json_helper.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_backup_service.h" #include "meta_service_test_app.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/meta/test/meta_app_envs_test.cpp b/src/meta/test/meta_app_envs_test.cpp index d5dc21edac..f3422f7c71 100644 --- a/src/meta/test/meta_app_envs_test.cpp +++ b/src/meta/test/meta_app_envs_test.cpp @@ -24,15 +24,13 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include "common/replica_envs.h" +#include "gtest/gtest.h" #include "meta/meta_data.h" #include "meta_admin_types.h" #include "meta_test_base.h" diff --git a/src/meta/test/meta_app_operation_test.cpp b/src/meta/test/meta_app_operation_test.cpp index e0afc1baa5..a6f3cce2c1 100644 --- a/src/meta/test/meta_app_operation_test.cpp +++ b/src/meta/test/meta_app_operation_test.cpp @@ -16,9 +16,6 @@ // under the License. #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -34,6 +31,7 @@ #include "common/replica_envs.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_data.h" #include "meta/meta_rpc_types.h" #include "meta/meta_service.h" diff --git a/src/meta/test/meta_backup_test.cpp b/src/meta/test/meta_backup_test.cpp index 3692e0724f..da74bc7bfb 100644 --- a/src/meta/test/meta_backup_test.cpp +++ b/src/meta/test/meta_backup_test.cpp @@ -15,9 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -29,6 +26,7 @@ #include "common/backup_common.h" #include "common/gpid.h" #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "meta/backup_engine.h" #include "meta/meta_backup_service.h" #include "meta/meta_data.h" diff --git a/src/meta/test/meta_bulk_load_ingestion_test.cpp b/src/meta/test/meta_bulk_load_ingestion_test.cpp index 758fa3d3e4..73bb93ae60 100644 --- a/src/meta/test/meta_bulk_load_ingestion_test.cpp +++ b/src/meta/test/meta_bulk_load_ingestion_test.cpp @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include #include #include #include @@ -27,6 +23,7 @@ #include "common/gpid.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_bulk_load_ingestion_context.h" #include "meta/meta_data.h" #include "meta_test_base.h" diff --git a/src/meta/test/meta_bulk_load_service_test.cpp b/src/meta/test/meta_bulk_load_service_test.cpp index 1dcd5e1e63..c83f8cbbb4 100644 --- a/src/meta/test/meta_bulk_load_service_test.cpp +++ b/src/meta/test/meta_bulk_load_service_test.cpp @@ -16,9 +16,6 @@ // under the License. #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -41,6 +38,7 @@ #include "common/replication_enums.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_bulk_load_service.h" #include "meta/meta_data.h" #include "meta/meta_options.h" diff --git a/src/meta/test/meta_data.cpp b/src/meta/test/meta_data.cpp index 2aef6ddd5a..16bcf7f1c4 100644 --- a/src/meta/test/meta_data.cpp +++ b/src/meta/test/meta_data.cpp @@ -24,10 +24,6 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include #include #include #include @@ -35,6 +31,7 @@ #include "client/partition_resolver.h" #include "common/gpid.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_data.h" #include "metadata_types.h" #include "misc/misc.h" diff --git a/src/meta/test/meta_duplication_service_test.cpp b/src/meta/test/meta_duplication_service_test.cpp index d40f2fc789..2e222d0b7a 100644 --- a/src/meta/test/meta_duplication_service_test.cpp +++ b/src/meta/test/meta_duplication_service_test.cpp @@ -26,9 +26,6 @@ // IWYU pragma: no_include #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -48,6 +45,7 @@ #include "common/replication_other_types.h" #include "dsn.layer2_types.h" #include "duplication_types.h" +#include "gtest/gtest.h" #include "http/http_server.h" #include "meta/duplication/duplication_info.h" #include "meta/duplication/meta_duplication_service.h" diff --git a/src/meta/test/meta_http_service_test.cpp b/src/meta/test/meta_http_service_test.cpp index 7ae0473b63..cc2497ea8a 100644 --- a/src/meta/test/meta_http_service_test.cpp +++ b/src/meta/test/meta_http_service_test.cpp @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include #include #include #include @@ -32,6 +28,7 @@ #include "bulk_load_types.h" #include "common/gpid.h" #include "common/replication_other_types.h" +#include "gtest/gtest.h" #include "http/http_server.h" #include "meta/meta_backup_service.h" #include "meta/meta_bulk_load_service.h" diff --git a/src/meta/test/meta_mauanl_compaction_test.cpp b/src/meta/test/meta_mauanl_compaction_test.cpp index 7b7407283f..3a0184ff7b 100644 --- a/src/meta/test/meta_mauanl_compaction_test.cpp +++ b/src/meta/test/meta_mauanl_compaction_test.cpp @@ -15,11 +15,7 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include -#include #include #include #include @@ -30,6 +26,7 @@ #include "common/replica_envs.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_data.h" #include "meta/server_state.h" #include "meta_admin_types.h" diff --git a/src/meta/test/meta_partition_guardian_test.cpp b/src/meta/test/meta_partition_guardian_test.cpp index 00c444b355..403dcb3fe2 100644 --- a/src/meta/test/meta_partition_guardian_test.cpp +++ b/src/meta/test/meta_partition_guardian_test.cpp @@ -24,9 +24,6 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -45,6 +42,7 @@ #include "common/replication_other_types.h" #include "dsn.layer2_types.h" #include "dummy_balancer.h" +#include "gtest/gtest.h" #include "meta/greedy_load_balancer.h" #include "meta/meta_data.h" #include "meta/meta_options.h" diff --git a/src/meta/test/meta_service_test.cpp b/src/meta/test/meta_service_test.cpp index 2bb7ee2995..44fc1ea628 100644 --- a/src/meta/test/meta_service_test.cpp +++ b/src/meta/test/meta_service_test.cpp @@ -16,13 +16,12 @@ // under the License. #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include +#include #include #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "meta/meta_rpc_types.h" #include "meta/meta_service.h" #include "meta_admin_types.h" diff --git a/src/meta/test/meta_split_service_test.cpp b/src/meta/test/meta_split_service_test.cpp index ea611c6330..12cd090eb3 100644 --- a/src/meta/test/meta_split_service_test.cpp +++ b/src/meta/test/meta_split_service_test.cpp @@ -26,9 +26,6 @@ #include #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -48,6 +45,7 @@ #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_data.h" #include "meta/meta_rpc_types.h" #include "meta/meta_server_failure_detector.h" diff --git a/src/meta/test/meta_state/meta_state_service.cpp b/src/meta/test/meta_state/meta_state_service.cpp index 2bc59246dc..05c1ade6a9 100644 --- a/src/meta/test/meta_state/meta_state_service.cpp +++ b/src/meta/test/meta_state/meta_state_service.cpp @@ -27,14 +27,10 @@ #include "meta/meta_state_service.h" #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include "gtest/gtest.h" #include "meta/meta_state_service_simple.h" #include "meta/meta_state_service_zookeeper.h" #include "runtime/service_app.h" diff --git a/src/meta/test/meta_state_service_utils_test.cpp b/src/meta/test/meta_state_service_utils_test.cpp index f6ea0388a7..fa4cf3deea 100644 --- a/src/meta/test/meta_state_service_utils_test.cpp +++ b/src/meta/test/meta_state_service_utils_test.cpp @@ -25,14 +25,12 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include +#include "gtest/gtest.h" #include "meta/meta_state_service.h" #include "meta/meta_state_service_utils.h" #include "runtime/task/task_tracker.h" diff --git a/src/meta/test/meta_test_base.cpp b/src/meta/test/meta_test_base.cpp index 65da209291..d05d8a1452 100644 --- a/src/meta/test/meta_test_base.cpp +++ b/src/meta/test/meta_test_base.cpp @@ -17,18 +17,15 @@ #include "meta_test_base.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include -#include #include #include #include #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "meta/meta_bulk_load_service.h" #include "meta/meta_data.h" #include "meta/meta_options.h" diff --git a/src/meta/test/server_state_restore_test.cpp b/src/meta/test/server_state_restore_test.cpp index 96e8de65e5..6c997b69d0 100644 --- a/src/meta/test/server_state_restore_test.cpp +++ b/src/meta/test/server_state_restore_test.cpp @@ -15,9 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -29,6 +26,7 @@ #include "common/backup_common.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_backup_service.h" #include "meta/meta_data.h" #include "meta/meta_rpc_types.h" diff --git a/src/meta/test/server_state_test.cpp b/src/meta/test/server_state_test.cpp index 9c7e959626..25f5ac2ad7 100644 --- a/src/meta/test/server_state_test.cpp +++ b/src/meta/test/server_state_test.cpp @@ -24,9 +24,6 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -37,6 +34,7 @@ #include "common/replication.codes.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_data.h" #include "meta/meta_rpc_types.h" #include "meta/meta_service.h" diff --git a/src/meta/test/state_sync_test.cpp b/src/meta/test/state_sync_test.cpp index 2e1afacf8f..eb3d7598ff 100644 --- a/src/meta/test/state_sync_test.cpp +++ b/src/meta/test/state_sync_test.cpp @@ -25,9 +25,6 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include // IWYU pragma: keep @@ -41,6 +38,7 @@ #include "common/gpid.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_data.h" #include "meta/meta_service.h" #include "meta/meta_state_service.h" diff --git a/src/meta/test/update_configuration_test.cpp b/src/meta/test/update_configuration_test.cpp index 4feba0923c..ab0c621c66 100644 --- a/src/meta/test/update_configuration_test.cpp +++ b/src/meta/test/update_configuration_test.cpp @@ -24,10 +24,7 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include #include #include #include @@ -45,6 +42,7 @@ #include "common/replication_other_types.h" #include "dsn.layer2_types.h" #include "dummy_balancer.h" +#include "gtest/gtest.h" #include "meta/greedy_load_balancer.h" #include "meta/meta_data.h" #include "meta/meta_options.h" diff --git a/src/nfs/test/main.cpp b/src/nfs/test/main.cpp index 60564bf6b7..49ededed03 100644 --- a/src/nfs/test/main.cpp +++ b/src/nfs/test/main.cpp @@ -24,10 +24,6 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -39,6 +35,7 @@ #include "aio/aio_task.h" #include "common/gpid.h" +#include "gtest/gtest.h" #include "nfs/nfs_node.h" #include "runtime/app_model.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/perf_counter/perf_counter_atomic.cpp b/src/perf_counter/perf_counter_atomic.cpp index 90f08d3f6a..0f88ccd476 100644 --- a/src/perf_counter/perf_counter_atomic.cpp +++ b/src/perf_counter/perf_counter_atomic.cpp @@ -17,6 +17,7 @@ #include "perf_counter/perf_counter_atomic.h" +#include #include #include #include diff --git a/src/perf_counter/test/perf_counter_test.cpp b/src/perf_counter/test/perf_counter_test.cpp index 0758ef8071..85fd1dfcd1 100644 --- a/src/perf_counter/test/perf_counter_test.cpp +++ b/src/perf_counter/test/perf_counter_test.cpp @@ -33,18 +33,15 @@ * xxxx-xx-xx, author, fix bug about xxx */ -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include #include -#include #include #include #include #include #include +#include "gtest/gtest.h" #include "perf_counter/perf_counter.h" #include "perf_counter/perf_counter_atomic.h" #include "utils/autoref_ptr.h" diff --git a/src/perf_counter/test/perf_counters_test.cpp b/src/perf_counter/test/perf_counters_test.cpp index eb495ee554..4dfcd008ef 100644 --- a/src/perf_counter/test/perf_counters_test.cpp +++ b/src/perf_counter/test/perf_counters_test.cpp @@ -35,13 +35,11 @@ #include "perf_counter/perf_counters.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include "common/json_helper.h" +#include "gtest/gtest.h" #include "perf_counter/perf_counter.h" #include "perf_counter/perf_counter_utils.h" #include "perf_counter/perf_counter_wrapper.h" diff --git a/src/redis_protocol/proxy_ut/redis_proxy_test.cpp b/src/redis_protocol/proxy_ut/redis_proxy_test.cpp index 400c41b4ce..3436cc324e 100644 --- a/src/redis_protocol/proxy_ut/redis_proxy_test.cpp +++ b/src/redis_protocol/proxy_ut/redis_proxy_test.cpp @@ -31,9 +31,6 @@ // IWYU pragma: no_include // IWYU pragma: no_include #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -46,6 +43,7 @@ #include #include "geo/lib/geo_client.h" +#include "gtest/gtest.h" #include "proxy_layer.h" #include "redis_parser.h" #include "runtime/app_model.h" diff --git a/src/replica/backup/test/replica_backup_manager_test.cpp b/src/replica/backup/test/replica_backup_manager_test.cpp index ec3fb957f3..467ad9507e 100644 --- a/src/replica/backup/test/replica_backup_manager_test.cpp +++ b/src/replica/backup/test/replica_backup_manager_test.cpp @@ -15,13 +15,10 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include "gtest/gtest.h" #include "replica/backup/replica_backup_manager.h" #include "replica/replication_app_base.h" #include "replica/test/mock_utils.h" diff --git a/src/replica/bulk_load/test/replica_bulk_loader_test.cpp b/src/replica/bulk_load/test/replica_bulk_loader_test.cpp index 3a27ee3ba1..59a00cd28b 100644 --- a/src/replica/bulk_load/test/replica_bulk_loader_test.cpp +++ b/src/replica/bulk_load/test/replica_bulk_loader_test.cpp @@ -18,10 +18,6 @@ #include "replica/bulk_load/replica_bulk_loader.h" #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -33,6 +29,7 @@ #include "common/gpid.h" #include "common/json_helper.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "replica/test/mock_utils.h" #include "replica/test/replica_test_base.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/replica/duplication/test/dup_replica_http_service_test.cpp b/src/replica/duplication/test/dup_replica_http_service_test.cpp index 80b2fb87c3..70b123e328 100644 --- a/src/replica/duplication/test/dup_replica_http_service_test.cpp +++ b/src/replica/duplication/test/dup_replica_http_service_test.cpp @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -28,6 +24,7 @@ #include "common/gpid.h" #include "duplication_test_base.h" #include "duplication_types.h" +#include "gtest/gtest.h" #include "http/http_server.h" #include "replica/duplication/replica_duplicator.h" #include "replica/replica_http_service.h" diff --git a/src/replica/duplication/test/duplication_sync_timer_test.cpp b/src/replica/duplication/test/duplication_sync_timer_test.cpp index c680ddcbea..28df542370 100644 --- a/src/replica/duplication/test/duplication_sync_timer_test.cpp +++ b/src/replica/duplication/test/duplication_sync_timer_test.cpp @@ -17,20 +17,16 @@ #include "replica/duplication/duplication_sync_timer.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include -#include #include #include #include "common/duplication_common.h" #include "common/replication.codes.h" #include "duplication_test_base.h" +#include "gtest/gtest.h" #include "replica/duplication/replica_duplicator.h" #include "replica/duplication/replica_duplicator_manager.h" #include "replica/test/mock_utils.h" diff --git a/src/replica/duplication/test/load_from_private_log_test.cpp b/src/replica/duplication/test/load_from_private_log_test.cpp index e44bb74a3d..e557899292 100644 --- a/src/replica/duplication/test/load_from_private_log_test.cpp +++ b/src/replica/duplication/test/load_from_private_log_test.cpp @@ -17,11 +17,6 @@ // IWYU pragma: no_include #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -33,6 +28,7 @@ #include "common/replication_other_types.h" #include "consensus_types.h" #include "duplication_types.h" +#include "gtest/gtest.h" #include "perf_counter/perf_counter.h" #include "perf_counter/perf_counter_wrapper.h" #include "replica/duplication/mutation_duplicator.h" diff --git a/src/replica/duplication/test/mutation_batch_test.cpp b/src/replica/duplication/test/mutation_batch_test.cpp index a41aa8ab8d..95068ba45d 100644 --- a/src/replica/duplication/test/mutation_batch_test.cpp +++ b/src/replica/duplication/test/mutation_batch_test.cpp @@ -15,20 +15,18 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include +#include #include #include #include "common/replication_other_types.h" #include "consensus_types.h" #include "duplication_test_base.h" +#include "gtest/gtest.h" #include "replica/duplication/mutation_batch.h" #include "replica/duplication/mutation_duplicator.h" #include "replica/mutation.h" diff --git a/src/replica/duplication/test/replica_duplicator_manager_test.cpp b/src/replica/duplication/test/replica_duplicator_manager_test.cpp index 93aed6dd8b..31dbacc67c 100644 --- a/src/replica/duplication/test/replica_duplicator_manager_test.cpp +++ b/src/replica/duplication/test/replica_duplicator_manager_test.cpp @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -31,6 +27,7 @@ #include "common/replication_other_types.h" #include "duplication_test_base.h" #include "duplication_types.h" +#include "gtest/gtest.h" #include "replica/duplication/replica_duplicator.h" #include "replica/duplication/replica_duplicator_manager.h" #include "replica/test/mock_utils.h" diff --git a/src/replica/duplication/test/replica_duplicator_test.cpp b/src/replica/duplication/test/replica_duplicator_test.cpp index 87fcd374b9..3c3847a62d 100644 --- a/src/replica/duplication/test/replica_duplicator_test.cpp +++ b/src/replica/duplication/test/replica_duplicator_test.cpp @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -29,6 +25,7 @@ #include "common/replication_other_types.h" #include "duplication_test_base.h" #include "duplication_types.h" +#include "gtest/gtest.h" #include "metadata_types.h" #include "replica/duplication/duplication_pipeline.h" #include "replica/duplication/mutation_duplicator.h" diff --git a/src/replica/duplication/test/replica_follower_test.cpp b/src/replica/duplication/test/replica_follower_test.cpp index a961c36048..eb4b1e4aa4 100644 --- a/src/replica/duplication/test/replica_follower_test.cpp +++ b/src/replica/duplication/test/replica_follower_test.cpp @@ -15,11 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include #include #include #include @@ -31,6 +26,7 @@ #include "consensus_types.h" #include "dsn.layer2_types.h" #include "duplication_test_base.h" +#include "gtest/gtest.h" #include "metadata_types.h" #include "nfs/nfs_node.h" #include "replica/duplication/replica_follower.h" diff --git a/src/replica/duplication/test/ship_mutation_test.cpp b/src/replica/duplication/test/ship_mutation_test.cpp index 29e17f2a8a..dc04b25fe8 100644 --- a/src/replica/duplication/test/ship_mutation_test.cpp +++ b/src/replica/duplication/test/ship_mutation_test.cpp @@ -15,19 +15,16 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include #include #include #include +#include #include #include #include "common/replication.codes.h" #include "duplication_test_base.h" +#include "gtest/gtest.h" #include "replica/duplication/duplication_pipeline.h" #include "replica/duplication/mutation_batch.h" #include "replica/duplication/mutation_duplicator.h" diff --git a/src/replica/split/test/replica_split_test.cpp b/src/replica/split/test/replica_split_test.cpp index c0edc3a013..2e5ebe5e29 100644 --- a/src/replica/split/test/replica_split_test.cpp +++ b/src/replica/split/test/replica_split_test.cpp @@ -15,12 +15,7 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include -#include #include #include #include @@ -34,6 +29,7 @@ #include "common/replication_other_types.h" #include "consensus_types.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "metadata_types.h" #include "partition_split_types.h" #include "replica/mutation.h" diff --git a/src/replica/test/cold_backup_context_test.cpp b/src/replica/test/cold_backup_context_test.cpp index 8419959c6c..529ac0a09c 100644 --- a/src/replica/test/cold_backup_context_test.cpp +++ b/src/replica/test/cold_backup_context_test.cpp @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include #include #include #include @@ -36,6 +32,7 @@ #include "common/backup_common.h" #include "common/gpid.h" #include "common/json_helper.h" +#include "gtest/gtest.h" #include "metadata_types.h" #include "replica/backup/cold_backup_context.h" #include "replica/replica.h" diff --git a/src/replica/test/log_block_test.cpp b/src/replica/test/log_block_test.cpp index ada8829e0b..a8d8b2d230 100644 --- a/src/replica/test/log_block_test.cpp +++ b/src/replica/test/log_block_test.cpp @@ -15,16 +15,13 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include "consensus_types.h" +#include "gtest/gtest.h" #include "replica/log_block.h" #include "replica/mutation.h" #include "replica_test_base.h" diff --git a/src/replica/test/log_file_test.cpp b/src/replica/test/log_file_test.cpp index e0736f15cc..2827e6395c 100644 --- a/src/replica/test/log_file_test.cpp +++ b/src/replica/test/log_file_test.cpp @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -26,6 +22,7 @@ #include "aio/aio_task.h" #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "replica/log_block.h" #include "replica/log_file.h" #include "replica_test_base.h" diff --git a/src/replica/test/main.cpp b/src/replica/test/main.cpp index 6e414ffddf..a7ad63967b 100644 --- a/src/replica/test/main.cpp +++ b/src/replica/test/main.cpp @@ -15,13 +15,12 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -#include #include #include #include #include +#include "gtest/gtest.h" #include "replication_service_test_app.h" #include "runtime/app_model.h" #include "runtime/service_app.h" diff --git a/src/replica/test/mutation_log_learn_test.cpp b/src/replica/test/mutation_log_learn_test.cpp index b14701b443..f5946b53e9 100644 --- a/src/replica/test/mutation_log_learn_test.cpp +++ b/src/replica/test/mutation_log_learn_test.cpp @@ -24,12 +24,7 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include -#include #include #include #include @@ -41,6 +36,7 @@ #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "consensus_types.h" +#include "gtest/gtest.h" #include "replica/mutation.h" #include "replica/mutation_log.h" #include "replica/test/mock_utils.h" diff --git a/src/replica/test/mutation_log_test.cpp b/src/replica/test/mutation_log_test.cpp index 1cdaec67f1..e3ff26a8b9 100644 --- a/src/replica/test/mutation_log_test.cpp +++ b/src/replica/test/mutation_log_test.cpp @@ -26,15 +26,12 @@ #include "replica/mutation_log.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include #include #include #include #include +#include #include #include "aio/aio_task.h" @@ -42,6 +39,7 @@ #include "backup_types.h" #include "common/replication.codes.h" #include "consensus_types.h" +#include "gtest/gtest.h" #include "replica/log_block.h" #include "replica/log_file.h" #include "replica/mutation.h" diff --git a/src/replica/test/open_replica_test.cpp b/src/replica/test/open_replica_test.cpp index 1fa4ebe6fc..0cc7d5cd7a 100644 --- a/src/replica/test/open_replica_test.cpp +++ b/src/replica/test/open_replica_test.cpp @@ -15,11 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -28,6 +23,7 @@ #include "common/gpid.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "meta/meta_data.h" #include "meta_admin_types.h" #include "mock_utils.h" diff --git a/src/replica/test/replica_disk_migrate_test.cpp b/src/replica/test/replica_disk_migrate_test.cpp index 376f2d71a2..f730b2fd1e 100644 --- a/src/replica/test/replica_disk_migrate_test.cpp +++ b/src/replica/test/replica_disk_migrate_test.cpp @@ -18,10 +18,6 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -34,6 +30,7 @@ #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "metadata_types.h" #include "replica/replica.h" #include "replica/replica_disk_migrator.h" diff --git a/src/replica/test/replica_disk_test.cpp b/src/replica/test/replica_disk_test.cpp index 6717ffd402..5866da6ab7 100644 --- a/src/replica/test/replica_disk_test.cpp +++ b/src/replica/test/replica_disk_test.cpp @@ -18,10 +18,6 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -36,6 +32,7 @@ #include "common/gpid.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "metadata_types.h" #include "replica/disk_cleaner.h" #include "replica/replica.h" diff --git a/src/replica/test/replica_http_service_test.cpp b/src/replica/test/replica_http_service_test.cpp index fbb36d285e..d4b49667fa 100644 --- a/src/replica/test/replica_http_service_test.cpp +++ b/src/replica/test/replica_http_service_test.cpp @@ -16,16 +16,13 @@ // under the License. #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include +#include "gtest/gtest.h" #include "http/builtin_http_calls.h" #include "http/http_call_registry.h" #include "http/http_server.h" diff --git a/src/replica/test/replica_learn_test.cpp b/src/replica/test/replica_learn_test.cpp index 8cf8e5b662..b926fa4a82 100644 --- a/src/replica/test/replica_learn_test.cpp +++ b/src/replica/test/replica_learn_test.cpp @@ -15,12 +15,7 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include -#include #include #include @@ -29,6 +24,7 @@ #include "common/replication_other_types.h" #include "consensus_types.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "mock_utils.h" #include "replica/duplication/test/duplication_test_base.h" #include "replica/prepare_list.h" diff --git a/src/replica/test/replica_test.cpp b/src/replica/test/replica_test.cpp index 9b7aea83b4..1da5b0060a 100644 --- a/src/replica/test/replica_test.cpp +++ b/src/replica/test/replica_test.cpp @@ -15,11 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -42,6 +37,8 @@ #include "common/replication_other_types.h" #include "consensus_types.h" #include "dsn.layer2_types.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" #include "http/http_server.h" #include "metadata_types.h" #include "perf_counter/perf_counter.h" diff --git a/src/replica/test/throttling_controller_test.cpp b/src/replica/test/throttling_controller_test.cpp index d3cd155faf..1a17df8666 100644 --- a/src/replica/test/throttling_controller_test.cpp +++ b/src/replica/test/throttling_controller_test.cpp @@ -17,9 +17,7 @@ #include "utils/throttling_controller.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include "gtest/gtest.h" namespace dsn { namespace replication { diff --git a/src/runtime/rpc/asio_net_provider.cpp b/src/runtime/rpc/asio_net_provider.cpp index 95569b2045..f06166d5ec 100644 --- a/src/runtime/rpc/asio_net_provider.cpp +++ b/src/runtime/rpc/asio_net_provider.cpp @@ -27,6 +27,24 @@ #include "asio_net_provider.h" #include // IWYU pragma: keep +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/runtime/rpc/asio_rpc_session.cpp b/src/runtime/rpc/asio_rpc_session.cpp index 5006a257f3..39ac3e6c04 100644 --- a/src/runtime/rpc/asio_rpc_session.cpp +++ b/src/runtime/rpc/asio_rpc_session.cpp @@ -27,6 +27,19 @@ #include "asio_rpc_session.h" #include // IWYU pragma: keep +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: no_include #include #include diff --git a/src/runtime/task/hpc_task_queue.cpp b/src/runtime/task/hpc_task_queue.cpp index d331810440..8af5103ca6 100644 --- a/src/runtime/task/hpc_task_queue.cpp +++ b/src/runtime/task/hpc_task_queue.cpp @@ -26,6 +26,8 @@ #include "hpc_task_queue.h" +#include + #include "boost/iterator/function_output_iterator.hpp" #include "concurrentqueue/concurrentqueue.h" #include "runtime/task/task.h" diff --git a/src/runtime/task/simple_task_queue.cpp b/src/runtime/task/simple_task_queue.cpp index 44f8de9a00..879a9700c6 100644 --- a/src/runtime/task/simple_task_queue.cpp +++ b/src/runtime/task/simple_task_queue.cpp @@ -26,6 +26,7 @@ #include "simple_task_queue.h" +#include #include #include #include diff --git a/src/runtime/test/address_test.cpp b/src/runtime/test/address_test.cpp index 500a65d66a..838a747919 100644 --- a/src/runtime/test/address_test.cpp +++ b/src/runtime/test/address_test.cpp @@ -24,14 +24,12 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include +#include "gtest/gtest.h" #include "runtime/rpc/group_address.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/runtime/test/async_call.cpp b/src/runtime/test/async_call.cpp index a76471b1c0..7c96ee3776 100644 --- a/src/runtime/test/async_call.cpp +++ b/src/runtime/test/async_call.cpp @@ -34,10 +34,6 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include #include #include #include @@ -47,6 +43,7 @@ #include #include +#include "gtest/gtest.h" #include "runtime/api_task.h" #include "runtime/rpc/rpc_address.h" #include "runtime/rpc/rpc_message.h" diff --git a/src/runtime/test/client_negotiation_test.cpp b/src/runtime/test/client_negotiation_test.cpp index 74dab238ac..a60832ef78 100644 --- a/src/runtime/test/client_negotiation_test.cpp +++ b/src/runtime/test/client_negotiation_test.cpp @@ -15,13 +15,11 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include +#include "gtest/gtest.h" #include "runtime/rpc/network.sim.h" #include "runtime/rpc/rpc_address.h" #include "runtime/rpc/rpc_holder.h" diff --git a/src/runtime/test/corrupt_message.cpp b/src/runtime/test/corrupt_message.cpp index efc092b80d..88a07cfc68 100644 --- a/src/runtime/test/corrupt_message.cpp +++ b/src/runtime/test/corrupt_message.cpp @@ -25,11 +25,11 @@ */ // IWYU pragma: no_include // IWYU pragma: no_include -#include #include #include #include +#include "gtest/gtest.h" #include "runtime/rpc/rpc_address.h" #include "runtime/task/async_calls.h" #include "test_utils.h" diff --git a/src/runtime/test/host_port_test.cpp b/src/runtime/test/host_port_test.cpp index 6294380621..728bef6539 100644 --- a/src/runtime/test/host_port_test.cpp +++ b/src/runtime/test/host_port_test.cpp @@ -17,14 +17,12 @@ * under the License. */ -#include -#include -#include #include #include #include #include +#include "gtest/gtest.h" #include "runtime/rpc/dns_resolver.h" #include "runtime/rpc/group_address.h" #include "runtime/rpc/group_host_port.h" diff --git a/src/runtime/test/lpc.cpp b/src/runtime/test/lpc.cpp index 6787b626c2..bcbc10281c 100644 --- a/src/runtime/test/lpc.cpp +++ b/src/runtime/test/lpc.cpp @@ -33,12 +33,10 @@ * xxxx-xx-xx, author, fix bug about xxx */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include "gtest/gtest.h" #include "runtime/api_task.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/runtime/test/message_reader_test.cpp b/src/runtime/test/message_reader_test.cpp index 3fb033dc97..515dcf8370 100644 --- a/src/runtime/test/message_reader_test.cpp +++ b/src/runtime/test/message_reader_test.cpp @@ -15,12 +15,10 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include "gtest/gtest.h" #include "runtime/rpc/message_parser.h" #include "utils/blob.h" diff --git a/src/runtime/test/message_utils_test.cpp b/src/runtime/test/message_utils_test.cpp index dbf9ad3ea7..7d280db8b6 100644 --- a/src/runtime/test/message_utils_test.cpp +++ b/src/runtime/test/message_utils_test.cpp @@ -26,14 +26,12 @@ #include "runtime/message_utils.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include "common/replication.codes.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "runtime/rpc/rpc_holder.h" #include "runtime/rpc/rpc_message.h" #include "utils/autoref_ptr.h" diff --git a/src/runtime/test/meta_access_controller_test.cpp b/src/runtime/test/meta_access_controller_test.cpp index 822c5a0511..bdec097b82 100644 --- a/src/runtime/test/meta_access_controller_test.cpp +++ b/src/runtime/test/meta_access_controller_test.cpp @@ -15,14 +15,12 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "runtime/rpc/network.h" #include "runtime/rpc/network.sim.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/runtime/test/negotiation_manager_test.cpp b/src/runtime/test/negotiation_manager_test.cpp index 6744ebfe95..401f63b573 100644 --- a/src/runtime/test/negotiation_manager_test.cpp +++ b/src/runtime/test/negotiation_manager_test.cpp @@ -17,11 +17,8 @@ #include "runtime/security/negotiation_manager.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include - #include "failure_detector/fd.code.definition.h" +#include "gtest/gtest.h" #include "http/http_server.h" #include "nfs/nfs_code_definition.h" #include "runtime/rpc/network.h" diff --git a/src/runtime/test/netprovider.cpp b/src/runtime/test/netprovider.cpp index 54a5147062..b6ab3932be 100644 --- a/src/runtime/test/netprovider.cpp +++ b/src/runtime/test/netprovider.cpp @@ -33,9 +33,6 @@ * xxxx-xx-xx, author, fix bug about xxx */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -43,6 +40,7 @@ #include #include +#include "gtest/gtest.h" #include "runtime/api_layer1.h" #include "runtime/api_task.h" #include "runtime/global_config.h" diff --git a/src/runtime/test/pipeline_test.cpp b/src/runtime/test/pipeline_test.cpp index bdc1e5a868..444c7f2684 100644 --- a/src/runtime/test/pipeline_test.cpp +++ b/src/runtime/test/pipeline_test.cpp @@ -24,13 +24,11 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include +#include #include #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "runtime/pipeline.h" #include "runtime/task/task_tracker.h" #include "utils/chrono_literals.h" diff --git a/src/runtime/test/ranger_resource_policy_manager_test.cpp b/src/runtime/test/ranger_resource_policy_manager_test.cpp index 1971810c99..c17c51dfc9 100644 --- a/src/runtime/test/ranger_resource_policy_manager_test.cpp +++ b/src/runtime/test/ranger_resource_policy_manager_test.cpp @@ -16,9 +16,6 @@ // under the License. #include -#include -#include -#include #include #include #include @@ -29,6 +26,7 @@ #include #include "common/json_helper.h" +#include "gtest/gtest.h" #include "runtime/ranger/access_type.h" #include "runtime/ranger/ranger_resource_policy.h" #include "runtime/ranger/ranger_resource_policy_manager.h" diff --git a/src/runtime/test/ranger_resource_policy_test.cpp b/src/runtime/test/ranger_resource_policy_test.cpp index fcb9248030..a9025d9bb5 100644 --- a/src/runtime/test/ranger_resource_policy_test.cpp +++ b/src/runtime/test/ranger_resource_policy_test.cpp @@ -16,13 +16,10 @@ // under the License. #include -#include -#include -#include -#include #include #include +#include "gtest/gtest.h" #include "runtime/ranger/access_type.h" #include "runtime/ranger/ranger_resource_policy.h" diff --git a/src/runtime/test/replica_access_controller_test.cpp b/src/runtime/test/replica_access_controller_test.cpp index 539bc3cf72..d801d77558 100644 --- a/src/runtime/test/replica_access_controller_test.cpp +++ b/src/runtime/test/replica_access_controller_test.cpp @@ -15,15 +15,13 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "runtime/ranger/access_type.h" #include "runtime/rpc/network.h" #include "runtime/rpc/network.sim.h" diff --git a/src/runtime/test/rpc.cpp b/src/runtime/test/rpc.cpp index dd67bef01d..0acebc16fe 100644 --- a/src/runtime/test/rpc.cpp +++ b/src/runtime/test/rpc.cpp @@ -26,9 +26,6 @@ #include #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -37,6 +34,7 @@ #include #include +#include "gtest/gtest.h" #include "runtime/rpc/group_address.h" #include "runtime/rpc/rpc_address.h" #include "runtime/rpc/rpc_message.h" diff --git a/src/runtime/test/rpc_holder_test.cpp b/src/runtime/test/rpc_holder_test.cpp index 7783b08341..8d1b838d85 100644 --- a/src/runtime/test/rpc_holder_test.cpp +++ b/src/runtime/test/rpc_holder_test.cpp @@ -27,13 +27,11 @@ #include "runtime/rpc/rpc_holder.h" #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include "common/gpid.h" #include "common/serialization_helper/dsn.layer2_types.h" +#include "gtest/gtest.h" #include "runtime/message_utils.h" #include "runtime/rpc/rpc_address.h" #include "utils/threadpool_code.h" diff --git a/src/runtime/test/rpc_message.cpp b/src/runtime/test/rpc_message.cpp index cd6c1693e9..22f87275b0 100644 --- a/src/runtime/test/rpc_message.cpp +++ b/src/runtime/test/rpc_message.cpp @@ -33,9 +33,6 @@ * xxxx-xx-xx, author, fix bug about xxx */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -44,6 +41,7 @@ #include "common/gpid.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "runtime/message_utils.cpp" #include "runtime/message_utils.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/runtime/test/server_negotiation_test.cpp b/src/runtime/test/server_negotiation_test.cpp index 0ed7471642..fce5fdfd82 100644 --- a/src/runtime/test/server_negotiation_test.cpp +++ b/src/runtime/test/server_negotiation_test.cpp @@ -17,12 +17,10 @@ #include "runtime/security/server_negotiation.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include "gtest/gtest.h" #include "runtime/rpc/network.sim.h" #include "runtime/rpc/rpc_address.h" #include "runtime/rpc/rpc_holder.h" diff --git a/src/runtime/test/service_api_c.cpp b/src/runtime/test/service_api_c.cpp index c90e34b374..77c1db85c2 100644 --- a/src/runtime/test/service_api_c.cpp +++ b/src/runtime/test/service_api_c.cpp @@ -33,9 +33,6 @@ * xxxx-xx-xx, author, fix bug about xxx */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -43,6 +40,7 @@ #include #include +#include "gtest/gtest.h" #include "runtime/api_layer1.h" #include "runtime/global_config.h" #include "runtime/service_app.h" diff --git a/src/runtime/test/sim_lock.cpp b/src/runtime/test/sim_lock.cpp index 82f7cd5d1b..772548a800 100644 --- a/src/runtime/test/sim_lock.cpp +++ b/src/runtime/test/sim_lock.cpp @@ -33,12 +33,10 @@ * xxxx-xx-xx, author, fix bug about xxx */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include "gtest/gtest.h" #include "runtime/global_config.h" #include "runtime/scheduler.h" #include "runtime/service_engine.h" diff --git a/src/runtime/test/task_engine.cpp b/src/runtime/test/task_engine.cpp index 6e4022d311..9e9c033ae4 100644 --- a/src/runtime/test/task_engine.cpp +++ b/src/runtime/test/task_engine.cpp @@ -35,11 +35,9 @@ #include "runtime/task/task_engine.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include +#include "gtest/gtest.h" #include "runtime/global_config.h" #include "runtime/service_engine.h" #include "runtime/task/task.h" diff --git a/src/runtime/test/task_test.cpp b/src/runtime/test/task_test.cpp index 1ef5516a14..6052bdec7d 100644 --- a/src/runtime/test/task_test.cpp +++ b/src/runtime/test/task_test.cpp @@ -17,12 +17,11 @@ #include "runtime/task/task.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include #include "aio/aio_task.h" #include "aio/file_io.h" +#include "gtest/gtest.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" #include "utils/flags.h" diff --git a/src/runtime/test/thrift_message_parser_test.cpp b/src/runtime/test/thrift_message_parser_test.cpp index f8e92f2c39..722b2860b6 100644 --- a/src/runtime/test/thrift_message_parser_test.cpp +++ b/src/runtime/test/thrift_message_parser_test.cpp @@ -16,9 +16,6 @@ // under the License. #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -29,6 +26,7 @@ #include "common/gpid.h" #include "common/serialization_helper/thrift_helper.h" +#include "gtest/gtest.h" #include "request_meta_types.h" #include "runtime/rpc/message_parser.h" #include "runtime/rpc/rpc_message.h" diff --git a/src/server/test/capacity_unit_calculator_test.cpp b/src/server/test/capacity_unit_calculator_test.cpp index 98c6825977..d33535cf43 100644 --- a/src/server/test/capacity_unit_calculator_test.cpp +++ b/src/server/test/capacity_unit_calculator_test.cpp @@ -18,19 +18,15 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include -#include #include #include #include #include #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "pegasus_key_schema.h" #include "pegasus_server_test_base.h" #include "replica_admin_types.h" diff --git a/src/server/test/compaction_filter_rule_test.cpp b/src/server/test/compaction_filter_rule_test.cpp index ee2b5d6df8..d793ae2b1d 100644 --- a/src/server/test/compaction_filter_rule_test.cpp +++ b/src/server/test/compaction_filter_rule_test.cpp @@ -17,15 +17,13 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include "base/pegasus_utils.h" #include "base/pegasus_value_schema.h" +#include "gtest/gtest.h" #include "server/compaction_filter_rule.h" namespace pegasus { diff --git a/src/server/test/compaction_operation_test.cpp b/src/server/test/compaction_operation_test.cpp index cd6fdc95e3..a241c44a15 100644 --- a/src/server/test/compaction_operation_test.cpp +++ b/src/server/test/compaction_operation_test.cpp @@ -17,9 +17,6 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -29,6 +26,7 @@ #include "base/pegasus_utils.h" #include "base/pegasus_value_schema.h" +#include "gtest/gtest.h" #include "server/compaction_filter_rule.h" #include "server/compaction_operation.h" diff --git a/src/server/test/hashkey_transform_test.cpp b/src/server/test/hashkey_transform_test.cpp index 52f4d5a6be..786e09ba79 100644 --- a/src/server/test/hashkey_transform_test.cpp +++ b/src/server/test/hashkey_transform_test.cpp @@ -20,13 +20,11 @@ #include "server/hashkey_transform.h" #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include "base/pegasus_key_schema.h" +#include "gtest/gtest.h" #include "utils/blob.h" // User define SliceTransform must obey the 4 rules of ColumnFamilyOptions.prefix_extractor: diff --git a/src/server/test/hotkey_collector_test.cpp b/src/server/test/hotkey_collector_test.cpp index 9553123b49..1316dad7ad 100644 --- a/src/server/test/hotkey_collector_test.cpp +++ b/src/server/test/hotkey_collector_test.cpp @@ -18,16 +18,13 @@ #include "server/hotkey_collector.h" #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include "base/pegasus_key_schema.h" #include "common/gpid.h" #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "pegasus_server_test_base.h" #include "rrdb/rrdb.code.definition.h" #include "rrdb/rrdb_types.h" diff --git a/src/server/test/hotspot_partition_test.cpp b/src/server/test/hotspot_partition_test.cpp index 97f4252bc7..40f20e6380 100644 --- a/src/server/test/hotspot_partition_test.cpp +++ b/src/server/test/hotspot_partition_test.cpp @@ -15,18 +15,14 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include +#include #include #include #include #include #include +#include "gtest/gtest.h" #include "pegasus_server_test_base.h" #include "perf_counter/perf_counter.h" #include "perf_counter/perf_counter_wrapper.h" diff --git a/src/server/test/manual_compact_service_test.cpp b/src/server/test/manual_compact_service_test.cpp index ff980dfd62..1cf65a4e9b 100644 --- a/src/server/test/manual_compact_service_test.cpp +++ b/src/server/test/manual_compact_service_test.cpp @@ -17,10 +17,6 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -28,6 +24,7 @@ #include #include +#include "gtest/gtest.h" #include "pegasus_const.h" #include "pegasus_server_test_base.h" #include "runtime/api_layer1.h" diff --git a/src/server/test/pegasus_compression_options_test.cpp b/src/server/test/pegasus_compression_options_test.cpp index 16f9689bdf..bd5ef53c6e 100644 --- a/src/server/test/pegasus_compression_options_test.cpp +++ b/src/server/test/pegasus_compression_options_test.cpp @@ -17,19 +17,15 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include -#include #include #include +#include "gtest/gtest.h" #include "pegasus_server_test_base.h" namespace pegasus { diff --git a/src/server/test/pegasus_mutation_duplicator_test.cpp b/src/server/test/pegasus_mutation_duplicator_test.cpp index 3d143e1893..34062ab0cf 100644 --- a/src/server/test/pegasus_mutation_duplicator_test.cpp +++ b/src/server/test/pegasus_mutation_duplicator_test.cpp @@ -20,13 +20,10 @@ #include "server/pegasus_mutation_duplicator.h" #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include +#include #include #include @@ -36,6 +33,7 @@ #include "common/gpid.h" #include "common/replication.codes.h" #include "duplication_internal_types.h" +#include "gtest/gtest.h" #include "pegasus_key_schema.h" #include "pegasus_server_test_base.h" #include "replica/replica_base.h" diff --git a/src/server/test/pegasus_server_impl_test.cpp b/src/server/test/pegasus_server_impl_test.cpp index 90c2276b60..1113c138da 100644 --- a/src/server/test/pegasus_server_impl_test.cpp +++ b/src/server/test/pegasus_server_impl_test.cpp @@ -19,12 +19,6 @@ #include #include -#include -#include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -34,6 +28,8 @@ #include #include +#include "gmock/gmock.h" +#include "gtest/gtest.h" #include "pegasus_const.h" #include "pegasus_server_test_base.h" #include "perf_counter/perf_counter.h" diff --git a/src/server/test/pegasus_server_write_test.cpp b/src/server/test/pegasus_server_write_test.cpp index d32ef3ff09..415b31aa13 100644 --- a/src/server/test/pegasus_server_write_test.cpp +++ b/src/server/test/pegasus_server_write_test.cpp @@ -18,19 +18,15 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include -#include #include #include #include "base/pegasus_key_schema.h" #include "common/gpid.h" +#include "gtest/gtest.h" #include "message_utils.h" #include "pegasus_rpc_types.h" #include "pegasus_server_test_base.h" diff --git a/src/server/test/pegasus_value_schema_test.cpp b/src/server/test/pegasus_value_schema_test.cpp index b5e539d8c7..77cca238c3 100644 --- a/src/server/test/pegasus_value_schema_test.cpp +++ b/src/server/test/pegasus_value_schema_test.cpp @@ -19,11 +19,10 @@ #include "base/pegasus_value_schema.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include +#include "gtest/gtest.h" + using namespace pegasus; TEST(value_schema, generate_and_extract_v1_v0) diff --git a/src/server/test/pegasus_write_service_impl_test.cpp b/src/server/test/pegasus_write_service_impl_test.cpp index d61ffe64ac..a64e1e9164 100644 --- a/src/server/test/pegasus_write_service_impl_test.cpp +++ b/src/server/test/pegasus_write_service_impl_test.cpp @@ -18,15 +18,13 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include +#include +#include "gtest/gtest.h" #include "pegasus_key_schema.h" #include "pegasus_server_test_base.h" #include "rrdb/rrdb_types.h" diff --git a/src/server/test/pegasus_write_service_test.cpp b/src/server/test/pegasus_write_service_test.cpp index 30f2e7f8ea..8f861f3403 100644 --- a/src/server/test/pegasus_write_service_test.cpp +++ b/src/server/test/pegasus_write_service_test.cpp @@ -18,14 +18,9 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include -#include #include #include #include @@ -34,6 +29,7 @@ #include "base/pegasus_key_schema.h" #include "common/gpid.h" #include "duplication_internal_types.h" +#include "gtest/gtest.h" #include "message_utils.h" #include "pegasus_server_test_base.h" #include "rrdb/rrdb.code.definition.h" diff --git a/src/server/test/rocksdb_wrapper_test.cpp b/src/server/test/rocksdb_wrapper_test.cpp index 372517c8fa..34a9920509 100644 --- a/src/server/test/rocksdb_wrapper_test.cpp +++ b/src/server/test/rocksdb_wrapper_test.cpp @@ -18,10 +18,6 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -29,6 +25,7 @@ #include "common/fs_manager.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "pegasus_key_schema.h" #include "pegasus_server_test_base.h" #include "pegasus_utils.h" diff --git a/src/test/function_test/backup_restore/test_backup_and_restore.cpp b/src/test/function_test/backup_restore/test_backup_and_restore.cpp index 7edadc0212..d5a6cefda4 100644 --- a/src/test/function_test/backup_restore/test_backup_and_restore.cpp +++ b/src/test/function_test/backup_restore/test_backup_and_restore.cpp @@ -15,9 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -30,6 +27,7 @@ #include "client/replication_ddl_client.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "include/pegasus/error.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/test/function_test/base_api/integration_test.cpp b/src/test/function_test/base_api/integration_test.cpp index 2ee44c4826..4229ae58e4 100644 --- a/src/test/function_test/base_api/integration_test.cpp +++ b/src/test/function_test/base_api/integration_test.cpp @@ -18,12 +18,10 @@ */ #include -#include -#include -#include #include #include +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" #include "test/function_test/utils/test_util.h" diff --git a/src/test/function_test/base_api/test_basic.cpp b/src/test/function_test/base_api/test_basic.cpp index 01a3a71032..674a348548 100644 --- a/src/test/function_test/base_api/test_basic.cpp +++ b/src/test/function_test/base_api/test_basic.cpp @@ -17,9 +17,6 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -31,6 +28,7 @@ #include #include +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" #include "test/function_test/utils/test_util.h" diff --git a/src/test/function_test/base_api/test_batch_get.cpp b/src/test/function_test/base_api/test_batch_get.cpp index d0bf4c1e52..69692a89fe 100644 --- a/src/test/function_test/base_api/test_batch_get.cpp +++ b/src/test/function_test/base_api/test_batch_get.cpp @@ -17,15 +17,11 @@ * under the License. */ +#include #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include -#include #include #include #include @@ -35,6 +31,7 @@ #include "base/pegasus_const.h" #include "base/pegasus_key_schema.h" #include "client/partition_resolver.h" +#include "gtest/gtest.h" #include "include/rrdb/rrdb.client.h" #include "test/function_test/utils/test_util.h" #include "utils/blob.h" diff --git a/src/test/function_test/base_api/test_check_and_mutate.cpp b/src/test/function_test/base_api/test_check_and_mutate.cpp index 43f0b1d042..8887237e23 100644 --- a/src/test/function_test/base_api/test_check_and_mutate.cpp +++ b/src/test/function_test/base_api/test_check_and_mutate.cpp @@ -17,12 +17,10 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" #include "test/function_test/utils/test_util.h" diff --git a/src/test/function_test/base_api/test_check_and_set.cpp b/src/test/function_test/base_api/test_check_and_set.cpp index 310d71642e..dc4cc78f04 100644 --- a/src/test/function_test/base_api/test_check_and_set.cpp +++ b/src/test/function_test/base_api/test_check_and_set.cpp @@ -17,11 +17,9 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" #include "test/function_test/utils/test_util.h" diff --git a/src/test/function_test/base_api/test_copy.cpp b/src/test/function_test/base_api/test_copy.cpp index d2155f12f0..d770a4b53c 100644 --- a/src/test/function_test/base_api/test_copy.cpp +++ b/src/test/function_test/base_api/test_copy.cpp @@ -17,24 +17,20 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include -#include #include #include #include #include #include -#include #include #include #include "client/replication_ddl_client.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" #include "runtime/task/async_calls.h" diff --git a/src/test/function_test/base_api/test_incr.cpp b/src/test/function_test/base_api/test_incr.cpp index 9fb2ccdc9d..3040fececa 100644 --- a/src/test/function_test/base_api/test_incr.cpp +++ b/src/test/function_test/base_api/test_incr.cpp @@ -17,14 +17,12 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" #include "test/function_test/utils/test_util.h" diff --git a/src/test/function_test/base_api/test_range_read.cpp b/src/test/function_test/base_api/test_range_read.cpp index 5827d8da83..bdd9021d3a 100644 --- a/src/test/function_test/base_api/test_range_read.cpp +++ b/src/test/function_test/base_api/test_range_read.cpp @@ -17,9 +17,6 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -27,6 +24,7 @@ #include #include +#include "gtest/gtest.h" #include "pegasus/client.h" #include "pegasus/error.h" #include "test/function_test/utils/test_util.h" diff --git a/src/test/function_test/base_api/test_recall.cpp b/src/test/function_test/base_api/test_recall.cpp index 109afb173b..ca55e63efb 100644 --- a/src/test/function_test/base_api/test_recall.cpp +++ b/src/test/function_test/base_api/test_recall.cpp @@ -18,10 +18,7 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include #include #include #include @@ -31,6 +28,7 @@ #include "client/partition_resolver.h" #include "client/replication_ddl_client.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" #include "test/function_test/utils/test_util.h" diff --git a/src/test/function_test/base_api/test_scan.cpp b/src/test/function_test/base_api/test_scan.cpp index ce5e723ac7..2a8add472f 100644 --- a/src/test/function_test/base_api/test_scan.cpp +++ b/src/test/function_test/base_api/test_scan.cpp @@ -17,17 +17,12 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include -#include #include #include #include #include -#include #include #include #include @@ -39,6 +34,7 @@ #include "base/pegasus_const.h" #include "base/pegasus_utils.h" #include "client/replication_ddl_client.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "meta_admin_types.h" #include "pegasus/error.h" diff --git a/src/test/function_test/base_api/test_ttl.cpp b/src/test/function_test/base_api/test_ttl.cpp index 2fe5c0fec7..d97c13e3a6 100644 --- a/src/test/function_test/base_api/test_ttl.cpp +++ b/src/test/function_test/base_api/test_ttl.cpp @@ -17,9 +17,6 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -30,6 +27,7 @@ #include "base/pegasus_const.h" #include "client/replication_ddl_client.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "meta_admin_types.h" #include "pegasus/error.h" diff --git a/src/test/function_test/bulk_load/test_bulk_load.cpp b/src/test/function_test/bulk_load/test_bulk_load.cpp index b4076f60b1..e5457bc1a2 100644 --- a/src/test/function_test/bulk_load/test_bulk_load.cpp +++ b/src/test/function_test/bulk_load/test_bulk_load.cpp @@ -16,9 +16,6 @@ // under the License. #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -40,6 +37,7 @@ #include "client/partition_resolver.h" #include "client/replication_ddl_client.h" #include "common/json_helper.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "include/pegasus/error.h" #include "meta/meta_bulk_load_service.h" diff --git a/src/test/function_test/detect_hotspot/test_detect_hotspot.cpp b/src/test/function_test/detect_hotspot/test_detect_hotspot.cpp index e8fb01fa22..7855133706 100644 --- a/src/test/function_test/detect_hotspot/test_detect_hotspot.cpp +++ b/src/test/function_test/detect_hotspot/test_detect_hotspot.cpp @@ -17,9 +17,6 @@ * under the License. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -29,6 +26,7 @@ #include "client/replication_ddl_client.h" #include "common/gpid.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "include/pegasus/error.h" #include "replica_admin_types.h" diff --git a/src/test/function_test/partition_split/test_split.cpp b/src/test/function_test/partition_split/test_split.cpp index 761b9c8efd..23c7329a5d 100644 --- a/src/test/function_test/partition_split/test_split.cpp +++ b/src/test/function_test/partition_split/test_split.cpp @@ -15,9 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -32,6 +29,7 @@ #include "client/partition_resolver.h" #include "client/replication_ddl_client.h" #include "common/gpid.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "metadata_types.h" #include "partition_split_types.h" diff --git a/src/test/function_test/recovery/test_recovery.cpp b/src/test/function_test/recovery/test_recovery.cpp index d2dab1f82d..7b406254b7 100644 --- a/src/test/function_test/recovery/test_recovery.cpp +++ b/src/test/function_test/recovery/test_recovery.cpp @@ -18,10 +18,6 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include #include #include #include @@ -31,6 +27,7 @@ #include "client/partition_resolver.h" #include "client/replication_ddl_client.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/test/function_test/restore/test_restore.cpp b/src/test/function_test/restore/test_restore.cpp index a94ee7af3b..3ee5003b75 100644 --- a/src/test/function_test/restore/test_restore.cpp +++ b/src/test/function_test/restore/test_restore.cpp @@ -19,9 +19,6 @@ #include #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -38,6 +35,7 @@ #include "common/gpid.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" #include "runtime/api_layer1.h" diff --git a/src/test/function_test/throttle/test_throttle.cpp b/src/test/function_test/throttle/test_throttle.cpp index 23583a7bfe..e30ef726a5 100644 --- a/src/test/function_test/throttle/test_throttle.cpp +++ b/src/test/function_test/throttle/test_throttle.cpp @@ -18,12 +18,8 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include -#include #include #include #include @@ -35,6 +31,7 @@ #include "client/partition_resolver.h" #include "client/replication_ddl_client.h" #include "common/gpid.h" +#include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" #include "runtime/api_layer1.h" diff --git a/src/test/function_test/utils/global_env.cpp b/src/test/function_test/utils/global_env.cpp index efeea9691b..7f7e64b9ac 100644 --- a/src/test/function_test/utils/global_env.cpp +++ b/src/test/function_test/utils/global_env.cpp @@ -20,7 +20,6 @@ #include "global_env.h" #include -#include #include #include #include @@ -30,6 +29,7 @@ #include #include // IWYU pragma: keep +#include "gtest/gtest.h" // IWYU pragma: no_include "gtest/gtest-message.h" // IWYU pragma: no_include "gtest/gtest-test-part.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/test/function_test/utils/test_util.cpp b/src/test/function_test/utils/test_util.cpp index d9b9106816..81fded73b4 100644 --- a/src/test/function_test/utils/test_util.cpp +++ b/src/test/function_test/utils/test_util.cpp @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -31,8 +30,6 @@ #include "client/replication_ddl_client.h" #include "common/replication_other_types.h" #include "fmt/core.h" -#include "gtest/gtest-message.h" -#include "gtest/gtest-test-part.h" #include "gtest/gtest.h" #include "include/pegasus/client.h" #include "nlohmann/detail/iterators/iter_impl.hpp" diff --git a/src/test_util/test_util.cpp b/src/test_util/test_util.cpp index a4dbf41deb..338ec4ddfa 100644 --- a/src/test_util/test_util.cpp +++ b/src/test_util/test_util.cpp @@ -19,11 +19,8 @@ #include #include -#include #include -#include "gtest/gtest-message.h" -#include "gtest/gtest-test-part.h" #include "gtest/gtest.h" #include "metadata_types.h" #include "rocksdb/env.h" diff --git a/src/utils/test/TokenBucketTest.cpp b/src/utils/test/TokenBucketTest.cpp index 8ad5b32a7e..70504d8549 100644 --- a/src/utils/test/TokenBucketTest.cpp +++ b/src/utils/test/TokenBucketTest.cpp @@ -17,14 +17,12 @@ #include "TokenBucketTest.h" #include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include #include +#include "gtest/gtest.h" #include "utils/TokenBucket.h" using namespace folly; diff --git a/src/utils/test/autoref_ptr_test.cpp b/src/utils/test/autoref_ptr_test.cpp index 4ff6a15294..b85ddb54c6 100644 --- a/src/utils/test/autoref_ptr_test.cpp +++ b/src/utils/test/autoref_ptr_test.cpp @@ -5,13 +5,10 @@ // this test is copy from // https://github.com/chromium/chromium/blob/07eea964c3f60f501782d8eb51f62ca75ddf3908/base/memory/ref_counted_unittest.cc -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include -#include +#include #include +#include "gtest/gtest.h" #include "utils/autoref_ptr.h" namespace { diff --git a/src/utils/test/binary_reader_test.cpp b/src/utils/test/binary_reader_test.cpp index 9a2d74f93a..eacf0749b5 100644 --- a/src/utils/test/binary_reader_test.cpp +++ b/src/utils/test/binary_reader_test.cpp @@ -17,10 +17,7 @@ #include "utils/binary_reader.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include - +#include "gtest/gtest.h" #include "utils/defer.h" namespace dsn { diff --git a/src/utils/test/command_manager_test.cpp b/src/utils/test/command_manager_test.cpp index f88dcba22d..e6e2598cac 100644 --- a/src/utils/test/command_manager_test.cpp +++ b/src/utils/test/command_manager_test.cpp @@ -19,9 +19,8 @@ #include #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include + +#include "gtest/gtest.h" using std::string; using std::vector; diff --git a/src/utils/test/configuration.cpp b/src/utils/test/configuration.cpp index f9b1c7670e..1930503ae6 100644 --- a/src/utils/test/configuration.cpp +++ b/src/utils/test/configuration.cpp @@ -24,9 +24,6 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -37,6 +34,7 @@ #include #include +#include "gtest/gtest.h" #include "utils/configuration.h" #include "utils/string_view.h" diff --git a/src/utils/test/endian_test.cpp b/src/utils/test/endian_test.cpp index 33aa27ba48..92533fd67e 100644 --- a/src/utils/test/endian_test.cpp +++ b/src/utils/test/endian_test.cpp @@ -15,13 +15,11 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include +#include "gtest/gtest.h" #include "utils/endians.h" #include "utils/string_view.h" diff --git a/src/utils/test/env.cpp b/src/utils/test/env.cpp index 6b82bed768..ab3763c274 100644 --- a/src/utils/test/env.cpp +++ b/src/utils/test/env.cpp @@ -34,18 +34,14 @@ */ #include -#include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include -#include #include #include #include +#include "gtest/gtest.h" #include "test_util/test_util.h" #include "utils/env.h" #include "utils/error_code.h" diff --git a/src/utils/test/fail_point_test.cpp b/src/utils/test/fail_point_test.cpp index b7668b03c9..743a3f66b9 100644 --- a/src/utils/test/fail_point_test.cpp +++ b/src/utils/test/fail_point_test.cpp @@ -28,11 +28,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include +#include +#include "gtest/gtest.h" #include "utils/fail_point.h" #include "utils/fail_point_impl.h" #include "utils/string_view.h" diff --git a/src/utils/test/file_system_test.cpp b/src/utils/test/file_system_test.cpp index f497a908b3..66a224f9e5 100644 --- a/src/utils/test/file_system_test.cpp +++ b/src/utils/test/file_system_test.cpp @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -26,6 +22,7 @@ #include #include +#include "gtest/gtest.h" #include "utils/env.h" #include "utils/error_code.h" #include "utils/filesystem.h" diff --git a/src/utils/test/file_utils.cpp b/src/utils/test/file_utils.cpp index 42066d2bd6..5c5a295968 100644 --- a/src/utils/test/file_utils.cpp +++ b/src/utils/test/file_utils.cpp @@ -24,19 +24,15 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include -#include #include #include +#include "gtest/gtest.h" #include "test_util/test_util.h" #include "utils/env.h" #include "utils/error_code.h" diff --git a/src/utils/test/flag_test.cpp b/src/utils/test/flag_test.cpp index dccee0bac6..e3b601991d 100644 --- a/src/utils/test/flag_test.cpp +++ b/src/utils/test/flag_test.cpp @@ -16,13 +16,11 @@ // under the License. #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include +#include "gtest/gtest.h" #include "utils/error_code.h" #include "utils/errors.h" #include "utils/flags.h" diff --git a/src/utils/test/fmt_logging_test.cpp b/src/utils/test/fmt_logging_test.cpp index a8c5f7d13a..876d9b0a89 100644 --- a/src/utils/test/fmt_logging_test.cpp +++ b/src/utils/test/fmt_logging_test.cpp @@ -25,13 +25,11 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include "common/gpid.h" #include "common/replication.codes.h" +#include "gtest/gtest.h" #include "runtime/task/task_code.h" #include "utils/error_code.h" #include "utils/errors.h" diff --git a/src/utils/test/hostname_test.cpp b/src/utils/test/hostname_test.cpp index 3bd71aeba7..87489bdd93 100644 --- a/src/utils/test/hostname_test.cpp +++ b/src/utils/test/hostname_test.cpp @@ -15,12 +15,10 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include +#include "gtest/gtest.h" #include "runtime/rpc/rpc_address.h" #include "utils/utils.h" diff --git a/src/utils/test/join_point_test.cpp b/src/utils/test/join_point_test.cpp index a23740579a..67ffca9dc9 100644 --- a/src/utils/test/join_point_test.cpp +++ b/src/utils/test/join_point_test.cpp @@ -26,11 +26,10 @@ #include "utils/join_point.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include +#include "gtest/gtest.h" + namespace dsn { class join_point_test : public ::testing::Test diff --git a/src/utils/test/json_helper_test.cpp b/src/utils/test/json_helper_test.cpp index 7e3c4ff083..4006b10bfc 100644 --- a/src/utils/test/json_helper_test.cpp +++ b/src/utils/test/json_helper_test.cpp @@ -24,11 +24,7 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include -#include #include #include #include @@ -39,6 +35,7 @@ #include #include "common/json_helper.h" +#include "gtest/gtest.h" #include "utils/blob.h" namespace dsn { diff --git a/src/utils/test/latency_tracer_test.cpp b/src/utils/test/latency_tracer_test.cpp index 5cd7ef2b79..1e4d1af9a6 100644 --- a/src/utils/test/latency_tracer_test.cpp +++ b/src/utils/test/latency_tracer_test.cpp @@ -17,10 +17,6 @@ #include #include // IWYU pragma: keep -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include @@ -29,6 +25,8 @@ #include #include "common/replication.codes.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" #include "utils/latency_tracer.h" namespace dsn { diff --git a/src/utils/test/lock.std.cpp b/src/utils/test/lock.std.cpp index c7027a8861..18aef80bdd 100644 --- a/src/utils/test/lock.std.cpp +++ b/src/utils/test/lock.std.cpp @@ -24,12 +24,10 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include +#include #include +#include "gtest/gtest.h" #include "runtime/rpc/rpc_address.h" #include "utils/lockp.std.h" diff --git a/src/utils/test/logger.cpp b/src/utils/test/logger.cpp index 9ae0a48071..f8b213f6fe 100644 --- a/src/utils/test/logger.cpp +++ b/src/utils/test/logger.cpp @@ -25,19 +25,16 @@ */ #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include -#include #include #include #include +#include "gtest/gtest.h" #include "utils/api_utilities.h" #include "utils/error_code.h" #include "utils/filesystem.h" diff --git a/src/utils/test/long_adder_test.cpp b/src/utils/test/long_adder_test.cpp index 8351f8b20b..a6a910a92a 100644 --- a/src/utils/test/long_adder_test.cpp +++ b/src/utils/test/long_adder_test.cpp @@ -16,18 +16,15 @@ // under the License. #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include -#include #include #include #include #include #include +#include "gtest/gtest.h" #include "runtime/api_layer1.h" #include "utils/long_adder.h" diff --git a/src/utils/test/memutil_test.cpp b/src/utils/test/memutil_test.cpp index 87c4da8dc3..91d8fa51cf 100644 --- a/src/utils/test/memutil_test.cpp +++ b/src/utils/test/memutil_test.cpp @@ -16,10 +16,9 @@ #include "utils/memutil.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include +#include + +#include "gtest/gtest.h" TEST(MemUtilTest, memmatch) { diff --git a/src/utils/test/nth_element_test.cpp b/src/utils/test/nth_element_test.cpp index e3771fd538..4bbac1601e 100644 --- a/src/utils/test/nth_element_test.cpp +++ b/src/utils/test/nth_element_test.cpp @@ -18,12 +18,9 @@ #include "utils/nth_element.h" #include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include -#include +#include "gtest/gtest.h" #include "nth_element_utils.h" namespace dsn { diff --git a/src/utils/test/output_utils_test.cpp b/src/utils/test/output_utils_test.cpp index b6c265618c..008c8a4e45 100644 --- a/src/utils/test/output_utils_test.cpp +++ b/src/utils/test/output_utils_test.cpp @@ -26,13 +26,12 @@ #include "utils/output_utils.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include #include #include +#include "gtest/gtest.h" + using std::vector; using std::string; using dsn::utils::table_printer; diff --git a/src/utils/test/priority_queue.cpp b/src/utils/test/priority_queue.cpp index f5c552b7f0..ebe985e928 100644 --- a/src/utils/test/priority_queue.cpp +++ b/src/utils/test/priority_queue.cpp @@ -35,15 +35,13 @@ #include "utils/priority_queue.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include +#include "gtest/gtest.h" #include "utils/utils.h" using namespace ::dsn::utils; diff --git a/src/utils/test/rand_test.cpp b/src/utils/test/rand_test.cpp index 804b26eb56..3154774c4e 100644 --- a/src/utils/test/rand_test.cpp +++ b/src/utils/test/rand_test.cpp @@ -17,13 +17,12 @@ #include "utils/rand.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include +#include "gtest/gtest.h" + namespace dsn { TEST(random, sanity) diff --git a/src/utils/test/sema.cpp b/src/utils/test/sema.cpp index 40b14824b2..2da4df61d1 100644 --- a/src/utils/test/sema.cpp +++ b/src/utils/test/sema.cpp @@ -35,13 +35,12 @@ #include "utils/hpc_locks/sema.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include -#include +#include #include +#include "gtest/gtest.h" + TEST(core, Semaphore) { Semaphore s; diff --git a/src/utils/test/smart_pointers_test.cpp b/src/utils/test/smart_pointers_test.cpp index 7a6bba05f0..7c36a01cc6 100644 --- a/src/utils/test/smart_pointers_test.cpp +++ b/src/utils/test/smart_pointers_test.cpp @@ -14,15 +14,13 @@ #include "utils/smart_pointers.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -#include #include #include #include #include +#include "gtest/gtest.h" + using namespace dsn; TEST(MakeUniqueTest, Basic) diff --git a/src/utils/test/string_conv_test.cpp b/src/utils/test/string_conv_test.cpp index 92a46ed80f..e7a2c26bc1 100644 --- a/src/utils/test/string_conv_test.cpp +++ b/src/utils/test/string_conv_test.cpp @@ -26,10 +26,7 @@ #include "utils/string_conv.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include - +#include "gtest/gtest.h" #include "utils/string_view.h" TEST(string_conv, buf2bool) diff --git a/src/utils/test/string_view_test.cpp b/src/utils/test/string_view_test.cpp index 06c5e6d8a5..4a757988c4 100644 --- a/src/utils/test/string_view_test.cpp +++ b/src/utils/test/string_view_test.cpp @@ -14,13 +14,12 @@ #include "utils/string_view.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include +#include "gtest/gtest.h" + namespace { // Separated from STL1() because some compilers produce an overly diff --git a/src/utils/test/time_utils_test.cpp b/src/utils/test/time_utils_test.cpp index aea6652431..74c0c8db4e 100644 --- a/src/utils/test/time_utils_test.cpp +++ b/src/utils/test/time_utils_test.cpp @@ -26,9 +26,7 @@ #include "utils/time_utils.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include +#include "gtest/gtest.h" namespace dsn { namespace utils { diff --git a/src/utils/test/token_bucket_throttling_controller_test.cpp b/src/utils/test/token_bucket_throttling_controller_test.cpp index 69fa15f9f8..d3812d4849 100644 --- a/src/utils/test/token_bucket_throttling_controller_test.cpp +++ b/src/utils/test/token_bucket_throttling_controller_test.cpp @@ -17,11 +17,10 @@ #include "utils/token_bucket_throttling_controller.h" -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include +#include "gtest/gtest.h" + namespace dsn { namespace utils { diff --git a/src/utils/test/token_buckets_test.cpp b/src/utils/test/token_buckets_test.cpp index e478806971..512335cd91 100644 --- a/src/utils/test/token_buckets_test.cpp +++ b/src/utils/test/token_buckets_test.cpp @@ -15,13 +15,11 @@ // specific language governing permissions and limitations // under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include +#include "gtest/gtest.h" #include "utils/TokenBucket.h" #include "utils/token_buckets.h" diff --git a/src/utils/test/utils.cpp b/src/utils/test/utils.cpp index 756f7f5de0..5ca3010470 100644 --- a/src/utils/test/utils.cpp +++ b/src/utils/test/utils.cpp @@ -33,20 +33,18 @@ * xxxx-xx-xx, author, fix bug about xxx */ -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include #include #include #include +#include #include #include #include #include +#include "gtest/gtest.h" #include "utils/autoref_ptr.h" #include "utils/binary_reader.h" #include "utils/binary_writer.h" diff --git a/src/zookeeper/test/distributed_lock_zookeeper.cpp b/src/zookeeper/test/distributed_lock_zookeeper.cpp index 1ba3ce6283..7da48ef433 100644 --- a/src/zookeeper/test/distributed_lock_zookeeper.cpp +++ b/src/zookeeper/test/distributed_lock_zookeeper.cpp @@ -24,12 +24,8 @@ * THE SOFTWARE. */ -// IWYU pragma: no_include -// IWYU pragma: no_include -#include #include #include -#include #include #include #include @@ -37,6 +33,7 @@ #include #include +#include "gtest/gtest.h" #include "runtime/service_app.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h"