Skip to content

Commit 8e601a6

Browse files
committed
deps: bump up googletest to v1.17.0
Signed-off-by: Rohit Agrawal <[email protected]>
1 parent ffac11b commit 8e601a6

7 files changed

+22
-34
lines changed

bazel/googletest.patch

-13
This file was deleted.

bazel/repositories.bzl

+2-3
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,8 @@ def _com_github_ncopa_suexec():
571571

572572
def _com_google_googletest():
573573
external_http_archive(
574-
"com_google_googletest",
575-
patches = ["@envoy//bazel:googletest.patch"],
576-
patch_args = ["-p1"],
574+
name = "com_google_googletest",
575+
repo_mapping = {"@abseil-cpp": "@com_google_absl", "@re2": "@com_googlesource_code_re2"},
577576
)
578577

579578
# TODO(jmarantz): replace the use of bind and external_deps with just

bazel/repository_locations.bzl

+4-6
Original file line numberDiff line numberDiff line change
@@ -910,13 +910,11 @@ REPOSITORY_LOCATIONS_SPEC = dict(
910910
project_name = "Google Test",
911911
project_desc = "Google's C++ test framework",
912912
project_url = "https://github.com/google/googletest",
913-
# Pick up fix for MOCK_METHOD compilation with clang-cl for Windows (resolved after 1.10.0)
914-
# see https://github.com/google/googletest/issues/2490
915-
version = "a4ab0abb93620ce26efad9de9296b73b16e88588",
916-
sha256 = "7897bfaa5ad39a479177cfb5c3ce010184dbaee22a7c3727b212282871918751",
913+
version = "1.17.0",
914+
sha256 = "65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c",
917915
strip_prefix = "googletest-{version}",
918-
urls = ["https://github.com/google/googletest/archive/{version}.tar.gz"],
919-
release_date = "2020-09-10",
916+
urls = ["https://github.com/google/googletest/releases/download/v{version}/googletest-{version}.tar.gz"],
917+
release_date = "2025-04-30",
920918
use_category = ["test_only"],
921919
cpe = "cpe:2.3:a:google:google_test:*",
922920
license = "BSD-3-Clause",

test/fuzz/fuzz_runner.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ void runCleanupHooks() {
8585
// LLVMFuzzerInitialize() is called by LibFuzzer once before fuzzing starts.
8686
// NOLINTNEXTLINE(readability-identifier-naming)
8787
extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) {
88-
// Before parsing gmock flags, set the default value of flag --gmock_verbose to "error".
89-
// This suppresses logs from NiceMock objects, which can be noisy and provide little value.
90-
testing::GMOCK_FLAG(verbose) = "error";
88+
// Set Google Test/Google Mock verbosity to error level to suppress noisy NiceMock logs
89+
char* new_argv[] = {(*argv)[0], const_cast<char*>("--gtest_verbose=error")};
90+
*argv = new_argv;
91+
*argc = 2;
9192
testing::InitGoogleMock(argc, *argv);
9293
Envoy::Fuzz::Runner::setupEnvironment(1, *argv, spdlog::level::critical);
9394
atexit(Envoy::Fuzz::runCleanupHooks);

test/integration/tcp_proxy_odcds_integration_test.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, SingleTcpClient) {
163163
ASSERT_TRUE(fake_upstream_connection->waitForDisconnect());
164164
tcp_client->waitForHalfClose();
165165
tcp_client->close();
166-
assertOnDemandCounters(1, 0, 0);
166+
EXPECT_TRUE(assertOnDemandCounters(1, 0, 0));
167167
}
168168

169169
// Verify only one delta xds response is needed for multiple tcp_proxy requests.
@@ -249,7 +249,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownConnectionOnTimeout) {
249249

250250
tcp_client->waitForHalfClose();
251251
tcp_client->close();
252-
assertOnDemandCounters(0, 0, 1);
252+
EXPECT_TRUE(assertOnDemandCounters(0, 0, 1));
253253
}
254254

255255
TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownConnectionOnClusterMissing) {
@@ -277,7 +277,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownConnectionOnClusterMissing) {
277277

278278
tcp_client->waitForHalfClose();
279279
tcp_client->close();
280-
assertOnDemandCounters(0, 1, 0);
280+
EXPECT_TRUE(assertOnDemandCounters(0, 1, 0));
281281
}
282282

283283
TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownAllConnectionsOnClusterLookupTimeout) {
@@ -306,7 +306,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownAllConnectionsOnClusterLookupTimeou
306306

307307
tcp_client_1->waitForHalfClose(true);
308308
tcp_client_2->waitForHalfClose(true);
309-
assertOnDemandCounters(0, 0, 2);
309+
EXPECT_TRUE(assertOnDemandCounters(0, 0, 2));
310310
tcp_client_1->close();
311311
tcp_client_2->close();
312312
}
@@ -331,7 +331,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownTcpClientBeforeOdcdsResponse) {
331331
EXPECT_EQ(1, test_server_->counter("tcp.tcpproxy_stats.on_demand_cluster_attempt")->value());
332332
// Client disconnect when the tcp proxy is waiting for the on demand response.
333333
tcp_client->close();
334-
assertOnDemandCounters(0, 0, 0);
334+
EXPECT_TRUE(assertOnDemandCounters(0, 0, 0));
335335
}
336336

337337
} // namespace

test/test_common/test_random_generator.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "test/test_common/test_random_generator.h"
22

3+
#include "absl/flags/flag.h"
34
#include "gtest/gtest.h"
4-
5-
using testing::GTEST_FLAG(random_seed);
5+
#include "gtest/internal/gtest-port.h" // for GTEST_FLAG_GET
66

77
namespace Envoy {
88

@@ -16,7 +16,8 @@ int32_t getSeed() {
1616
}
1717

1818
TestRandomGenerator::TestRandomGenerator()
19-
: seed_(GTEST_FLAG(random_seed) == 0 ? getSeed() : GTEST_FLAG(random_seed)), generator_(seed_) {
19+
: seed_(GTEST_FLAG_GET(random_seed) == 0 ? getSeed() : GTEST_FLAG_GET(random_seed)),
20+
generator_(seed_) {
2021
ENVOY_LOG_MISC(info, "TestRandomGenerator running with seed {}", seed_);
2122
}
2223

test/test_runner.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include "test/test_listener.h"
1616

1717
#include "gmock/gmock.h"
18+
#include "gtest/gtest.h"
19+
#include "gtest/internal/gtest-port.h" // for GTEST_FLAG_SET
1820

1921
namespace Envoy {
2022

@@ -90,7 +92,7 @@ int TestRunner::runTests(int argc, char** argv) {
9092

9193
// Use the recommended, but not default, "threadsafe" style for the Death Tests.
9294
// See: https://github.com/google/googletest/commit/84ec2e0365d791e4ebc7ec249f09078fb5ab6caa
93-
::testing::FLAGS_gtest_death_test_style = "threadsafe";
95+
GTEST_FLAG_SET(death_test_style, "threadsafe");
9496

9597
// Set gtest properties
9698
// (https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#logging-additional-information),

0 commit comments

Comments
 (0)