summaryrefslogtreecommitdiffstats
path: root/googlemock
Commit message (Collapse)AuthorAgeFilesLines
* Add test for move-only type in `Action` signatureAbseil Team2024-03-151-0/+16
| | | | | PiperOrigin-RevId: 616031018 Change-Id: Ie724f9562174387eab866a824d28106f344c558d
* 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
* Merge pull request #4466 from danfabo:fix-fetch-content-uses-gtestCopybara-Service2024-03-041-3/+4
|\ | | | | | | | | PiperOrigin-RevId: 612560830 Change-Id: Ib639603d34258909cf0e0d6fceb297dd8c983d54
| * Get include dirs from target rather than global variables.refs/pull/4466/headdanfabo2024-02-111-3/+4
| | | | | | | | The global variable gtest_SOURCE_DIR is replaced by CMake when fetch-content is used with the name "GTest" and points to the root directory. The include directories from the gtest target are always valid.
* | Accept one-shot callables in InvokeArgument.Abseil Team2024-02-292-2/+13
|/ | | | | 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
* Use _Exit instead of _exit in GoogleTestAbseil Team2024-02-071-1/+1
| | | | | | | | _Exit is standardized since C99, whereas _exit is POSIX-only. Fixes: #4447 PiperOrigin-RevId: 605000352 Change-Id: Ibfa84edaa043bd003a21383e8148bf45be7217f6
* Accept move-only callables in `InvokeArguments`Abseil Team2023-12-282-2/+14
| | | | | PiperOrigin-RevId: 594223533 Change-Id: I491fae7d851d4e0df07fb3627416949071fec8d6
* Fix data race in leak detectionAbseil Team2023-12-181-0/+1
| | | | | | | | | TSAN identified a data race between updates to the states_ map (ex. in Mock::UnregisterLocked) and the iteration done in this destructor. Writes to the map use g_gmock_mutex, but the destructor does not acquire it. Acquiring the lock here fixes the data race. It should only be possible to trigger this TSAN finding in cases where a mock object is deleted by a thread other than the main thread. PiperOrigin-RevId: 591935393 Change-Id: I9dd1faa40058d78e165a91333346514b4b73365c
* Implement `testing::Rethrow` to throw exceptions more easily via ↵Abseil Team2023-11-272-3/+30
| | | | | | | | | | | `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-232-2/+11
| | | | | | | | | 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
* cmake: Fix comments in cmake filesrefs/pull/4382/headDzmitry Ivaniuk2023-09-291-10/+10
| | | | Remove extra spaces. Fix so that the comment line starts with a capital letter and ends with a dot.
* 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
* Merge pull request #4349 from sthd:httpToHttpsCopybara-Service2023-08-232-4/+4
|\ | | | | | | | | PiperOrigin-RevId: 559452348 Change-Id: I6f72001fd6b8e5a739c34121c8847c281d563b0f
| * changed http to httpsrefs/pull/4349/headsthd2023-08-222-5/+5
|/
* Clean up typos: Exhaused => ExhaustedAbseil Team2023-08-211-1/+1
| | | | | PiperOrigin-RevId: 558801066 Change-Id: Ia225d12014748db87639414f4c8c28a0d0e9e489
* Avoid unreachable code warningrefs/pull/4328/headRobert Shade2023-08-021-1/+7
|
* Merge pull request #4302 from ciband:feat/nrf52Copybara-Service2023-07-181-1/+2
|\ | | | | | | | | PiperOrigin-RevId: 549006105 Change-Id: Ifbe2bf57e10df4c71e51dbfaf1687f4f621f5106
| * add support for nrf52refs/pull/4302/headChris Johnson2023-06-271-1/+1
|/ | | | Added support for Nordic nRF52 series of MCUs
* cmake: Remove remaining checks for CMAKE_VERSIONrefs/pull/4293/headJuan Ramos2023-06-211-17/+9
| | | | Remove conditional code that doesn't need to exist anymore.
* Merge pull request #4288 from juan-lunarg:juan/cmake_min_3_dot_6Copybara-Service2023-06-201-2/+1
|\ | | | | | | | | PiperOrigin-RevId: 541929012 Change-Id: I90423820611c2b6a6f81fe3f9ec2d23992ffbed1
| * cmake: Raise min to 3.6refs/pull/4288/headJuan Ramos2023-06-191-2/+1
|/ | | | | | | | | | | From the CMake 3.27 release notes: Compatibility with versions of CMake older than 3.5 is now deprecated and will be removed from a future version. Calls to cmake_minimum_required() or cmake_policy() that set the policy version to an older value now issue a deprecation diagnostic. This PR also removes manually setting policy CMP0048. This is redundant since the CMake min is already 3.X
* Merge pull request #4146 from lygstate:fixes_std_pair_diffCopybara-Service2023-05-022-9/+4
|\ | | | | | | | | PiperOrigin-RevId: 528781910 Change-Id: I4038332a6255921792bfb4a8098aa84243d48e15
| * Merge branch 'main' into fixes_std_pair_diffrefs/pull/4146/headAndy Soffer2023-05-0128-141/+244
| |\ | |/ |/|
* | Use GTEST_INTERNAL_CPLUSPLUS_LANG instead of __cplusplusDino Radakovic2023-04-282-2/+5
| | | | | | | | | | | | | | | | Some versions of MSVC provide incorrect values for the latter and rely on _MSVC_LANG instead. Fixes #4226. PiperOrigin-RevId: 527919195 Change-Id: Ifcca4612074f5ebc5337094426866a187f79f90a
* | Add qualifier to avoid argument dependent lookupTom Hughes2023-04-281-1/+1
| | | | | | | | | | PiperOrigin-RevId: 527740306 Change-Id: I61308cc232c346d5ff8b0548d4c552a59633fffc
* | gmock: fix issue #4222refs/pull/4225/headPatryk Gawroński2023-04-241-13/+13
| | | | | | | | | | Rename 'Result' struct to 'NonMoveableStruct' in gmock-spec-builders_test.cc in ExpectCallTest.NonMoveableType test
* | Use '=default' to define trivial constructor/destructorsrefs/pull/4221/headTom Hughes2023-04-2116-48/+48
| | | | | | | | | | | | | | https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html PiperOrigin-RevId: 526079054 Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
* | Use the empty method to check for emptinessTom Hughes2023-04-211-1/+1
| | | | | | | | | | PiperOrigin-RevId: 526046714 Change-Id: I6ad0deff2a7f6dfef75a643c95ad914c83b9ba38
* | Add missing std includesTom Hughes2023-04-2013-0/+43
| | | | | | | | | | 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
* | gtest.cc: add a newline after a failure when there is no OS stack trace.Aaron Jacobs2023-03-231-0/+18
| | | | | | | | | | | | | | | | This makes the behavior consistent when GTEST_STACK_TRACE_DEPTH is set to zero and not: there is always vertical whitespace separating failure messages. PiperOrigin-RevId: 518744611 Change-Id: I5b4af40633849850660504c3f497a76601d4311d
* | Internal Code ChangeAbseil Team2023-03-211-5/+5
| | | | | | | | | | PiperOrigin-RevId: 518213370 Change-Id: I88d0acc195dadf8d03cd15c8534c721141db14ea
* | Introduce std::make_unique and bool literals where possibleAbseil Team2023-03-203-12/+9
| | | | | | | | | | PiperOrigin-RevId: 517910526 Change-Id: I398704f4b2ca0a55c86a06ca8b47d34c8670ddd7
* | 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" with public macrosTom Hughes2023-03-062-2/+2
| | | | | | | | | | | | | | This allows compilation with "-Wundef" (#3267). PiperOrigin-RevId: 513944726 Change-Id: I1a3854bb2333d5dec6c0ff91ee1eddd9a766ab91
* | Use "#ifdef GTEST_OS_..." instead of "#if GTEST_OS_..."Tom Hughes2023-03-068-22/+22
| | | | | | | | | | | | | | This is compatible with compiling with "-Wundef" (#3267). PiperOrigin-RevId: 513943378 Change-Id: I47cf5fabbb77be061c4483a0adc54511af6b191c
* | Internal Code ChangeAbseil Team2023-03-033-3/+3
| | | | | | | | | | PiperOrigin-RevId: 513770561 Change-Id: I82fbed177c6ba4e2e5b776ae3e0255c868e32e25
* | Fix link in ReportUninterestingCall messageAbseil Team2023-02-163-6/+6
| | | | | | | | | | | | | | | | | | | | This CL changes the link in the ReportUninterestingCall message from .../gmock_cook_book.md#knowing-when-to-expect to .../gmock_cook_book.md#knowing-when-to-expect-useoncall. This is necessary following https://github.com/google/googletest/commit/31ff597. PiperOrigin-RevId: 510138974 Change-Id: Ic98c84b07751d27dfc95eddbe7874f76d68b456f
| * Fixes the test gmock_output_test.py with MSVCYonggang Luo2023-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For MSVC, gmock_output_test.py output struct std::pair<int,bool>, for GCC, it's output std::pair<int, bool>, it's not the same, my intention is getting these to be same by removing struct for MSVC's outptu, and strip redundant space for GCC. As a by-product, ``` #ifdef _MSC_VER #define ERROR_DESC "class std::runtime_error" #else #define ERROR_DESC "std::runtime_error" #endif ``` can be simplified to ``` #define ERROR_DESC "std::runtime_error" ``` Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
| * Revert "Fix gmock_output_test when using MSVC"Yonggang Luo2023-02-092-9/+4
|/ | | | This reverts commit 0a3b403fe037ff80daa1826ae99eed41e94dea05.
* Remove GTEST_USES_PCRE referencesTom Hughes2023-02-071-11/+2
| | | | | | | | | | | | | Nothing defines GTEST_USES_PCRE anymore. It was only meant for internal use, so nothing public should be relying on it: https://github.com/google/googletest/issues/2735#issuecomment-644849438. Found when compiling with "-Wundef". Fixes #2735. PiperOrigin-RevId: 507823660 Change-Id: Ie19e576ff01dc3b16381338578ece92adccfc09b