summaryrefslogtreecommitdiffstats
path: root/googlemock/include/gmock
Commit message (Collapse)AuthorAgeFilesLines
* Use matcher's description in AllOf if matcher has no explanation.Abseil Team2024-07-241-15/+29
| | | | | PiperOrigin-RevId: 655569834 Change-Id: Ia760d74d1cdde766e9719864c5e19c0159da3128
* gmock-actions: make DoAll convert to OnceAction via custom conversions.Aaron Jacobs2024-07-241-12/+50
| | | | | | | | | | | | | Currently it will refuse to become a `OnceAction` if its component sub-actions have an `Action` conversion operator but don't know about `OnceAction` in particular because although `Action` is convertible to `OnceAction`, the compiler won't follow the chain of conversions. Instead, teach it explicitly that it can always be a `OnceAction` when it can be an `Action`. PiperOrigin-RevId: 655393035 Change-Id: Ib205b518ceef5f256627f4b02cd93ec9bd98343b
* Run clang-format.Aaron Jacobs2024-07-234-11/+12
| | | | | PiperOrigin-RevId: 655106304 Change-Id: Ie69b407fce74b31cf71d6dcc1361910d30e86bb5
* Use matcher's description in AllOf if matcher has no explanation.Abseil Team2024-07-161-29/+15
| | | | | PiperOrigin-RevId: 652798234 Change-Id: I8e92248a2d9faf2a5719fe220145ea563acc14ff
* Use matcher's description in AllOf if matcher has no explanation.Abseil Team2024-07-151-15/+29
| | | | | PiperOrigin-RevId: 652634229 Change-Id: I5fd7eaef4db3dea3d4142e1fb5fc97e46f654358
* Use std::forward on GoogleTest matcher argumentsAbseil Team2024-05-061-2/+2
| | | | | | | This prevents a diagnostic from triggering for a missing std::move. PiperOrigin-RevId: 631094640 Change-Id: I4ab33964c65f41240fb54a6bf7d0261836fd78e7
* Use `[[maybe_unused]]` when it is available to avoidDerek Mauro2024-04-162-49/+49
| | | | | | | -Wused-but-marked-unused warnings PiperOrigin-RevId: 625430612 Change-Id: Ia9d2e47984e1e6f91966afae8a6750119ae69446
* [gtest] Use `std::index_sequence` and friends instead of rolling our ownLawrence Wolf-Sonkin2024-04-043-37/+39
| | | | | | | | | * Applies for `std::index_sequence`, `std::make_index_sequence`, and `std::index_sequence_for` replacing `IndexSequence`, `MakeIndexSequence` and IndexSequenceFor` * Also deleted implementation helper `DoubleSequence` * The standard interfaces [have been in the standard library since C++14](https://en.cppreference.com/w/cpp/utility/integer_sequence), which [is the minimum supported C++ version by Google Test](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md) PiperOrigin-RevId: 621939977 Change-Id: Id264266f08da66c0fa2a6e6fbb8f86fd3cb3a421
* Guard Abseil flags usage in googlemock with GTEST_NO_ABSL_FLAGS.Daniel Cheng2024-03-111-4/+4
| | | | | | | | googletest avoids using the Abseil flag library, so googlemock should do the same for consistency. PiperOrigin-RevId: 614713968 Change-Id: I0925804b8644ddc6fd3ad07a320d94829b11bb8e
* Accept one-shot callables in InvokeArgument.Abseil Team2024-02-291-2/+3
| | | | | PiperOrigin-RevId: 611467660 Change-Id: Ic89ffc986141bee61f835cb60088aee92eb8bad9
* Switch rank structs to be consistent with written guidance in ↵Matt Kulukundis2024-02-071-11/+12
| | | | | | | go/ranked-overloads PiperOrigin-RevId: 605110251 Change-Id: I304f3863333cb9ef0b85c5bab5277e757ef9950a
* Accept move-only callables in `InvokeArguments`Abseil Team2023-12-281-1/+1
| | | | | PiperOrigin-RevId: 594223533 Change-Id: I491fae7d851d4e0df07fb3627416949071fec8d6
* Implement `testing::Rethrow` to throw exceptions more easily via ↵Abseil Team2023-11-271-3/+21
| | | | | | | | | | | `std::exception_ptr` We avoid overloading or specializing `testing::Throw` as this is fundamentally a different operation than throwing the object. However, we disable the corresponding overload of `testing::Throw` to prevent likely mistakes in the usage. Fixes: #4412 PiperOrigin-RevId: 585745469 Change-Id: I03bb585427ce51983d914e88f2bf65a13545c920
* Export gmock-spec-builders.Abseil Team2023-10-261-0/+1
| | | | | | | | | gmock.h is the umbrella header to be used for rest of the library, and it also enables users to export certain details. This wasn't working for some interfaces like EXPECT_CALL because gmock-spec-builders wasn't explicitly exported. PiperOrigin-RevId: 576966583 Change-Id: Ie050430cf11384977cd95f4ed6e73235d6857057
* StartsWith: Explicitly construct matcher-typed strings from matchee parameterrefs/pull/4398/headDino Radakovic2023-10-231-2/+2
| | | | | | | | | The current implementation breaks for absl::string_view on gcc, c++14: https://godbolt.org/z/Tzd3q1fqx Closes #4391 PiperOrigin-RevId: 575853981 Change-Id: I7b782598add480eb69d4ca27ea4a4bf5f758f6a3
* Merge pull request #4374 from masbug:mainCopybara-Service2023-09-251-4/+5
|\ | | | | | | | | PiperOrigin-RevId: 568317621 Change-Id: Icf7fb519f96f5e88eb0df491eed143134c8ac6eb
| * Fix compile warnings in gmock-function-mocker.hrefs/pull/4374/headMitja Spes2023-09-211-4/+4
|/ | | | | Template type int changed to size_t. This fixes compile warning `conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result` in gmock-function-mocker.h.
* Update code with IWYU annotations.Abseil Team2023-09-181-7/+7
| | | | | PiperOrigin-RevId: 566424331 Change-Id: I0e16d979b9d79643c882c5082e154842983a5317
* Avoid unreachable code warningrefs/pull/4328/headRobert Shade2023-08-021-1/+7
|
* Use '=default' to define trivial constructor/destructorsrefs/pull/4221/headTom Hughes2023-04-214-9/+9
| | | | | | | https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html PiperOrigin-RevId: 526079054 Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
* Add missing std includesTom Hughes2023-04-201-0/+1
| | | | | PiperOrigin-RevId: 525850646 Change-Id: I64387f5b933beb79cd05636dca81b7a75213383e
* Merge pull request #4219 from jerylvaz:mainCopybara-Service2023-04-171-1/+2
|\ | | | | | | | | PiperOrigin-RevId: 524932412 Change-Id: Ie70282f7e82cb3b9442bd15bbe49bb9b00e56eb9
| * Suppress a clang-tidy warning in the MATCHER_P macrorefs/pull/4219/headJeryl Vaz2023-04-141-0/+1
|/
* Fix FunctionMocker compilation slowdown in ↵Abseil Team2023-04-111-18/+55
| | | | | | | | | | | 9d21db9e0a60a1ea61ec19331c9bc0dd33e907b1 The slowdown appears to be due to an implicit conversion of distinct (yet semantically identical) lambdas to `std::function`. Lifting out the lambdas into functors that don't get re-instantiated reduces compilation times by nearly half. Fixes #4156 PiperOrigin-RevId: 523447948 Change-Id: Ib0ae0761a54d7b1f2b706b14b2858eedf47e2297
* Fix redundant redeclaration warningDerek Mauro2023-03-281-0/+2
| | | | | | | Fixes #4200 PiperOrigin-RevId: 520017094 Change-Id: Id707a1c0489edde083771ccd412d7035612474dc
* Internal Code ChangeAbseil Team2023-03-211-5/+5
| | | | | PiperOrigin-RevId: 518213370 Change-Id: I88d0acc195dadf8d03cd15c8534c721141db14ea
* Internal Code ChangeAbseil Team2023-03-111-0/+1
| | | | | PiperOrigin-RevId: 515855852 Change-Id: I8016eefd45c36089e189bbd1ebbe9fdabe68255b
* [gtest] Drop custom-rolled heterogeneous comparator functors in favor of C++ ↵Lawrence Wolf-Sonkin2023-03-101-6/+7
| | | | | | | | | | standard ones * Standard heterogeneous comparator functors such as `std::equal_to<>` and `std::less<>` [have been available since C++14](https://en.cppreference.com/w/cpp/utility/functional/less_void) * Now that [C++14 is the minimum supported version of C++ in Googletest](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md), let's delete these duplications of the standard library PiperOrigin-RevId: 515743068 Change-Id: I1563a2f94039c3a6688429298555545a922f6d7e
* Internal Code ChangeAbseil Team2023-03-071-1/+2
| | | | | PiperOrigin-RevId: 514678702 Change-Id: I5b0089d905152ccb85022be395ed340e42586234
* Use "#ifdef GTEST_OS_..." instead of "#if GTEST_OS_..."Tom Hughes2023-03-062-3/+3
| | | | | | | This is compatible with compiling with "-Wundef" (#3267). PiperOrigin-RevId: 513943378 Change-Id: I47cf5fabbb77be061c4483a0adc54511af6b191c
* Fix GTEST_HAS_ABSL define check for [-Werror=undef] compilationsMartijn Vels2023-02-071-2/+2
| | | | | PiperOrigin-RevId: 507788664 Change-Id: Ib8cfbf3102a38e210fdae8a548fd84f0723ccc10
* Use GTEST_DISABLE_MSC_WARNINGS macros to disable warningsTom Hughes2023-01-304-30/+12
| | | | | | | | | Prior to this change we had a mixture of pragmas and GTEST_DISABLE_MSC_WARNINGS; this change consolidates all instances to use the macros. PiperOrigin-RevId: 505786926 Change-Id: I2be8f6304387393995081af42ed32c2ad1bba5a7
* Fix formatting of C++ filesTom Hughes2023-01-244-42/+43
| | | | | PiperOrigin-RevId: 504325204 Change-Id: Iaa1d6d0ab1dccaaeef26f9cb109d530835499240
* IWYU: Add missing std includesTom Hughes2023-01-052-0/+2
| | | | | PiperOrigin-RevId: 499893032 Change-Id: I33304802b7c82ae2d008f3ee89df38866e5f57ba
* Shut up a Clang warning.Abseil Team2022-12-151-1/+6
| | | | | | | | | | | | | | | Clang warns on this pattern because it looks like the author might have meant to use the value of the first part of the comma operator, so it warns that it isn't being used. The cast here signals to Clang that this behavior is intentional. This was discovered while updating gmock in Android. Clang's -Wcomma warning is on by default with either -Wall or -Werror, so users of gmock with those on in combination with -Werror are unable to build without this fix. PiperOrigin-RevId: 495655990 Change-Id: Iaf27e2199669f5b6185a877738234e551b6b6556
* Refactor matrix verification into VerifyMatchMatrix.refs/pull/4082/headAbseil Team2022-12-121-17/+0
| | | | | PiperOrigin-RevId: 494786543 Change-Id: I7769558dd2ca046d8957bf352dc04cfb48ff7c3a
* Make SizeIsMatcher::Impl conform to the contract of MatcherDescriberInterface.Abseil Team2022-11-301-2/+2
| | | | | | | MatcherDescriberInterface specifies that DescribeTo "should print a verb phrase", but "size ..." is not a verb phrase. Currently, ElementsAre(SizeIs(9)) is described as "has 1 element that size is equal to 9". With this change, it will be described as "has 1 element that has a size that is equal to 9". PiperOrigin-RevId: 492022324 Change-Id: I4083335f2419462464957521c1e033643b53b763
* Disables `-Wunused-member-function` and `-Wused-but-marked-unused` that ↵Abseil Team2022-11-293-3/+30
| | | | | | | | trigger via `MOCK_METHOD()` and `EXPECT_THAT()` macros. Fixes: #4052, #4055 PiperOrigin-RevId: 491647393 Change-Id: I8e2ad838156fa8c7e9dccd1740af797e694992b6
* Remove incorrect GTEST_ATTRIBUTE_UNUSED_ from InSequence class.Abseil Team2022-11-081-1/+1
| | | | | | Fixes: #4048 PiperOrigin-RevId: 486951561 Change-Id: I4fae101b5ac5ed4f46c32aba8c36519e1f784db1
* Merge pull request #4041 from zloylos:allow-naming-expectationsCopybara-Service2022-10-251-2/+29
|\ | | | | | | | | PiperOrigin-RevId: 483683590 Change-Id: Id22de3a22018324e5c1e21e262ac5e027a83bf3e
| * Fix format without expectation namerefs/pull/4041/headDenis Hananein2022-10-211-2/+2
| | | | | | | | Signed-off-by: Denis Hananein <i@zloylos.me>
| * Change messagesDenis Hananein2022-10-211-6/+6
| | | | | | | | Signed-off-by: Denis Hananein <i@zloylos.me>
| * Allow naming expectations #3970Denis Hananein2022-10-201-2/+21
|/ | | | Signed-off-by: Denis Hananein <i@zloylos.me>
* Workaround for Visual C++ error C2039 with std::tuple_element_t.Abseil Team2022-10-122-4/+15
| | | | | | | Fixes #3931 PiperOrigin-RevId: 480659507 Change-Id: I6fabef63b1285189a06375227273d9de2456e37a
* Remove obsolete MSVC warning pragmas for Invalid<T>()Abseil Team2022-09-081-11/+0
| | | | | | | | Remove the MSVC pragmas for disabling warning C4717 (infinite recursion) for Invalid<T>() because that warning has been fixed in cl/441474979. PiperOrigin-RevId: 473012585 Change-Id: I5f1bf88379bd4f2bf005e029c04766ac4caadd84
* Fixed header guards to match style guide conventions.Abseil Team2022-09-011-3/+3
| | | | | PiperOrigin-RevId: 471524660 Change-Id: Ie11e6a7a5a5497f64d5b9c382f1017094e043093
* Add support of 19-member structs to gmock UnpackStructImpl.Hardik Vala2022-08-221-0/+5
| | | | | PiperOrigin-RevId: 469171380 Change-Id: Ic75fc0523924e40e620552d4c04b79dad22a68e0
* Merge pull request #3918 from assafpr:master2mainCopybara-Service2022-08-012-2/+2
|\ | | | | | | | | PiperOrigin-RevId: 464586117 Change-Id: Icda62f13b962f7408bb5698ae2b627391257d152
| * Update gmock-matchers.hassafpr2022-06-271-1/+1
| | | | | | branch master changed to main on link
| * Update gmock-actions.hassafpr2022-06-271-1/+1
| | | | | | master branch changed to main in links