Commit Graph

21 Commits

Author SHA1 Message Date
Abseil Team
b007c54f29 Running clang-format over all of GoogleTest
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
2022-03-15 13:42:11 -07:00
Abseil Team
662fe38e44 Googletest export
Support templating MockFunction over function objects besides std::function.

PiperOrigin-RevId: 373586967
2021-05-13 15:08:57 -04:00
Abseil Team
d89b363021 Googletest export
Add support for ref qualifiers in MOCK_METHOD.

PiperOrigin-RevId: 341047839
2020-11-06 13:23:55 -05:00
Xiaoyi Zhang
67cc66080d Merge pull request #2350 from adambadura:MockFunctionFromStdFunction
PiperOrigin-RevId: 302677275
2020-03-24 17:32:16 -04:00
Adam Badura
53740ebc21 Add support for std::function in MockFunction (#2277) 2020-03-18 01:11:30 +01:00
Adam Badura
e41f31f2af Add tests for MockFunction deduction (#2277)
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.
2020-03-18 01:11:30 +01:00
Abseil Team
fbf67a70d0 Googletest export
Get rid of gmock-generated-function-mockers.h and
gmock-generated-function-mockers.h.pump.

Stop using pump for GMOCK_METHOD* macroses generation.

PiperOrigin-RevId: 293454519
2020-02-07 13:35:27 -05:00
Joshua Cannon
676d0444bf Revert "Merge pull request #2498 from thejcannon:noexcept_spec"
This reverts commit ba513d2c95, reversing
changes made to a3ca5b9e0b.
2019-10-23 14:46:46 -05:00
Abseil Team
1f9edcd969 Googletest export
Addressing https://github.com/google/googletest/issues/2502

Add MOCK_METHOD support for returning function pointers.

PiperOrigin-RevId: 275323671
2019-10-18 11:33:59 -04:00
Gennadiy Civil
ba513d2c95 Merge pull request #2498 from thejcannon:noexcept_spec
PiperOrigin-RevId: 274155281
2019-10-11 08:48:11 -04:00
Gennadiy Civil
37905b9d8c Merge pull request #2498 from thejcannon:noexcept_spec
PiperOrigin-RevId: 274097989
2019-10-11 07:07:12 -04:00
Joshua Cannon
bc996e0817 Made noexcept condition more exciting 2019-10-10 08:52:27 -05:00
Joshua Cannon
20255e6f40 Use declval in noexcept expression 2019-10-07 16:27:11 -05:00
Joshua Cannon
7f8617a7c5 Switch to free function to avoid GCC bug 2019-10-07 15:49:52 -05:00
Joshua Cannon
872b9ceb60 Avoid comma operator 2019-10-07 15:12:51 -05:00
Joshua Cannon
10c1d8c4fa Use the verbatim noexcept spec in MOCKED_METHOD 2019-10-07 14:30:10 -05:00
Abseil Team
56ef07a203 Googletest export
Build gmock cleanly with clang -Wextra-semi

For https://crbug.com/926235.
From https://github.com/google/googletest/pull/2139.
Fixes https://github.com/google/googletest/issues/2138.

PiperOrigin-RevId: 235832527
2019-03-01 16:18:17 -05:00
Abseil Team
9518a57428 Googletest export
Fix mocking method arguments with templated copy constructors.

A previous change removed workarounds for old compilers from googletest and googlemock. Unfortunately, a bit of code that started as a workaround for Symbian's C++ compiler is still needed to avoid copy/move constructor ambiguity when mocking functions with certain argument types.

The test case added by this CL is extracted from Chrome's codebase, and was discovered while attempting to roll googletest.

PiperOrigin-RevId: 229801765
2019-01-18 14:06:03 -05:00
Abseil Team
f8b1c1af17 Googletest export
Remove the #ifs for old, unsupported and buggy compilers:
* old versions of GCC & MSVC
* Symbian

PiperOrigin-RevId: 227116941
2019-01-02 16:51:33 -05:00
Abseil Team
e26a3fa13c Googletest export
Unifdef c++11-related macros from googletest now that it requires C++11.

PiperOrigin-RevId: 225905601
2018-12-20 14:09:31 -05:00
Abseil Team
c5f08bf919 Googletest export
One macro to rule them all.

PiperOrigin-RevId: 221462515
2018-11-15 16:11:19 -05:00