summaryrefslogtreecommitdiffstats
path: root/googlemock
Commit message (Collapse)AuthorAgeFilesLines
* Support move-only and &&-qualified actions in DoAll.Aaron Jacobs2022-04-263-258/+480
| | | | | | | | This is necessary for generic support of these actions, since `DoAll` is a frequently-used action wrapper. PiperOrigin-RevId: 444561964 Change-Id: I02edb55e35ab4207fbd71e371255a319c8253136
* Remove the legacy internal GTEST_DISALLOW_* macrosDerek Mauro2022-04-2217-46/+101
| | | | | PiperOrigin-RevId: 443715444 Change-Id: I3ffd54b63d2728ae4a668ee7875c8c3c8188087c
* Eliminate the legacy GTEST_COMPILE_ASSERT_ macroDerek Mauro2022-04-212-26/+23
| | | | | PiperOrigin-RevId: 443462203 Change-Id: I0c43f981663a7531ff5da4d4be01fb3d6762273d
* Document two surprises in `DoAllAction::NonFinalType`.Aaron Jacobs2022-04-132-0/+128
| | | | | PiperOrigin-RevId: 441589196 Change-Id: Ic3e483ca70d72261046bad464d817f9dfd4bec65
* Replace infinite recursion call (intentionally invoking undefined behavior ↵Abseil Team2022-04-131-3/+6
| | | | | | | to indicate unreachability) with explicit unreachability marker. PiperOrigin-RevId: 441474979 Change-Id: I1fcbb437026631212fec954c663482bb7e1cf819
* Add support for move-only and &&-qualified actions in WillOnce.Abseil Team2022-04-093-34/+581
| | | | | | | | | | | | This provides a type-safe way for an action to express that it wants to be called only once, or to capture move-only objects. It is a generalization of the type system-evading hack in ByMove, with the improvement that it works for _any_ action (including user-defined ones), and correctly expresses that the action can only be used with WillOnce. I'll make existing actions benefit in a future commit. PiperOrigin-RevId: 440496139 Change-Id: I4145d191cca5655995ef41360bb126c123cb41d3
* gmock: improve SFINAE for actions involving arguments.Abseil Team2022-04-042-2/+4
| | | | | | | | Avoid instantiating functions like std::get<index> for an out of range index when doing SFINAE on the invocability of the action itself. PiperOrigin-RevId: 439415110 Change-Id: Ifc20285a6d526c34830870cd1910c2b2b92e1e81
* Use ResultOf()'s result_description when explaining match result.Abseil Team2022-04-042-1/+16
| | | | | PiperOrigin-RevId: 439389646 Change-Id: Ie34adcdd2b24378e85962efac53b7bb89ed93803
* Use the Abseil flags library when Abseil is presentDerek Mauro2022-04-041-20/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | When built with `--define=absl=1` under Bazel, GoogleTest flags use ABSL_FLAG instead of GoogleTest's own implementation. There are some minor behavior differences in this mode. The most notable difference is that unrecognized flags result in a flag parsing error, and are not returned to the user though a modified argc/argv, unless they appear after the positional argument delimiter ("--"). For example, to pass a non-Abseil flag, you would have to do ./mytest --gtest_color=false -- --myflag=myvalue The documentation at https://abseil.io/docs/cpp/guides/flags may be helpful in understanding the behavior. There are some other minor differences. For example, passing --help results in the program returning 1 instead of 0. https://github.com/google/googletest/issues/3646 PiperOrigin-RevId: 439312700 Change-Id: Id696a25f50f24a5b1785c45ca8fa59794f86fd5c
* Address deprecation warning surfaced by Github presubmit testsAbseil Team2022-03-231-4/+4
| | | | | PiperOrigin-RevId: 436839469 Change-Id: I2bb90dce524c16bcc31569bb98772dcc62d08fbf
* Split gmock-matchers_test into 4 smaller test #3653Mattias Ellert2022-03-239-8645/+8857
| | | | | | | | | The one large test does not link in limited memory environments Closes #3653 PiperOrigin-RevId: 436753193 Change-Id: Idd59b6509994fc642147b88279ee791cd1d7bdd0
* Merge branch 'main' into promote-inclusive-behaviorrefs/pull/3779/headBrad Messer2022-03-1832-1940/+1678
|\
| * Running clang-format over all of GoogleTestAbseil Team2022-03-1532-1940/+1678
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few tests are examining code locations and looking af the resulting line numbers to verify that GoogleTest shows those to users correctly. Some of those locations change when clang-format is run. For those locations, I've wrapped portions in: // clang-format off ... // clang-format on There may be other locations that are currently not tickled by running clang-format. PiperOrigin-RevId: 434844712 Change-Id: I3a9f0a6f39eff741c576b6de389bef9b1d11139d
* | Remove sanity as it is offensive to neurodiverse individuals.Brad Messer2022-03-181-1/+1
|/
* Mark ACTION_Pn()-generated functions as must-use-result, adding ↵Abseil Team2022-03-081-0/+3
| | | | | | | | | | | | | non-compilation tests. This catches when a client creates an action and discards it, thinking that the action has actually been applied to something. This will help people who make the mistake of defining, for example, both `void Use(Foo*, Bar)` and `ACTION_P(Use, bar) { Use(arg, bar); }` for later application to a Foo. With such an overload, a client may then write `Use(bar);`, selecting the Action<> overload and being confused why nothing happens. This also catches when a client defines their own action in terms of an ACTION_P()-generated one, invokes the Action<>'s builder, and then fails to invoke the resulting action, thinking it's operating on the outer action's parameters. PiperOrigin-RevId: 433197479 Change-Id: I98e4389150d01a5e753230113016d9fc38b1d260
* Add a 3-arg overload for ResultOf() matcher that takes a description string ↵Abseil Team2022-02-102-6/+47
| | | | | | | for better error messages. PiperOrigin-RevId: 427598749 Change-Id: I8c7a5d7b2dde017641534f1c7eed8dd56c33e845
* Merge pull request #3617 from Bagira80:fix_3616Copybara-Service2022-02-071-2/+3
|\ | | | | | | | | PiperOrigin-RevId: 426976022 Change-Id: Ib9f49cf84775a50cbc806d331349e61a1060b498
| * CMake: Fix values of INTERFACE_INCLUDE_DIRECTORIES propertyrefs/pull/3617/headDeniz Bahadir2021-10-191-2/+3
| | | | | | | | | | | | | | | | | | | | Replace semicolon by `$<SEMICOLON>` in generator-expressions of target property `INTERFACE_INCLUDE_DIRECTORIES` of CMake targets `gtest`, `gtest_main`, `gmock` and `gmock_main`. Fixes: #3616 Signed-off-by: Deniz Bahadir <deniz@code.bahadir.email>
* | Change `ReturnArg` to use perfect forwarding of arguments (#3733)Dino Radakovic2022-01-262-3/+9
| | | | | | | | | | PiperOrigin-RevId: 424355706 Change-Id: I618e5574b4b2c56a343905c20d8cc6d2a70cbcd1
* | Consistently apply IWYU pragmas across googletest and googlemock headersAbseil Team2022-01-1814-11/+42
| | | | | | | | | | PiperOrigin-RevId: 422559250 Change-Id: I9f630f2186724950e5e9fbd7093d5264e8bf0a71
* | Merge pull request #3725 from bsilver8192:remove-another-disallow-assignCopybara-Service2022-01-111-189/+162
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 421044680 Change-Id: If585089811f1b67eab6f339125c27174ee5bc290
| * | Remove another GTEST_DISALLOW_ASSIGN_ that crept inrefs/pull/3725/headBrian2022-01-061-2/+0
|/ / | | | | | | | | | | They were all removed in #2815, but it looks like this one got added from a Google export which missed the update. See #2815 for reasons why removing this is desirable.
* | Include the param names in the generated description of the MATCHER_P matchers.Abseil Team2021-12-277-65/+83
| | | | | | | | | | PiperOrigin-RevId: 418497526 Change-Id: Ie53c3c0810c10a32cbcb941e3ca1ee8fb1ddd9f9
* | Makes the Python imports consistently use full paths from the repository root,Derek Mauro2021-12-223-15/+3
| | | | | | | | | | | | | | | | | | unifying the behavior between Bazel and CMake This fixes one of the CI failures on Windows PiperOrigin-RevId: 417872531 Change-Id: I156989323b7e6d4a4420f4f9691b078829db933d
* | Support std::reference_wapper as a smart pointer type in gmockAbseil Team2021-12-032-0/+13
| | | | | | | | | | PiperOrigin-RevId: 413963503 Change-Id: I33440780bf087698f4e4325399227405885430b3
* | fix a typorefs/pull/3664/headKrystian Kuzniarek2021-11-161-1/+1
| |
* | Clarify "Times() after X" error messageTaylor Cramer2021-11-152-5/+5
| | | | | | | | | | | | | | | | The previous error message could be misinterpreted to mean that `Times` could not be used in combination with `WillRepeatedly`, when in fact the call to `Times` just needs to happen *first*. PiperOrigin-RevId: 410070405 Change-Id: I747d34a4334cf2e56d589dcad3a08a8f322d77c8
* | Fix typo in gmock-matchers_test.cc: CanDescribeNegationOfExpectingOneElment ↵Abseil Team2021-11-121-1/+1
| | | | | | | | | | | | | | => CanDescribeNegationOfExpectingOneElement PiperOrigin-RevId: 409484263 Change-Id: I7448d6f04a9868602e0bc8dec40ea3eb63d3e387
* | Replace use of deprecated std::iteratorrefs/pull/3650/headRaul Tambre2021-11-051-5/+7
| | | | | | | | This was deprecated by P0174 in C++17.
* | Googletest exportAbseil Team2021-11-031-3/+3
|/ | | | | | Internal change PiperOrigin-RevId: 405710296
* Merge pull request #3581 from cclauss:codespelldinord2021-10-053-3/+3
|\ | | | | | | PiperOrigin-RevId: 400792845
| * Fix remaining typos discovered by codespellrefs/pull/3581/headChristian Clauss2021-09-243-3/+3
| |
* | Googletest exportAbseil Team2021-09-282-10/+8
|/ | | | | | | | Ensure `.what()` is printed in `ThrowsMessage(...)` to address https://github.com/google/googletest/issues/3582 Closes #3582 PiperOrigin-RevId: 399462851
* Merge pull request #3195 from Inujel:fix-3194dinord2021-09-231-10/+7
|\ | | | | | | PiperOrigin-RevId: 398271948
| * Using auto instead of container::const_iteratorrefs/pull/3195/headJulien JEMINE2020-12-291-10/+7
| |
* | Merge pull request #3574 from Vertexwahn:switch_to_native_cc_rulesdinord2021-09-231-1/+0
|\ \ | | | | | | | | | PiperOrigin-RevId: 397995447
| * | Remove bazelbuild/rules_cc dependencyrefs/pull/3574/headVertexwahn2021-09-171-1/+0
| | |
* | | Internal changeAbseil Team2021-09-231-6/+6
|/ / | | | | | | PiperOrigin-RevId: 397651677
* | Googletest exportdmauro2021-09-151-4/+0
| | | | | | | | | | | | Delete unsupported/deprecated scripts PiperOrigin-RevId: 396847020
* | Googletest exportAbseil Team2021-09-151-2/+2
| | | | | | | | | | | | | | gmock-internal-utils.cc: Use `static_cast` instead of implicit conversion between signed and unsigned types Fixes #3550 PiperOrigin-RevId: 396826071
* | Googletest exportdmauro2021-09-151-0/+4
| | | | | | | | | | | | Rollback delete of unsupported/deprecated scripts PiperOrigin-RevId: 396699187
* | Googletest exportdmauro2021-09-151-4/+0
| | | | | | | | | | | | Delete unsupported/deprecated scripts PiperOrigin-RevId: 396685976
* | Googletest exportAbseil Team2021-09-1524-3735/+151
| | | | | | | | | | | | Introduce GMOCK_FLAG_GET and GMOCK_FLAG_SET macros. PiperOrigin-RevId: 396649214
* | Googletest exportAbseil Team2021-08-241-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump `cmake_minimum_required` to 3.5. Delete conditional branches exclusive to older versions. Notable dependents: - github.com/grpc/grpc >= 3.5.1 - github.com/abseil/abseil-cpp >= 3.5 - github.com/googleapis/google-cloud-cpp >= 3.5 On the other hand, github.com/protocolbuffers/protobuf is >= 3.1.3, but it only depends on GoogleTest 1.10. Fixes #3523 PiperOrigin-RevId: 392073834
* | Merge pull request #3504 from duianto:patch-1Derek Mauro2021-08-131-1/+1
|\ \ | | | | | | | | | PiperOrigin-RevId: 390486428
| * | Typo, double "the"refs/pull/3504/headduianto2021-07-291-1/+1
| | |
* | | Googletest exportAbseil Team2021-08-131-43/+77
| | | | | | | | | | | | | | | | | | Identify bad specs of the type (const something, ...). PiperOrigin-RevId: 390346843
* | | Internal changeAbseil Team2021-08-061-1/+1
| | | | | | | | | | | | PiperOrigin-RevId: 389163232
* | | Googletest exportAbseil Team2021-08-045-0/+170
|/ / | | | | | | | | | | Introduce a new matcher for unescaping Base-64 strings to gmock. PiperOrigin-RevId: 388471904
* | fix: typo codespelling commentrefs/pull/3499/headslowy072021-07-243-3/+3
| |