Skip to content

Commit

Permalink
refactor(thirdparty): Bump googletest to 1.14.0 (#1689)
Browse files Browse the repository at this point in the history
This patch update the googletest to 1.14.0 which is the lateset release currently.
The s2 CMake options have to be changed because it depends on googletest, I will
update these again soon in a following patch.
IWYU generate many changes automatically in this patch, most of them are change
including gtest/gtest.h from angle brackets to quotes, we will fix in another
patch(it's a TODO in #1349)
The changes in src/block_service/test/hdfs_service_test.cpp is one of the benfits
of bump googletest to 1.14.0, now we can use `GTEST_SKIP()` macro.
This patch also add the missing parameterized for `cold_backup_context_test`.
  • Loading branch information
acelyc111 authored Nov 23, 2023
1 parent b580ccc commit 1409d09
Show file tree
Hide file tree
Showing 178 changed files with 261 additions and 634 deletions.
2 changes: 1 addition & 1 deletion .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ header:
- 'thirdparty/fix_libevent_for_macos.patch'
- 'thirdparty/fix_prometheus-cpp_limits.patch'
- 'thirdparty/fix_rocksdb-cmake-PORTABLE-option.patch'
- 'thirdparty/fix_s2_for_aarch64.patch'
- 'thirdparty/fix_s2_build_with_cxx17.patch'
- 'thirdparty/fix_thrift_for_cpp11.patch'
# TODO(yingchun): shell/* files are import from thirdparties, we can move them to thirdparty later.
# Copyright (c) 2016, Adi Shavit
Expand Down
5 changes: 1 addition & 4 deletions src/aio/test/aio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
*/

#include <fmt/core.h>
// IWYU pragma: no_include <gtest/gtest-param-test.h>
// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <rocksdb/status.h>
#include <string.h>
#include <algorithm>
Expand All @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions src/base/test/redact_sensitive_string_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
* under the License.
*/

// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <string>

#include "base/pegasus_utils.h"
#include "gtest/gtest.h"

const std::string test_string = "pegasus";

Expand Down
4 changes: 1 addition & 3 deletions src/base/test/utils_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
* under the License.
*/

// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <list>
#include <string>

#include "../pegasus_utils.h"
#include "gtest/gtest.h"

namespace pegasus {
namespace utils {
Expand Down
4 changes: 1 addition & 3 deletions src/base/test/value_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
* under the License.
*/

// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <stdint.h>
#include <string>

#include "base/value_schema_manager.h"
#include "gtest/gtest.h"
#include "pegasus_value_schema.h"
#include "utils/string_view.h"
#include "value_field.h"
Expand Down
4 changes: 1 addition & 3 deletions src/base/test/value_schema_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
* under the License.
*/

// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <rocksdb/slice.h>
#include <stdint.h>
#include <array>
Expand All @@ -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"
Expand Down
6 changes: 2 additions & 4 deletions src/block_service/test/block_service_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
// specific language governing permissions and limitations
// under the License.

// IWYU pragma: no_include <gtest/gtest-param-test.h>
// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
// IWYU pragma: no_include <algorithm>
#include <cstdint>
#include <map>
#include <memory>
Expand All @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions src/block_service/test/fds_service_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

#include <errno.h>
#include <fcntl.h>
// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
Expand All @@ -32,6 +29,7 @@
#include <memory>

#include "block_service/block_service.h"
#include "gtest/gtest.h"
#include "utils/autoref_ptr.h"
#include "utils/blob.h"
#include "utils/enum_helper.h"
Expand Down
22 changes: 4 additions & 18 deletions src/block_service/test/hdfs_service_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,20 @@
// under the License.

#include <fmt/core.h>
#include <gtest/gtest-param-test.h>
// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <rocksdb/env.h>
#include <rocksdb/slice.h>
#include <rocksdb/status.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <algorithm>
#include <cstdint>
#include <iostream>
#include <memory>
#include <string>
#include <vector>

#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"
Expand Down Expand Up @@ -134,10 +129,7 @@ INSTANTIATE_TEST_CASE_P(, HDFSClientTest, ::testing::Values(false, true));
TEST_P(HDFSClientTest, test_hdfs_read_write)
{
if (strlen(FLAGS_test_name_node) == 0 || strlen(FLAGS_test_backup_path) == 0) {
// TODO(yingchun): use GTEST_SKIP after upgrading gtest.
std::cout << "Set hdfs_test.* configs in config-test.ini to enable hdfs_service_test."
<< std::endl;
return;
GTEST_SKIP() << "Set hdfs_test.* configs in config-test.ini to enable hdfs_service_test.";
}

auto s = std::make_shared<hdfs_service>();
Expand Down Expand Up @@ -211,10 +203,7 @@ TEST_P(HDFSClientTest, test_hdfs_read_write)
TEST_P(HDFSClientTest, test_upload_and_download)
{
if (strlen(FLAGS_test_name_node) == 0 || strlen(FLAGS_test_backup_path) == 0) {
// TODO(yingchun): use GTEST_SKIP after upgrading gtest.
std::cout << "Set hdfs_test.* configs in config-test.ini to enable hdfs_service_test."
<< std::endl;
return;
GTEST_SKIP() << "Set hdfs_test.* configs in config-test.ini to enable hdfs_service_test.";
}

auto s = std::make_shared<hdfs_service>();
Expand Down Expand Up @@ -314,10 +303,7 @@ TEST_P(HDFSClientTest, test_upload_and_download)
TEST_P(HDFSClientTest, test_concurrent_upload_download)
{
if (strlen(FLAGS_test_name_node) == 0 || strlen(FLAGS_test_backup_path) == 0) {
// TODO(yingchun): use GTEST_SKIP after upgrading gtest.
std::cout << "Set hdfs_test.* configs in config-test.ini to enable hdfs_service_test."
<< std::endl;
return;
GTEST_SKIP() << "Set hdfs_test.* configs in config-test.ini to enable hdfs_service_test.";
}

auto s = std::make_shared<hdfs_service>();
Expand Down
5 changes: 1 addition & 4 deletions src/block_service/test/local_service_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
*/

#include <boost/filesystem/operations.hpp>
// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-param-test.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <nlohmann/detail/json_ref.hpp>
#include <nlohmann/json.hpp>
#include <nlohmann/json_fwd.hpp>
Expand All @@ -35,6 +31,7 @@
#include <vector>

#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"
Expand Down
5 changes: 1 addition & 4 deletions src/client/test/ddl_client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@
// under the License.

#include <fmt/core.h>
// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <stdint.h>
#include <algorithm>
#include <deque>
#include <memory>
#include <vector>

#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"
Expand Down
5 changes: 2 additions & 3 deletions src/common/test/common_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

#include "common/common.h"

// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <memory>

#include "gtest/gtest.h"

namespace dsn {
TEST(duplication_common, get_current_cluster_name)
{
Expand Down
4 changes: 1 addition & 3 deletions src/common/test/duplication_common_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@

#include "common//duplication_common.h"

// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <cstdint>

#include "gtest/gtest.h"
#include "utils/error_code.h"

namespace dsn {
Expand Down
6 changes: 1 addition & 5 deletions src/common/test/fs_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,18 @@
* under the License.
*/

// IWYU pragma: no_include <gtest/gtest-param-test.h>
// IWYU pragma: no_include <ext/alloc_traits.h>
// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <stdint.h>
#include <map>
#include <memory>
#include <ostream>
#include <set>
#include <string>
#include <vector>

#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"
Expand Down
5 changes: 1 addition & 4 deletions src/common/test/replication_common_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@
* under the License.
*/

// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <stdint.h>
#include <algorithm>
#include <fstream>
#include <string>
#include <vector>

#include "common/replication_common.h"
#include "gtest/gtest.h"
#include "utils/filesystem.h"

namespace dsn {
Expand Down
5 changes: 2 additions & 3 deletions src/failure_detector/test/failure_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
*/

// IWYU pragma: no_include <ext/alloc_traits.h>
// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
Expand All @@ -39,12 +36,14 @@
#include <memory>
#include <string>
#include <thread>
#include <tuple>
#include <utility>
#include <vector>

#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"
Expand Down
5 changes: 1 addition & 4 deletions src/geo/test/geo_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
*/

#include <base/pegasus_key_schema.h>
// IWYU pragma: no_include <gtest/gtest-param-test.h>
// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <math.h>
#include <pegasus/error.h>
#include <s2/s1angle.h>
Expand All @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions src/geo/test/latlng_codec_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@
* under the License.
*/

// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <s2/s1angle.h>
#include <s2/s2latlng.h>
#include <s2/third_party/absl/base/port.h>
#include <string>

#include "geo/lib/latlng_codec.h"
#include "gtest/gtest.h"
#include "utils/errors.h"

namespace pegasus {
Expand Down
3 changes: 2 additions & 1 deletion src/http/test/http_client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
// under the License.

#include <fmt/core.h>
#include <gtest/gtest.h>
// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-param-test.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <cstring>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>

#include "gtest/gtest.h"
#include "http/http_client.h"
#include "http/http_method.h"
#include "utils/error_code.h"
Expand Down
5 changes: 1 addition & 4 deletions src/http/test/http_server_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@
// specific language governing permissions and limitations
// under the License.

// IWYU pragma: no_include <gtest/gtest-message.h>
// IWYU pragma: no_include <gtest/gtest-test-part.h>
#include <gtest/gtest.h>
#include <stdint.h>
#include <string.h>
#include <algorithm>
#include <memory>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>

#include "gtest/gtest.h"
#include "http/builtin_http_calls.h"
#include "http/http_call_registry.h"
#include "http/http_message_parser.h"
Expand Down
Loading

0 comments on commit 1409d09

Please sign in to comment.