summaryrefslogtreecommitdiffstats
path: root/googlemock/test
Commit message (Collapse)AuthorAgeFilesLines
* chore: fix spellingJohn Bampton2021-04-151-1/+1
|
* Googletest exportAbseil Team2021-03-041-2/+2
| | | | | | Format WORKSPACE and googlemock/test/BUILD.bazel using buildifier PiperOrigin-RevId: 360913861
* Googletest exportAbseil Team2021-02-182-6/+6
| | | | | | | | Update stale links to `gmock_cook_book.md`. I'm a new googletest user and found these links broken when reading the documentation. PiperOrigin-RevId: 357786392
* Googletest exportAbseil Team2021-02-181-3/+3
| | | | | | Make include guards conform with https://google.github.io/styleguide/cppguide.html#The__define_Guard, attempt #2 PiperOrigin-RevId: 357056902
* Googletest exportAbseil Team2021-02-111-3/+3
| | | | | | Revert include guard fix PiperOrigin-RevId: 356588893
* Googletest exportAbseil Team2021-02-111-3/+3
| | | | | | Make include guards conform with https://google.github.io/styleguide/cppguide.html#The__define_Guard PiperOrigin-RevId: 355882793
* Googletest exportAbseil Team2021-02-052-59/+0
| | | | | | Remove uses of GTEST_HAS_TYPED_TEST_P and GTEST_HAS_TYPED_TEST. PiperOrigin-RevId: 353935996
* Googletest exportofats2021-01-266-1573/+869
| | | | | | Remove scripts for code generating together with related files. PiperOrigin-RevId: 352805926
* Googletest exportAbseil Team2021-01-262-0/+307
| | | | | | Merge CONTRIBUTORS, delete LICENSEs in googletest/ and googlemock/ PiperOrigin-RevId: 352558822
* Googletest exportAbseil Team2021-01-131-1/+1
| | | | | | | | | | | | Change Matcher<T> to allow binding an implementation by value directly: - Drop the requirement of MatcherInterface. Doing manual type erasure avoid extra layers in many cases. - Avoid the adaptor for `MatcherInterface<T>` and `MatcherInterface<const T&>` mismatch. - Use a small object optimization when possible. This makes things like `_` and `Eq(1)` really cheap and do not require memory allocations. - Migrate some matchers to the new model to speed them up and to test the new framework. More matchers to come in future changes. PiperOrigin-RevId: 350580998
* Googletest exportAbseil Team2020-12-221-0/+39
| | | | | | | | | Give each of Naggy/Nice/StrictMock a base class whose constructor runs before the mocked class's constructor, and a destructor that runs after the mocked class's destructor, so that any mock methods run in either the constructor or destructor use the same strictness as other calls. PiperOrigin-RevId: 348511612
* Googletest exportdmauro2020-12-221-0/+8
| | | | | | Internal Change PiperOrigin-RevId: 347631521
* Googletest exportdmauro2020-12-101-0/+3
| | | | | | Fix a missing Bazel build dependency PiperOrigin-RevId: 346783462
* Googletest exportAbseil Team2020-12-081-0/+40
| | | | | | Introduce a new `Address` matcher to gmock. PiperOrigin-RevId: 346344591
* Googletest exportAbseil Team2020-12-072-14/+59
| | | | | | | | | Add a `Pointer` matcher as an analog to `Pointee`. Similar to `Pointee`, `Pointer` works with either raw or smart pointers and allows creating a matcher like Pointer(Eq(foo)) for smart pointers. PiperOrigin-RevId: 346164768
* Googletest exportAbseil Team2020-12-031-0/+5
| | | | | | Disable a gmock matcher test under MSVC 2015 (version 14) and earlier. It interacts badly with Windows structured exceptions in a way we do not have the resources to investigate. This test passes under MSVC 2017 and SEH. PiperOrigin-RevId: 345496734
* Googletest exportAbseil Team2020-11-091-0/+7
| | | | | | | | | | | | | | | | GMock: Make Truly explain when it fails I just wrote a test that had a matcher of the form Optional(AllOf( SomeMatcher, SomeOtherMatcher, Truly(SomePredicate))) The predicate failed, the other two matchers succeeded, and I got a hard-to-interpret message saying that the value in the optional "didn't match". Didn't match what? This change improves situations like that slightly by having Truly explain to its result listener when it fails. When there are multiple Trulys in an AllOf, there will be some ambiguity, but it will at least provide more information than right now. PiperOrigin-RevId: 341105141
* Googletest exportAbseil Team2020-11-061-0/+66
| | | | | | Add support for ref qualifiers in MOCK_METHOD. PiperOrigin-RevId: 341047839
* Googletest exportAbseil Team2020-10-141-0/+141
| | | | | Add ::testing::FieldsAre matcher for objects that support get<> and structured bindings. PiperOrigin-RevId: 337165285
* Googletest exportAbseil Team2020-08-261-4/+2
| | | | | | | | Replace uses of ACTION_TEMPLATE and ACTION_P with manually written functors. The latter provide better error diagnostics. This fixes https://github.com/google/googletest/issues/2729. PiperOrigin-RevId: 328573022
* Merge pull request #2904 from AmatanHead:throw-matchersvslashg2020-08-231-0/+184
|\ | | | | | | PiperOrigin-RevId: 327294137
| * Remove ThrowsMessageHasSubstr and fix some nits after reviewVladimir Goncharov2020-08-031-49/+18
| |
| * Fix build under msvcVladimir Goncharov2020-08-031-5/+5
| |
| * Update tests after changing an error messageVladimir Goncharov2020-08-031-2/+2
| |
| * Add a test to ensure that the `Throws` matcher only invokes its argument once.Vladimir Goncharov2020-08-031-0/+30
| |
| * Add a test for duplicate catch clauses in throw matchers, fix a couple of ↵Vladimir Goncharov2020-08-031-0/+6
| | | | | | | | nitpicks.
| * Add missing documentation pieceVladimir Goncharov2020-08-031-0/+20
| |
| * Small improvements: code style and property nameVladimir Goncharov2020-08-031-4/+2
| |
| * Add matchers for testing exception propertiesVladimir Goncharov2020-08-031-0/+182
| | | | | | | | | | | | This PR adds matchers that accept a callable and verify that when invoked, it throws an exception with the given type and properties. Fixes #952
* | Googletest exportAbseil Team2020-08-231-0/+27
| | | | | | | | | | | | | | | | | | Fix DoAll to work with move-only sink arguments. This changes types of the first n - 1 actions so that they only get a readonly view of the arguments. The last action will accept move only objects. PiperOrigin-RevId: 327031893
* | Googletest exportAbseil Team2020-08-071-0/+29
| | | | | | | | | | | | | | | | | | | | Fixing exception-safety bug in googletest. Previously, if an exception was thrown during a call to a mock that would have triggered an error, the error was discarded. Fixes #2890 PiperOrigin-RevId: 325017806
* | Googletest exportAbseil Team2020-08-071-9/+0
| | | | | | | | | | | | | | | | | | Fix DoAll to work with move-only sink arguments. This changes types of the first n - 1 actions so that they only get a readonly view of the arguments. The last action will accept move only objects. PiperOrigin-RevId: 324619666
* | Googletest exportAbseil Team2020-08-071-0/+9
|/ | | | | | | | | Fix DoAll to work with move-only sink arguments. This changes types of the first n - 1 actions so that they only get a readonly view of the arguments. The last action will accept move only objects. PiperOrigin-RevId: 324600664
* Googletest exportofats2020-07-155-1482/+1167
| | | | | | Move matchers' tests from *generated* to common files. PiperOrigin-RevId: 320954068
* Merge pull request #2903 from AmatanHead:informative-exception-assertsvslashg2020-07-152-0/+160
|\ | | | | | | PiperOrigin-RevId: 320425648
* | Googletest exportAbseil Team2020-07-091-1/+1
|/ | | | | Cleanup: Error message grammar fix. PiperOrigin-RevId: 319992912
* Googletest exportAbseil Team2020-06-101-9/+36
| | | | | | Change string matchers, like HasSubstr, to accept `string_view` input if available. PiperOrigin-RevId: 315726484
* Googletest exportdurandal2020-05-281-3/+5
| | | | | | Silence MSVC C4100 (unused formal parameter) to fix breakage from recently added testcase. This warning is silenced in many files throughout googletest, but was not needed here until this testcase was added. PiperOrigin-RevId: 312121200
* Googletest exportAbseil Team2020-05-281-0/+20
| | | | | | | | Fix the ACTION* macros to allow for more than 10 arguments in the action. Only the first 10 will be passed as individual arguments as `argN`, but the rest can be accessed from the `args` tuple. PiperOrigin-RevId: 311542098
* Merge pull request #2815 from Quuxplusone:simpleGennadiy Rozental2020-05-012-8/+0
|\ | | | | | | PiperOrigin-RevId: 308625388
| * Remove all uses of GTEST_DISALLOW_{MOVE_,}ASSIGN_.Arthur O'Dwyer2020-04-232-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | None of these are strictly needed for correctness. A large number of them (maybe all of them?) trigger `-Wdeprecated` warnings on Clang trunk as soon as you try to use the implicitly defaulted (but deprecated) copy constructor of a class that has deleted its copy assignment operator. By declaring a deleted copy assignment operator, the old code also caused the move constructor and move assignment operator to be non-declared. This means that the old code never got move semantics -- "move-construction" would simply call the defaulted (but deprecated) copy constructor instead. With the new code, "move-construction" calls the defaulted move constructor, which I believe is what we want to happen. So this is a runtime performance optimization. Unfortunately we can't yet physically remove the definitions of these macros from gtest-port.h, because they are being used by other code internally at Google (according to zhangxy988). But no new uses should be added going forward.
* | Googletest exportAbseil Team2020-05-012-82/+72
|/ | | | | | Rewrite ReturnNew action without using pump. PiperOrigin-RevId: 308219616
* Merge pull request #2350 from adambadura:MockFunctionFromStdFunctionXiaoyi Zhang2020-03-241-0/+51
|\ | | | | | | PiperOrigin-RevId: 302677275
| * Add support for std::function in MockFunction (#2277)Adam Badura2020-03-181-1/+20
| |
| * Add tests for MockFunction deduction (#2277)Adam Badura2020-03-181-0/+30
|/ | | | | | Add tests checking that ::testing::MockFunction template argument can be deduced in a function call context. This is a property raised in the review, however, not checked before by any tests.
* Googletest exportdmauro2020-03-171-5/+3
| | | | | | | Use a polymorphic matcher instead of the GreaterThan<int> test matcher to fix the sign-comparison warning on MSVC. PiperOrigin-RevId: 301163657
* Googletest exportAbseil Team2020-03-171-2/+0
| | | | | | Internal change PiperOrigin-RevId: 299345492
* Googletest exportAbseil Team2020-02-281-4/+5
| | | | | | | Relax the implementation of MatcherCast to allow conversion of `Matcher<T>` to `Matcher<const T&>`. They have the same match signature. PiperOrigin-RevId: 297115843
* Googletest exportAbseil Team2020-02-281-2/+13
| | | | | | | | Allow construction of an Action from a callable of zero args Action already allows construction from a callable with the same args as the mocked function, without needing to wrap the callable in Invoke. However, if you don't care about the arguments to the mocked function you need to either accept all of them or wrap your callable in InvokeWithoutArgs. This change makes both of those unnecessary, since it allows you to pass a no-args callable to Action directly. PiperOrigin-RevId: 296117034
* Googletest exportAbseil Team2020-02-111-94/+95
| | | | | | Add gmock Matcher<std::string_view> specialization. PiperOrigin-RevId: 294443240
OpenPOWER on IntegriCloud