commit c994b2d9c7ad18f056d484a3cfb2de8f2479d70c
parent 4424263193cb9ba03d1bf8b07c222d7a2d80f987
Author: Updatebot <updatebot@mozilla.com>
Date: Wed, 15 Oct 2025 20:22:42 +0000
Bug 1994049 - Update googletest to 2ce9d8f2e85550a94d6ac977c881fe3658129ac6 r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D268443
Diffstat:
10 files changed, 62 insertions(+), 30 deletions(-)
diff --git a/third_party/googletest/BUILD.bazel b/third_party/googletest/BUILD.bazel
@@ -30,6 +30,8 @@
#
# Bazel Build for Google C++ Testing Framework(Google Test)
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
+
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
diff --git a/third_party/googletest/MODULE.bazel b/third_party/googletest/MODULE.bazel
@@ -53,6 +53,11 @@ bazel_dep(
)
bazel_dep(
+ name = "rules_cc",
+ version = "0.2.8"
+)
+
+bazel_dep(
name = "rules_python",
version = "1.3.0",
dev_dependency = True,
diff --git a/third_party/googletest/WORKSPACE b/third_party/googletest/WORKSPACE
@@ -46,12 +46,6 @@ load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
http_archive(
- name = "bazel_skylib",
- sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
- urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"],
-)
-
-http_archive(
name = "platforms",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz",
@@ -59,3 +53,9 @@ http_archive(
],
sha256 = "29742e87275809b5e598dc2f04d86960cc7a55b3067d97221c9abbc9926bff0f",
)
+
+load("@bazel_features//:deps.bzl", "bazel_features_deps")
+bazel_features_deps()
+
+load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
+compatibility_proxy_repo()
diff --git a/third_party/googletest/googlemock/include/gmock/gmock-actions.h b/third_party/googletest/googlemock/include/gmock/gmock-actions.h
@@ -1796,11 +1796,24 @@ struct SetArrayArgumentAction {
};
template <size_t k>
-struct DeleteArgAction {
+class DeleteArgAction {
+ public:
template <typename... Args>
void operator()(const Args&... args) const {
- delete std::get<k>(std::tie(args...));
+ DoDelete(std::get<k>(std::tie(args...)));
}
+
+ private:
+ template <typename T>
+ static void DoDelete(T* ptr) {
+ delete ptr;
+ }
+
+ template <typename T>
+ [[deprecated(
+ "DeleteArg<N> used for a non-pointer argument, it was likely migrated "
+ "to a smart pointer type. This action should be removed.")]]
+ static void DoDelete(T&) {}
};
template <typename Ptr>
@@ -1868,7 +1881,7 @@ typedef internal::IgnoredValue Unused;
// Deprecated single-argument DoAll.
template <typename Action>
-GMOCK_DEPRECATE_AND_INLINE()
+GTEST_INTERNAL_DEPRECATE_AND_INLINE("Avoid using DoAll() for single actions")
typename std::decay<Action>::type DoAll(Action&& action) {
return std::forward<Action>(action);
}
@@ -2038,11 +2051,11 @@ PolymorphicAction<internal::SetErrnoAndReturnAction<T>> SetErrnoAndReturn(
// Various overloads for Invoke().
// Legacy function.
-// Actions can now be implicitly constructed from callables. No need to create
-// wrapper objects.
// This function exists for backwards compatibility.
template <typename FunctionImpl>
-GMOCK_DEPRECATE_AND_INLINE()
+GTEST_INTERNAL_DEPRECATE_AND_INLINE(
+ "Actions can now be implicitly constructed from callables. No need to "
+ "create wrapper objects using Invoke().")
typename std::decay<FunctionImpl>::type Invoke(FunctionImpl&& function_impl) {
return std::forward<FunctionImpl>(function_impl);
}
diff --git a/third_party/googletest/googlemock/include/gmock/internal/gmock-port.h b/third_party/googletest/googlemock/include/gmock/internal/gmock-port.h
@@ -57,19 +57,10 @@
#include "gmock/internal/custom/gmock-port.h"
#include "gtest/internal/gtest-port.h"
-#if defined(GTEST_HAS_ABSL)
-#include "absl/base/macros.h"
-
-#define GMOCK_DEPRECATE_AND_INLINE() ABSL_DEPRECATE_AND_INLINE()
-
-#if !defined(GTEST_NO_ABSL_FLAGS)
+#if defined(GTEST_HAS_ABSL) && !defined(GTEST_NO_ABSL_FLAGS)
#include "absl/flags/declare.h"
#include "absl/flags/flag.h"
-#endif // !defined(GTEST_NO_ABSL_FLAGS)
-
-#else // defined(GTEST_HAS_ABSL)
-#define GMOCK_DEPRECATE_AND_INLINE()
-#endif // defined(GTEST_HAS_ABSL)
+#endif
// For MS Visual C++, check the compiler version. At least VS 2015 is
// required to compile Google Mock.
diff --git a/third_party/googletest/googletest/include/gtest/gtest-matchers.h b/third_party/googletest/googletest/include/gtest/gtest-matchers.h
@@ -296,12 +296,12 @@ class MatcherBase : private MatcherDescriberInterface {
return *this;
}
- MatcherBase(MatcherBase&& other)
+ MatcherBase(MatcherBase&& other) noexcept
: vtable_(other.vtable_), buffer_(other.buffer_) {
other.vtable_ = nullptr;
}
- MatcherBase& operator=(MatcherBase&& other) {
+ MatcherBase& operator=(MatcherBase&& other) noexcept {
if (this == &other) return *this;
Destroy();
vtable_ = other.vtable_;
diff --git a/third_party/googletest/googletest/include/gtest/gtest.h b/third_party/googletest/googletest/include/gtest/gtest.h
@@ -73,8 +73,6 @@
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-string.h"
-#include "mozilla/Attributes.h"
-
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
/* class A needs to have dll-interface to be used by clients of class B */)
@@ -327,7 +325,7 @@ class GTEST_API_ Test {
//
// DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
// Instead, use the TEST or TEST_F macro.
- MOZ_CAN_RUN_SCRIPT virtual void TestBody() = 0;
+ virtual void TestBody() = 0;
// Sets up, executes, and tears down the test.
void Run();
diff --git a/third_party/googletest/googletest/include/gtest/internal/gtest-port.h b/third_party/googletest/googletest/include/gtest/internal/gtest-port.h
@@ -2322,6 +2322,13 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val);
} // namespace internal
} // namespace testing
+#if GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(clang::annotate)
+#define GTEST_INTERNAL_DEPRECATE_AND_INLINE(msg) \
+ [[deprecated(msg), clang::annotate("inline-me")]]
+#else
+#define GTEST_INTERNAL_DEPRECATE_AND_INLINE(msg) [[deprecated(msg)]]
+#endif
+
#if defined(__cpp_lib_span) || (GTEST_INTERNAL_HAS_INCLUDE(<span>) && \
GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L)
#define GTEST_INTERNAL_HAS_STD_SPAN 1
diff --git a/third_party/googletest/googletest_deps.bzl b/third_party/googletest/googletest_deps.bzl
@@ -22,6 +22,22 @@ def googletest_deps():
urls = ["https://github.com/abseil/abseil-cpp/releases/download/20250814.0/abseil-cpp-20250814.0.tar.gz"],
)
+ if not native.existing_rule("bazel_features"):
+ http_archive(
+ name = "bazel_features",
+ sha256 = "9390b391a68d3b24aef7966bce8556d28003fe3f022a5008efc7807e8acaaf1a",
+ strip_prefix = "bazel_features-1.36.0",
+ url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.36.0/bazel_features-v1.36.0.tar.gz",
+ )
+
+ if not native.existing_rule("rules_cc"):
+ http_archive(
+ name = "rules_cc",
+ sha256 = "207ea073dd20a705f9e8bc5ac02f5203e9621fc672774bb1a0935aefab7aebfa",
+ strip_prefix = "rules_cc-0.2.8",
+ url = "https://github.com/bazelbuild/rules_cc/releases/download/0.2.8/rules_cc-0.2.8.tar.gz",
+ )
+
if not native.existing_rule("fuchsia_sdk"):
fake_fuchsia_sdk(
name = "fuchsia_sdk",
diff --git a/third_party/googletest/moz.yaml b/third_party/googletest/moz.yaml
@@ -10,9 +10,9 @@ origin:
url: https://google.github.io/googletest/
- release: 4969d0ad540da8fc9944e99457361dc7e35943c2 (2025-09-13T03:45:06Z).
+ release: 2ce9d8f2e85550a94d6ac977c881fe3658129ac6 (2025-10-13T13:51:01Z).
- revision: 4969d0ad540da8fc9944e99457361dc7e35943c2
+ revision: 2ce9d8f2e85550a94d6ac977c881fe3658129ac6
license: BSD-3-Clause
license-file: LICENSE