4555 Commits

Author SHA1 Message Date
Abseil Team
32c3dce34b Display the actual error code when RE::Init() fails
PiperOrigin-RevId: 865923485
Change-Id: I5530050f7ff3fe295e2bbd7ad0dd90cd0de3e2c3
2026-02-05 06:52:14 -08:00
Derek Mauro
872d386a87 Upgrade CI to XCode 26.2
The new build environment (Sequoia) does not have CMake
pre-installed, so install it, and set the variables necessary
for parallel builds.

PiperOrigin-RevId: 865468933
Change-Id: I0316281d0065bc52b653258556a6928faacb7c0e
2026-02-04 10:23:53 -08:00
Derek Mauro
2151d93c2f Update GoogleTest CI to latest tools
PiperOrigin-RevId: 865144486
Change-Id: I5d68e07bde952e7913d3e641dfaa10d17a968a58
2026-02-03 18:45:21 -08:00
Abseil Team
7c3b4d54e3 Automated Code Change
PiperOrigin-RevId: 864656526
Change-Id: If6e887f492d312730e7ab4e124cad23823497b0d
2026-02-02 20:35:39 -08:00
Abseil Team
56efe39831 Allow implicit matcher construction from nullptr. This allows "nullptr" to be used as a valid matcher for smart pointer types.
PiperOrigin-RevId: 861759501
Change-Id: I09ff55cd532014015725ec61356f480760819b29
2026-01-27 09:35:08 -08:00
Abseil Team
5fd443cdc3 Automated Code Change
PiperOrigin-RevId: 861479667
Change-Id: I3c64fef567065529f18a04b98df7b015256dfed1
2026-01-26 20:27:23 -08:00
Abseil Team
85087857ad Automated Code Change
PiperOrigin-RevId: 857421343
Change-Id: I6b64c34c1b0ccd31ec5277fbbdcc6c0e800e6241
2026-01-16 21:50:57 -08:00
Corentin Le Molgat
ff6133ab49 cmake: Fix declspec of gtest flag when using BUILD_SHARED_LIBS=ON and absl
On windows flags declaration must be prepend by `GTEST_API_`
to have the correct declspec (dllexport or dllimport)

This patch also fix super build integration of googletest by adding the necessary `INSTALL_RPATH` and `$<BUILD_INTERFACE:` needed to be able to `FetchContent` or `add_subdirectory()` googletest in a user CMake project.

Fix #4718
related to abseil/abseil-cpp#1817

PiperOrigin-RevId: 854187933
Change-Id: I4341fdb7e88a51c5f9a1c72c58bcc8c4d6bfd1c5
2026-01-09 07:34:16 -08:00
Derek Mauro
cb1bd88191 Bump Abseil version used by GoogleTest
Making this change requires an update to the CI scripts to ignore
warnings coming from external repositories so we don't error on
deprecation warnings (RE2 has warnings about deprecated Mutex methods)

PiperOrigin-RevId: 853824282
Change-Id: Ic79663943d3b7c8cfa95e9a73b49a7ad761e1eae
2026-01-08 11:37:01 -08:00
Abseil Team
5554fcaab4 Separate the creation of the Premature Exit File from supporting Death Tests.
The [Premature Exit File](https://google.github.io/googletest/advanced.html#detecting-test-premature-exit)
can be used for more than just death tests. Runners can use it to detect any
kind of unexpected exit.

Presently, its creation is tied to whether a platform supports Death
Tests. This change removes that coupling (though if Death Tests are supported,
then the Premature Exit file is implicitly supported).

PiperOrigin-RevId: 853416224
Change-Id: I5354730b82bc8a20981120f4e1df59b58cb31f6e
2026-01-07 14:34:06 -08:00
Derek Mauro
7d7e750850 Fix "error: standard attributes in middle of decl-specifiers"
Between the friend declaration, visibility declaration, and
attribute placement rules, compilers can't seem to agree on the
how to write this, so I switched to a static factory function.

Fixes https://github.com/google/googletest/issues/4881

PiperOrigin-RevId: 852842303
Change-Id: I7fe737819abf05ea2911693f8d93683446e326cc
2026-01-06 10:37:35 -08:00
Abseil Team
76cd89bcf1 Point from the "Defining Matchers" section in the reference doc to the cookbook, which is much more detailed.
PiperOrigin-RevId: 852639172
Change-Id: Ia39a01702c7c64404950a1be19b1ebdfdff8f010
2026-01-06 00:09:54 -08:00
Abseil Team
9156d4caac Automated Code Change
PiperOrigin-RevId: 845060939
Change-Id: Iab4c4a0842e79f5835d84fa892ee977d9bdf0fe0
2025-12-15 21:11:24 -08:00
Chris Kennelly
065127f1e4 Add [[nodiscard]] throughput Google Test.
`EXPECT_THAT(foo, Matcher(bar))` can sometimes get accidentally written as a
no-op `foo, Matcher(bar)`, causing the code to be exercised but defeating the
purpose of testing.

PiperOrigin-RevId: 841880995
Change-Id: Ia55548e3dd83a6f44fff7b5433c8c8ecd7ecbe03
2025-12-08 12:55:11 -08:00
Derek Mauro
1b96fa13f5 Switch to referenceful lock holder for Abseil compatibility
PiperOrigin-RevId: 831156684
Change-Id: I8a8b017ec2fc318a65f57e04428c030c707ee682
2025-11-11 18:56:52 -08:00
Abseil Team
085af2cc08 Automated rollback of commit 37678c92fb183b148163dd173430b4ab88586a26.
PiperOrigin-RevId: 829765029
Change-Id: Ia5534b109e0abfd17a74d89ce58d6588a6255f94
2025-11-08 02:53:26 -08:00
Abseil Team
37678c92fb gtest_fail_if_no_test_selected: Rephrase error message.
Sharded tests interact awkwardly with --gtest_fail_if_no_test_selected, but we
can't speak clearly enough to the use cases to complicate the mental model, so
instead we attempt to clarify the simplest approach to debugging a single test
when sharding and --gtest_fail_if_no_test_selected are both in use: unset the
flag.

PiperOrigin-RevId: 829686145
Change-Id: I9ebbddc6e7537feefe2a3707fd323fc9132b99d1
2025-11-07 20:50:29 -08:00
David Pizzuto
dedab73a68 gtest_fail_if_no_test_selected: Rephrase error message.
Sharded tests interact awkwardly with --gtest_fail_if_no_test_selected, but we
can't speak clearly enough to the use cases to complicate the mental model, so
instead we attempt to clarify the simplest approach to debugging a single test
when sharding and --gtest_fail_if_no_test_selected are both in use: unset the
flag.

PiperOrigin-RevId: 829609266
Change-Id: I090d5bfac979171532249e9312feef8d9aad5f16
2025-11-07 16:02:48 -08:00
Abseil Team
6ec14dfd8c Modernize example of combining matchers.
As of C++14 an ordinary function can have an `auto` return type.

PiperOrigin-RevId: 826617761
Change-Id: I2ceecc8430643c0ac7843fb216b5a117cfe10ab3
2025-10-31 13:56:00 -07:00
Justin Bassett
17d335d7c7 Remove short-circuiting from AllOf, for better failure messages
For `EXPECT_THAT` matcher usage, showing only the first failure meant
that users would sometimes have to make a fix and run the test again
only to notice that there's another failure. It's better to show more
failures so that the user can fix several issues in one go.

In practice, very little code actually wants the short circuiting here,
only a handful of cases with custom matchers used like
`AllOf(BoundsCheck(), UncheckedAccess())`. These cases are fixable by
refactoring `UncheckedAccess()` to instead also apply a bounds check to
fail the matcher rather than crash. Notably, this change doesn't affect
`AnyOf`, so another workaround is to change `AllOf(m1, m2, ...)` into
`Not(AnyOf(Not(m1), Not(m2), ...))`.

PiperOrigin-RevId: 826316273
Change-Id: Ie8186f75c10443d8da35b5d07b6a8cd9ae85b451
2025-10-30 21:53:01 -07:00
Derek Mauro
4fe3307fb2 macOS CI: Move the Bazel vendor_dir to ${HOME} to workaround a Bazel issue
where it does not work when it is in ${TMP} and also fix the quoting
which was causing it to incorrectly receive the argument

https://github.com/bazelbuild/bazel/issues/27156

PiperOrigin-RevId: 826083231
Change-Id: If8f069c42c62434893db27bdaae0b0e25b67839d
2025-10-30 10:11:17 -07:00
Abseil Team
b2b9072ecb Mark InternalDefaultActionSetAt as nodiscard.
PiperOrigin-RevId: 820207225
Change-Id: I8e053f724c18b466bd287f80a720542a535615d2
2025-10-16 06:31:44 -07:00
Abseil Team
e17e37a115 Automated Code Change
PiperOrigin-RevId: 820039898
Change-Id: I910d8ec41198794e7344a2d79566a19243532251
2025-10-15 21:01:54 -07:00
Abseil Team
8dbd60f7d5 Restore the documentation of AnyWith<T>(m) in the matchers reference.
PiperOrigin-RevId: 818813216
Change-Id: If4cb881a61a05b2c6634aa0d5ee66ea2962f168a
2025-10-13 13:44:23 -07:00
Abseil Team
2ce9d8f2e8 Allow for passing non-pointers to DeleteArg and have them emit a deprecation warning instead.
This allows for simpler migration of function args to smart pointers without needing all changes to tests to be atomic.

PiperOrigin-RevId: 818635600
Change-Id: I9434685d9640f82b98d0b5261701b78c93d3ec1e
2025-10-13 06:51:01 -07:00
Abseil Team
279f847946 Fix typo.
PiperOrigin-RevId: 816417379
Change-Id: I4ccfe2bf291b8c2b318ac6e2d0c2d176684e42c8
2025-10-07 16:03:37 -07:00
Abseil Team
de1c609262 Automated Code Change
PiperOrigin-RevId: 816182689
Change-Id: Ie2aaa55be6c2e4508aaafa7a0b30fe52ec334893
2025-10-07 06:39:30 -07:00
Abseil Team
9706f75b8f Automated Code Change
PiperOrigin-RevId: 813050069
Change-Id: I7c778db5bda5d681097af5d3569b5f4b980603e4
2025-09-29 20:05:42 -07:00
Derek Mauro
50b8600c63 Add rules_cc dependency, required by Bazel going forward
This also adds the dependencies of rules_cc to WORKSPACE.
bzlmod automatically pulls in dependencies.
skylib is removed as it is pulled in by a deps function.

PiperOrigin-RevId: 808659470
Change-Id: Idc41cad7b05019793d4a1898bdb80bc4797da5cf
2025-09-18 11:16:02 -07:00
Derek Mauro
0934b7e112 Use an internal symbol for deprecate-and-inline that allows
the use of a deprecation message

PiperOrigin-RevId: 807753856
Change-Id: I34b0c7c6faf34cad11ea2aca5ccd16bca16acdec
2025-09-16 10:39:10 -07:00
Abseil Team
4969d0ad54 Automated Code Change
PiperOrigin-RevId: 806527439
Change-Id: I2e9aa5de44c011938e0bfc8e86af6c7d10c23ab0
2025-09-12 20:45:06 -07:00
Derek Mauro
9df216cc9d Update spelling of Mutex::lock and Mutex::unlock for compatibility
with the standard and the latest Abseil

PiperOrigin-RevId: 806260850
Change-Id: Ie973be4a3aaf7e174cd692ce6df7a82c8f261bf7
2025-09-12 06:17:43 -07:00
Derek Mauro
7917641ff9 Bump Abseil dependency to 20250814.0
PiperOrigin-RevId: 802131359
Change-Id: I96671848148ca51c755c1b3598af32a444ac9739
2025-09-02 07:15:01 -07:00
Abseil Team
eb2d85edd0 Remove unused syslog dependency for Fuchsia.
PiperOrigin-RevId: 798883577
Change-Id: Id248b44a45c6d3eb173513b1cd2bb8fb564885ed
2025-08-24 14:51:30 -07:00
Abseil Team
6986c2b575 Internal header include changes.
PiperOrigin-RevId: 797151958
Change-Id: I26ce36684e8822cd76723e664782764cf222152c
2025-08-19 22:05:22 -07:00
Abseil Team
a05c091507 Deprecate single-argument DoAll and Invoke.
PiperOrigin-RevId: 795969677
Change-Id: I56d88ec715475d91fb527a9281bc62574fb4608b
2025-08-16 20:08:07 -07:00
Abseil Team
244cec869d Update the document in typed tests to use using-declaration instead of typedef
PiperOrigin-RevId: 793600153
Change-Id: I0c78f180f3b681ef20133af2cc822af66c3344fe
2025-08-11 05:10:05 -07:00
Abseil Team
373af2e3df Provide a better error message when ASSERT and SKIP macros are used in methods that return values
PiperOrigin-RevId: 788083860
Change-Id: I91583f0c0f816144428d56ab07e58fd035c532d1
2025-07-28 11:13:39 -07:00
Abseil Team
32f9f4c82a Skip the predicate on SIGSEGV in death-test on Android builds with API level <= 23.
PiperOrigin-RevId: 786394374
Change-Id: I5188b55ae8ae6d3188e6492f3865b21ae6d2285e
2025-07-23 13:04:17 -07:00
Abseil Team
7e17b15f15 Fix the sample usage of ConvertGenerator by removing the type-id name.
PiperOrigin-RevId: 784561837
Change-Id: I6792fdde81762797c64ac24d297d93938932aef4
2025-07-18 06:24:47 -07:00
Abseil Team
309dab8d4b Automated Code Change
PiperOrigin-RevId: 782277586
Change-Id: Idd7ffd0a585fa8b307ecafb8b3d53abbf124a774
2025-07-12 02:06:50 -07:00
Abseil Team
3983f67e32 Replace internal link in GoogleTest docs
Replace an internal link to AbslStringify's documentation with the equivalent public link.

PiperOrigin-RevId: 779085254
Change-Id: I2cbd2b6262a5ced06f166d4fcc7c08796e5a60af
2025-07-04 01:14:13 -07:00
David Pizzuto
c67de11737 gtest: Reword fail_if_no_test_selected_message for sharding and filtering.
Users have shown some confusion about the interaction between this flag,
sharding, and --gtest_filter, so let's provide some more information.

PiperOrigin-RevId: 776734799
Change-Id: Icdcf6aa056988095f15588758994604d326c0567
2025-06-27 15:18:25 -07:00
Copybara-Service
a45468c0fc Merge pull request #4694 from chromy:main
PiperOrigin-RevId: 775667059
Change-Id: I07edd44ae368ae640d7b985800ffee8cc663c07f
2025-06-25 06:46:45 -07:00
Abseil Team
f8ed0e687c Add documentation for exception matchers.
PiperOrigin-RevId: 775205267
Change-Id: I3ad59ff4b1fa095cbf7dd04dd97a152cb33c7435
2025-06-24 06:22:36 -07:00
Abseil Team
35b75a2cba Although the following paragraph explains there is a better solution, having this technique in the bullet point seems to suggest that this technique is considered as a valid alternative. It would be better to drop it or make it clear that this technique is not recommended.
PiperOrigin-RevId: 771116391
Change-Id: I753560115ed65e8858b749473935df57b6a50488
2025-06-13 09:13:47 -07:00
Abseil Team
175c1b55cf Add UnpackStructImpl for structs with 24, 25 and 26 fields.
PiperOrigin-RevId: 770690821
Change-Id: Ic759e29f46a34d0f2c0ef831e0ddc784290a938f
2025-06-12 09:37:31 -07:00
Copybara-Service
1aeec48a1d Merge pull request #4774 from joel-langlois:FixReadme
PiperOrigin-RevId: 770642738
Change-Id: Ie8e8f12f82737f4eb614862334ff0a89583aeafc
2025-06-12 07:21:58 -07:00
Joël Langlois
0fe21ac6ef README.md: Fixed broken Markdown link formatting. 2025-06-11 12:28:02 -04:00
Abseil Team
fd15f51d57 Automated Code Change
PiperOrigin-RevId: 769938700
Change-Id: I3f36d03a5d54f1f2fbeda9fbaa5e205736c3cdbc
2025-06-10 21:03:35 -07:00