summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Accept move-only callables in `InvokeArguments`Abseil Team2023-12-282-2/+14
| | | | | PiperOrigin-RevId: 594223533 Change-Id: I491fae7d851d4e0df07fb3627416949071fec8d6
* Minor documentation correction.Abseil Team2023-12-221-2/+2
| | | | | PiperOrigin-RevId: 593126348 Change-Id: I78e12ab5dd2e5acc69b21250bdb04e62990b6309
* Fix broken links in primer.mdDerek Mauro2023-12-191-2/+2
| | | | | | | Closes #4432 PiperOrigin-RevId: 592335698 Change-Id: I9859451981f58f1426255067d702a0767718b1d5
* 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
* Add `FAIL_AT` macro variant of `FAIL` matching `ADD_FAILURE`, `ADD_FAILURE_AT`Abseil Team2023-12-131-0/+1
| | | | | | | `FAIL_AT` is shorthand for `GTEST_FAIL_AT` like `FAIL` is for `GTEST_FAIL`. PiperOrigin-RevId: 590393926 Change-Id: I68263af8fa2f98ca0bbef509d475c84e22068018
* Remove unnecessary conversionTom Hughes2023-12-121-2/+2
| | | | | | | | `GetAbsolutePathToOutputFile` returns a `std::string` and `OpenFileForWriting` takes a `std::string&`. PiperOrigin-RevId: 589984409 Change-Id: I75be9cb105f49b3a279a5d33b1b82dfcfc912cfd
* Merge pull request #4426 from tamaskenez:cmake_external_absl_re2Copybara-Service2023-12-042-0/+13
|\ | | | | | | | | PiperOrigin-RevId: 587836393 Change-Id: Ia8895898bd0a826b35dc0ebedd8c76503bc8cd43
| * Allow using external absl and re2.refs/pull/4426/headTamas Kenez2023-12-012-0/+13
| |
* | Skip find_package(Python3) when not building testsDerek Mauro2023-12-041-1/+3
|/ | | | | | | | #4424 claims this saves several seconds of build time Closes #4424 PiperOrigin-RevId: 587827426 Change-Id: I207779a6539f9af16a39d6b40887770dc930b74f
* 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
* Merge pull request #4397 from botovq:raiseCopybara-Service2023-10-301-0/+1
|\ | | | | | | | | PiperOrigin-RevId: 577958594 Change-Id: I8a27f67dc5b6817b741bfd2fc0f27c6302291a00
| * Add missing include for raise(3)refs/pull/4397/headTheo Buehler2023-10-251-0/+1
| | | | | | | | | | | | If SIGTRAP is defined, this file may end up using raise(3), which is defined in csignal, leading to a compilation failure on at least OpenBSD/sparc64 with gcc 8.
* | 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
* Improve error message for invalid parameterized test names.Abseil Team2023-10-191-2/+2
| | | | | PiperOrigin-RevId: 574992011 Change-Id: Id6030a9e5f317966186cc48ef2c09ad97fa15d3e
* s/::testing::/testing::/ in test documentation outside of using statements ↵Abseil Team2023-10-181-7/+7
| | | | | | | to align with best practice PiperOrigin-RevId: 574377544 Change-Id: I0ca69a3bf14cc1aab75784eba220a48bf50cef04
* gtest-death-test-internal: Delete obsolete string constantsDino Radakovic2023-10-171-3/+1
| | | | | | | These are not used anywhere in googletest and they are in namespace `testing::internal` PiperOrigin-RevId: 574171727 Change-Id: I5f668157a81ba3efaed77c1302b40cf07eeda52b
* Fix RE::Init for Android and NetBSD.Abseil Team2023-10-052-4/+15
| | | | | | | | | This is a somewhat recent change for Android (I'm not clear on whether it's a recent change for NetBSD, or if Android was just very behind on its implementation), so while this worked fine as recently as API 32 devices, REG_GNU is required for API 34 (API 33 untested). A test actually caught this, but https://github.com/google/googletest/pull/4334 "fixed" the test rather than the implementation. This CL also reverts the test change so it can catch the failure. PiperOrigin-RevId: 571126374 Change-Id: I420dfcedea58f2c8b605f699515d744006c0a9d9
* gmock_cook_book: Document `DoAll`'s return type requirementDino Radakovic2023-10-031-0/+6
| | | | | | | | The requirement is vaguely documented by "Only the return value of the last action in the sequence will be used.". However, this can be misleading, as users could potentially expect default-constructed values to be returned in absence of a matching return type. PiperOrigin-RevId: 570450839 Change-Id: Ibd98a6e6b2aaf2a8cfc15ed6aeab442526eab98e
* Merge pull request #4382 from idzm:fix_cmake_commentsCopybara-Service2023-10-024-42/+42
|\ | | | | | | | | PiperOrigin-RevId: 570161165 Change-Id: Idf7eafb163bb067b0031e25a183d5c9cc3e3f378
| * cmake: Fix comments in cmake filesrefs/pull/4382/headDzmitry Ivaniuk2023-09-294-43/+42
|/ | | | Remove extra spaces. Fix so that the comment line starts with a capital letter and ends with a dot.
* Resolve `-Wundef` triggering on `GTEST_CREATE_SHARED_LIBRARY` and ↵Abseil Team2023-09-251-2/+2
| | | | | | | | `GTEST_LINKED_AS_SHARED_LIBRARY` with shared libraries in GoogleTest Fixes: #4372 PiperOrigin-RevId: 568327612 Change-Id: Ifc47f1a2a2648c29858a22966331557cc928cc47
* 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 C++ feature detection in `gtest-port.h` to rely on feature test ↵Abseil Team2023-09-221-24/+36
| | | | | | | | | | | | | | | | | | macros where possible. This also avoids conflating C++ language versions with standard library versions, which don't always align. PiperOrigin-RevId: 567662118 Change-Id: I7c023bd043c81c540c9430eaeb7b450feaadb206
* | Use `absl::HasAbslStringify`, instead of the internal version.Abseil Team2023-09-212-15/+13
| | | | | | | | | | PiperOrigin-RevId: 567349341 Change-Id: I35f2679901aecbe9cb90d2e78ff28c5e383e7257
* | googletest: Update absl to version with HasAbslStringifyDino Radakovic2023-09-211-4/+4
|/ | | | | | | https://github.com/abseil/abseil-cpp/commit/9e1789ffea47fdeb3133aa42aa9592f3673fb6ed PiperOrigin-RevId: 567324946 Change-Id: I8adc5803a81075a635dad79aa0312d4455e1ad63
* Update code with IWYU annotations.Abseil Team2023-09-181-7/+7
| | | | | PiperOrigin-RevId: 566424331 Change-Id: I0e16d979b9d79643c882c5082e154842983a5317
* Use the `empty()` method to check for emptiness instead of `length()`Abseil Team2023-09-182-2/+2
| | | | | PiperOrigin-RevId: 566247438 Change-Id: I8199ef53310a057abbe23f8f4295507b60d6b707
* GoogleTest FAQ: minor punctuation fixesrefs/pull/4362/headMichael Hirshleifer2023-09-141-15/+15
| | | | | PiperOrigin-RevId: 565411290 Change-Id: I57e94c679183e39eec2a2835f330b52fc9302767
* Remove Googletest FAQ entry for obsolete `ProtocolMessageEquals` and ↵Michael Hirshleifer2023-09-141-21/+0
| | | | | | | | | | `ProtocolMessageEquiv` * These long-dead variants of the proto matchers don't exist in the current version of Googletest. * No evidence of external usage: [the only external references I see](https://www.google.com/search?q=%22protocolmessageequals%22+OR+%22protocolmessageequals%22) are copies of this guide. Possibly they were already removed by the time Googletest was publicly released. PiperOrigin-RevId: 565358401 Change-Id: I61379b7333fa8ee19cd5520caedf2c539f54c2d7
* Merge pull request #4342 from tanzislam:prefer-tmpdir-on-androidCopybara-Service2023-09-141-8/+24
|\ | | | | | | | | PiperOrigin-RevId: 565230380 Change-Id: I6e91eea46d05413d4d87e73a11941786604d9f27
| * Reuse TempDir() functionrefs/pull/4342/headTanzinul Islam2023-08-261-4/+1
| |
| * Prefer $TMPDIR to /data/local/tmp on AndroidTanzinul Islam2023-08-181-1/+7
| | | | | | Newer devices can have the latter location read-only. (I observed this with Termux on a non-rooted Pixel 6.)
* | Merge pull request #4365 from tanzislam:fix-thread-count-after-thread-creationCopybara-Service2023-09-111-3/+3
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 564472305 Change-Id: I8db9bc0ba0768e7ab9c67f36d9db87edbbf14f10
| * | Count threads after thread-creation while still holding mutex lockrefs/pull/4365/headTanzinul Islam2023-09-031-3/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `Mutex` is locked with the `MutexLock` before spawning the thread, so that the thread is prevented from completing (by being blocked on `Mutex`) before the new thread count is obtained. However, the existing bug (introduced in 22e6055) releases `Mutex` before obtaining the new thread count, which allows the thread to run to completion in the meantime. Also, since the `(thread_count_after_create != starting_count + 1)` condition (line 328) skips the remainder of the `for`-loop body on every iteration, `thread_count_after_join` stays uninitialized. I believe this is why [this test failed][1] on the macOS CI with this trace: ``` [----------] 1 test from GetThreadCountTest [ RUN ] GetThreadCountTest.ReturnsCorrectValue googletest/test/googletest-port-test.cc:350: Failure Expected equality of these values: thread_count_after_create Which is: 1 starting_count + 1 Which is: 2 googletest/test/googletest-port-test.cc:351: Failure Expected equality of these values: thread_count_after_join Which is: 140493185949400 starting_count Which is: 1 [ FAILED ] GetThreadCountTest.ReturnsCorrectValue (2 ms) [----------] 1 test from GetThreadCountTest (2 ms total) ``` [1]: https://github.com/google/googletest/actions/runs/6064919420/job/16453860690?pr=3049
* | googletest: Add universal printer for `std::span`Dino Radakovic2023-08-253-2/+53
| | | | | | | | | | | | | | Fixes #4318 PiperOrigin-RevId: 560089120 Change-Id: I9d0d098140033520266747a1689e953ee8307c47
* | Merge pull request #4349 from sthd:httpToHttpsCopybara-Service2023-08-2311-20/+20
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 559452348 Change-Id: I6f72001fd6b8e5a739c34121c8847c281d563b0f
| * | changed http to httpsrefs/pull/4349/headsthd2023-08-2211-21/+21
|/ /
* | Merge pull request #4343 from sthd:http-to-httpsCopybara-Service2023-08-223-11/+11
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 559151399 Change-Id: I8eb2c7c5222d0fd0935db531a0abe5792633fe7e
| * \ Merge branch 'google:main' into http-to-httpsrefs/pull/4343/headElior Schneider2023-08-201-1/+2
| |\ \
| * | | Update advanced.mdElior Schneider2023-08-201-1/+1
| | | | | | | | | | | | http to https
| * | | Merge branch 'google:main' into http-to-httpsElior Schneider2023-08-183-44/+28
| |\ \ \ | | | |/ | | |/|
| * | | Changed 2 public links from http to httpssthd2023-08-111-2/+2
| | | |
| * | | Changed 3 public links from http to httpssthd2023-08-111-3/+3
| | | |
| * | | Changed 2 public links from http to httpssthd2023-08-111-2/+2
| | | |
| * | | Changed 3 public links from http to httpssthd2023-08-111-3/+3
| | | |
* | | | googletest: Replace http with https in links to docsDino Radakovic2023-08-222-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a prerequisite for #4341 PiperOrigin-RevId: 559132807 Change-Id: Iadc961913e0ff107c5333dae17be5f8638663836
* | | | CI: Update the Linux hybrid-latest docker container used for testingDerek Mauro2023-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following are the major updates * LLVM 17 branch (https://github.com/llvm/llvm-project b744f4c99cf91155c74a3c92db6f1335232ff3d) * GCC 13.2 * CMake 3.27.1 * Bazel 6.2.1 PiperOrigin-RevId: 558818264 Change-Id: Ib08d8331e2a8b2d68a702670451beaaac5d266f4
* | | | Clean up typos: Exhaused => ExhaustedAbseil Team2023-08-211-1/+1
| |_|/ |/| | | | | | | | | | | PiperOrigin-RevId: 558801066 Change-Id: Ia225d12014748db87639414f4c8c28a0d0e9e489