From a79baa3e073aedd53fffd6268a4cb60adbc48fb6 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Sun, 10 Sep 2023 21:05:39 +0800 Subject: [PATCH] fix(build): fix a link error on macOS --- .gitignore | 2 +- run.sh | 6 +++--- src/server/info_collector.h | 3 ++- src/test/function_test/CMakeLists.txt | 16 ++++++++-------- .../CMakeLists.txt | 0 .../main.cpp | 0 .../test_backup_and_restore.cpp | 0 .../{base_api_test => base_api}/CMakeLists.txt | 0 .../integration_test.cpp | 0 .../{base_api_test => base_api}/main.cpp | 0 .../{base_api_test => base_api}/test_basic.cpp | 0 .../test_batch_get.cpp | 0 .../test_check_and_mutate.cpp | 0 .../test_check_and_set.cpp | 0 .../{base_api_test => base_api}/test_copy.cpp | 0 .../{base_api_test => base_api}/test_incr.cpp | 0 .../test_range_read.cpp | 0 .../{base_api_test => base_api}/test_recall.cpp | 0 .../{base_api_test => base_api}/test_scan.cpp | 0 .../{base_api_test => base_api}/test_ttl.cpp | 0 .../{bulk_load_test => bulk_load}/CMakeLists.txt | 0 .../{bulk_load_test => bulk_load}/main.cpp | 0 .../test_bulk_load.cpp | 4 ++-- .../CMakeLists.txt | 0 .../main.cpp | 0 .../test_detect_hotspot.cpp | 0 .../CMakeLists.txt | 0 .../main.cpp | 0 .../test_split.cpp | 0 .../{recovery_test => recovery}/CMakeLists.txt | 0 .../{recovery_test => recovery}/main.cpp | 0 .../test_recovery.cpp | 0 .../{restore_test => restore}/CMakeLists.txt | 0 .../{restore_test => restore}/main.cpp | 0 .../{restore_test => restore}/test_restore.cpp | 0 .../{throttle_test => throttle}/CMakeLists.txt | 0 .../{throttle_test => throttle}/main.cpp | 0 .../test_throttle.cpp | 2 +- src/utils/output_utils.cpp | 1 + 39 files changed, 18 insertions(+), 16 deletions(-) rename src/test/function_test/{backup_restore_test => backup_restore}/CMakeLists.txt (100%) rename src/test/function_test/{backup_restore_test => backup_restore}/main.cpp (100%) rename src/test/function_test/{backup_restore_test => backup_restore}/test_backup_and_restore.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/CMakeLists.txt (100%) rename src/test/function_test/{base_api_test => base_api}/integration_test.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/main.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/test_basic.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/test_batch_get.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/test_check_and_mutate.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/test_check_and_set.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/test_copy.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/test_incr.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/test_range_read.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/test_recall.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/test_scan.cpp (100%) rename src/test/function_test/{base_api_test => base_api}/test_ttl.cpp (100%) rename src/test/function_test/{bulk_load_test => bulk_load}/CMakeLists.txt (100%) rename src/test/function_test/{bulk_load_test => bulk_load}/main.cpp (100%) rename src/test/function_test/{bulk_load_test => bulk_load}/test_bulk_load.cpp (98%) rename src/test/function_test/{detect_hotspot_test => detect_hotspot}/CMakeLists.txt (100%) rename src/test/function_test/{detect_hotspot_test => detect_hotspot}/main.cpp (100%) rename src/test/function_test/{detect_hotspot_test => detect_hotspot}/test_detect_hotspot.cpp (100%) rename src/test/function_test/{partition_split_test => partition_split}/CMakeLists.txt (100%) rename src/test/function_test/{partition_split_test => partition_split}/main.cpp (100%) rename src/test/function_test/{partition_split_test => partition_split}/test_split.cpp (100%) rename src/test/function_test/{recovery_test => recovery}/CMakeLists.txt (100%) rename src/test/function_test/{recovery_test => recovery}/main.cpp (100%) rename src/test/function_test/{recovery_test => recovery}/test_recovery.cpp (100%) rename src/test/function_test/{restore_test => restore}/CMakeLists.txt (100%) rename src/test/function_test/{restore_test => restore}/main.cpp (100%) rename src/test/function_test/{restore_test => restore}/test_restore.cpp (100%) rename src/test/function_test/{throttle_test => throttle}/CMakeLists.txt (100%) rename src/test/function_test/{throttle_test => throttle}/main.cpp (100%) rename src/test/function_test/{throttle_test => throttle}/test_throttle.cpp (99%) diff --git a/.gitignore b/.gitignore index 457dbf3098..2bfd1ed34d 100644 --- a/.gitignore +++ b/.gitignore @@ -115,7 +115,7 @@ scripts/py_utils/*.pyc cmake-build-debug packages -src/test/function_test/bulk_load_test/pegasus-bulk-load-function-test-files/ +src/test/function_test/bulk_load/pegasus-bulk-load-function-test-files/ config-shell.ini.* *.tar.gz pegasus-server* diff --git a/run.sh b/run.sh index e6035e957a..2672094f7c 100755 --- a/run.sh +++ b/run.sh @@ -437,10 +437,10 @@ function run_test() echo "test_modules=$test_modules" # download bulk load test data - if [[ "$test_modules" =~ "bulk_load_test" && ! -d "$ROOT/src/test/function_test/bulk_load_test/pegasus-bulk-load-function-test-files" ]]; then + if [[ "$test_modules" =~ "bulk_load_test" && ! -d "$ROOT/src/test/function_test/bulk_load/pegasus-bulk-load-function-test-files" ]]; then echo "Start to download files used for bulk load function test" wget "https://github.com/XiaoMi/pegasus-common/releases/download/deps/pegasus-bulk-load-function-test-files.zip" - unzip "pegasus-bulk-load-function-test-files.zip" -d "$ROOT/src/test/function_test/bulk_load_test" + unzip "pegasus-bulk-load-function-test-files.zip" -d "$ROOT/src/test/function_test/bulk_load" rm "pegasus-bulk-load-function-test-files.zip" echo "Prepare files used for bulk load function test succeed" fi @@ -484,7 +484,7 @@ function run_test() run_stop_zk run_start_zk fi - pushd ${BUILD_LATEST_DIR}/bin/$module + pushd ${BUILD_LATEST_DIR}/bin/${module} REPORT_DIR=${REPORT_DIR} TEST_BIN=${module} TEST_OPTS=${test_opts} ./run.sh if [ $? != 0 ]; then echo "run test \"$module\" in `pwd` failed" diff --git a/src/server/info_collector.h b/src/server/info_collector.h index cf882c1177..258a3d6318 100644 --- a/src/server/info_collector.h +++ b/src/server/info_collector.h @@ -19,10 +19,11 @@ #pragma once -// IWYU pragma: no_include #include #include #include +// IWYU pragma: no_include +#include // IWYU pragma: keep #include #include #include diff --git a/src/test/function_test/CMakeLists.txt b/src/test/function_test/CMakeLists.txt index d642cfb093..b3453846b3 100644 --- a/src/test/function_test/CMakeLists.txt +++ b/src/test/function_test/CMakeLists.txt @@ -16,11 +16,11 @@ # under the License. add_subdirectory(utils) -add_subdirectory(backup_restore_test) -add_subdirectory(base_api_test) -add_subdirectory(bulk_load_test) -add_subdirectory(detect_hotspot_test) -add_subdirectory(partition_split_test) -add_subdirectory(recovery_test) -add_subdirectory(restore_test) -add_subdirectory(throttle_test) +add_subdirectory(backup_restore) +add_subdirectory(base_api) +add_subdirectory(bulk_load) +add_subdirectory(detect_hotspot) +add_subdirectory(partition_split) +add_subdirectory(recovery) +add_subdirectory(restore) +add_subdirectory(throttle) diff --git a/src/test/function_test/backup_restore_test/CMakeLists.txt b/src/test/function_test/backup_restore/CMakeLists.txt similarity index 100% rename from src/test/function_test/backup_restore_test/CMakeLists.txt rename to src/test/function_test/backup_restore/CMakeLists.txt diff --git a/src/test/function_test/backup_restore_test/main.cpp b/src/test/function_test/backup_restore/main.cpp similarity index 100% rename from src/test/function_test/backup_restore_test/main.cpp rename to src/test/function_test/backup_restore/main.cpp diff --git a/src/test/function_test/backup_restore_test/test_backup_and_restore.cpp b/src/test/function_test/backup_restore/test_backup_and_restore.cpp similarity index 100% rename from src/test/function_test/backup_restore_test/test_backup_and_restore.cpp rename to src/test/function_test/backup_restore/test_backup_and_restore.cpp diff --git a/src/test/function_test/base_api_test/CMakeLists.txt b/src/test/function_test/base_api/CMakeLists.txt similarity index 100% rename from src/test/function_test/base_api_test/CMakeLists.txt rename to src/test/function_test/base_api/CMakeLists.txt diff --git a/src/test/function_test/base_api_test/integration_test.cpp b/src/test/function_test/base_api/integration_test.cpp similarity index 100% rename from src/test/function_test/base_api_test/integration_test.cpp rename to src/test/function_test/base_api/integration_test.cpp diff --git a/src/test/function_test/base_api_test/main.cpp b/src/test/function_test/base_api/main.cpp similarity index 100% rename from src/test/function_test/base_api_test/main.cpp rename to src/test/function_test/base_api/main.cpp diff --git a/src/test/function_test/base_api_test/test_basic.cpp b/src/test/function_test/base_api/test_basic.cpp similarity index 100% rename from src/test/function_test/base_api_test/test_basic.cpp rename to src/test/function_test/base_api/test_basic.cpp diff --git a/src/test/function_test/base_api_test/test_batch_get.cpp b/src/test/function_test/base_api/test_batch_get.cpp similarity index 100% rename from src/test/function_test/base_api_test/test_batch_get.cpp rename to src/test/function_test/base_api/test_batch_get.cpp diff --git a/src/test/function_test/base_api_test/test_check_and_mutate.cpp b/src/test/function_test/base_api/test_check_and_mutate.cpp similarity index 100% rename from src/test/function_test/base_api_test/test_check_and_mutate.cpp rename to src/test/function_test/base_api/test_check_and_mutate.cpp diff --git a/src/test/function_test/base_api_test/test_check_and_set.cpp b/src/test/function_test/base_api/test_check_and_set.cpp similarity index 100% rename from src/test/function_test/base_api_test/test_check_and_set.cpp rename to src/test/function_test/base_api/test_check_and_set.cpp diff --git a/src/test/function_test/base_api_test/test_copy.cpp b/src/test/function_test/base_api/test_copy.cpp similarity index 100% rename from src/test/function_test/base_api_test/test_copy.cpp rename to src/test/function_test/base_api/test_copy.cpp diff --git a/src/test/function_test/base_api_test/test_incr.cpp b/src/test/function_test/base_api/test_incr.cpp similarity index 100% rename from src/test/function_test/base_api_test/test_incr.cpp rename to src/test/function_test/base_api/test_incr.cpp diff --git a/src/test/function_test/base_api_test/test_range_read.cpp b/src/test/function_test/base_api/test_range_read.cpp similarity index 100% rename from src/test/function_test/base_api_test/test_range_read.cpp rename to src/test/function_test/base_api/test_range_read.cpp diff --git a/src/test/function_test/base_api_test/test_recall.cpp b/src/test/function_test/base_api/test_recall.cpp similarity index 100% rename from src/test/function_test/base_api_test/test_recall.cpp rename to src/test/function_test/base_api/test_recall.cpp diff --git a/src/test/function_test/base_api_test/test_scan.cpp b/src/test/function_test/base_api/test_scan.cpp similarity index 100% rename from src/test/function_test/base_api_test/test_scan.cpp rename to src/test/function_test/base_api/test_scan.cpp diff --git a/src/test/function_test/base_api_test/test_ttl.cpp b/src/test/function_test/base_api/test_ttl.cpp similarity index 100% rename from src/test/function_test/base_api_test/test_ttl.cpp rename to src/test/function_test/base_api/test_ttl.cpp diff --git a/src/test/function_test/bulk_load_test/CMakeLists.txt b/src/test/function_test/bulk_load/CMakeLists.txt similarity index 100% rename from src/test/function_test/bulk_load_test/CMakeLists.txt rename to src/test/function_test/bulk_load/CMakeLists.txt diff --git a/src/test/function_test/bulk_load_test/main.cpp b/src/test/function_test/bulk_load/main.cpp similarity index 100% rename from src/test/function_test/bulk_load_test/main.cpp rename to src/test/function_test/bulk_load/main.cpp diff --git a/src/test/function_test/bulk_load_test/test_bulk_load.cpp b/src/test/function_test/bulk_load/test_bulk_load.cpp similarity index 98% rename from src/test/function_test/bulk_load_test/test_bulk_load.cpp rename to src/test/function_test/bulk_load/test_bulk_load.cpp index 83b2dd6ecc..f350c69453 100644 --- a/src/test/function_test/bulk_load_test/test_bulk_load.cpp +++ b/src/test/function_test/bulk_load/test_bulk_load.cpp @@ -90,7 +90,7 @@ class bulk_load_test : public test_util ASSERT_NO_FATAL_FAILURE( run_cmd_from_project_root("mkdir -p onebox/block_service/local_service")); ASSERT_NO_FATAL_FAILURE(run_cmd_from_project_root( - "cp -r src/test/function_test/bulk_load_test/pegasus-bulk-load-function-test-files/" + + "cp -r src/test/function_test/bulk_load/pegasus-bulk-load-function-test-files/" + LOCAL_ROOT + " onebox/block_service/local_service")); string cmd = "echo '{\"app_id\":" + std::to_string(app_id_) + ",\"app_name\":\"temp\",\"partition_count\":8}' > " @@ -114,7 +114,7 @@ class bulk_load_test : public test_util void replace_bulk_load_info() { string cmd = "cp -R " - "src/test/function_test/bulk_load_test/pegasus-bulk-load-function-test-files/" + "src/test/function_test/bulk_load/pegasus-bulk-load-function-test-files/" "mock_bulk_load_info/. " + bulk_load_local_root_ + "/" + CLUSTER + "/" + app_name_ + "/"; ASSERT_NO_FATAL_FAILURE(run_cmd_from_project_root(cmd)); diff --git a/src/test/function_test/detect_hotspot_test/CMakeLists.txt b/src/test/function_test/detect_hotspot/CMakeLists.txt similarity index 100% rename from src/test/function_test/detect_hotspot_test/CMakeLists.txt rename to src/test/function_test/detect_hotspot/CMakeLists.txt diff --git a/src/test/function_test/detect_hotspot_test/main.cpp b/src/test/function_test/detect_hotspot/main.cpp similarity index 100% rename from src/test/function_test/detect_hotspot_test/main.cpp rename to src/test/function_test/detect_hotspot/main.cpp diff --git a/src/test/function_test/detect_hotspot_test/test_detect_hotspot.cpp b/src/test/function_test/detect_hotspot/test_detect_hotspot.cpp similarity index 100% rename from src/test/function_test/detect_hotspot_test/test_detect_hotspot.cpp rename to src/test/function_test/detect_hotspot/test_detect_hotspot.cpp diff --git a/src/test/function_test/partition_split_test/CMakeLists.txt b/src/test/function_test/partition_split/CMakeLists.txt similarity index 100% rename from src/test/function_test/partition_split_test/CMakeLists.txt rename to src/test/function_test/partition_split/CMakeLists.txt diff --git a/src/test/function_test/partition_split_test/main.cpp b/src/test/function_test/partition_split/main.cpp similarity index 100% rename from src/test/function_test/partition_split_test/main.cpp rename to src/test/function_test/partition_split/main.cpp diff --git a/src/test/function_test/partition_split_test/test_split.cpp b/src/test/function_test/partition_split/test_split.cpp similarity index 100% rename from src/test/function_test/partition_split_test/test_split.cpp rename to src/test/function_test/partition_split/test_split.cpp diff --git a/src/test/function_test/recovery_test/CMakeLists.txt b/src/test/function_test/recovery/CMakeLists.txt similarity index 100% rename from src/test/function_test/recovery_test/CMakeLists.txt rename to src/test/function_test/recovery/CMakeLists.txt diff --git a/src/test/function_test/recovery_test/main.cpp b/src/test/function_test/recovery/main.cpp similarity index 100% rename from src/test/function_test/recovery_test/main.cpp rename to src/test/function_test/recovery/main.cpp diff --git a/src/test/function_test/recovery_test/test_recovery.cpp b/src/test/function_test/recovery/test_recovery.cpp similarity index 100% rename from src/test/function_test/recovery_test/test_recovery.cpp rename to src/test/function_test/recovery/test_recovery.cpp diff --git a/src/test/function_test/restore_test/CMakeLists.txt b/src/test/function_test/restore/CMakeLists.txt similarity index 100% rename from src/test/function_test/restore_test/CMakeLists.txt rename to src/test/function_test/restore/CMakeLists.txt diff --git a/src/test/function_test/restore_test/main.cpp b/src/test/function_test/restore/main.cpp similarity index 100% rename from src/test/function_test/restore_test/main.cpp rename to src/test/function_test/restore/main.cpp diff --git a/src/test/function_test/restore_test/test_restore.cpp b/src/test/function_test/restore/test_restore.cpp similarity index 100% rename from src/test/function_test/restore_test/test_restore.cpp rename to src/test/function_test/restore/test_restore.cpp diff --git a/src/test/function_test/throttle_test/CMakeLists.txt b/src/test/function_test/throttle/CMakeLists.txt similarity index 100% rename from src/test/function_test/throttle_test/CMakeLists.txt rename to src/test/function_test/throttle/CMakeLists.txt diff --git a/src/test/function_test/throttle_test/main.cpp b/src/test/function_test/throttle/main.cpp similarity index 100% rename from src/test/function_test/throttle_test/main.cpp rename to src/test/function_test/throttle/main.cpp diff --git a/src/test/function_test/throttle_test/test_throttle.cpp b/src/test/function_test/throttle/test_throttle.cpp similarity index 99% rename from src/test/function_test/throttle_test/test_throttle.cpp rename to src/test/function_test/throttle/test_throttle.cpp index a29c9c5fe1..23583a7bfe 100644 --- a/src/test/function_test/throttle_test/test_throttle.cpp +++ b/src/test/function_test/throttle/test_throttle.cpp @@ -131,7 +131,7 @@ struct throttle_test_recorder // read/write throttle function test // the details of records are saved in -// `./src/builder/test/function_test/throttle_test/throttle_test_result.txt` +// `./src/builder/test/function_test/throttle/throttle_test_result.txt` class throttle_test : public test_util { public: diff --git a/src/utils/output_utils.cpp b/src/utils/output_utils.cpp index 6b30172217..dfaa799633 100644 --- a/src/utils/output_utils.cpp +++ b/src/utils/output_utils.cpp @@ -17,6 +17,7 @@ #include "utils/output_utils.h" +#include // IWYU pragma: no_include #include