summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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
* | Merge pull request #3991 from ↵Copybara-Service2024-05-031-1/+2
|\ \ | | | | | | | | | | | | | | | | | | pgroke-dt:default-enable-thread-support-for-Solaris-AIX-zOS PiperOrigin-RevId: 630402377 Change-Id: Ie9cafffaa49c2c02220981d665daa672164d35d8
| * \ Merge branch 'main' into default-enable-thread-support-for-Solaris-AIX-zOSrefs/pull/3991/headPaul Groke2024-05-02162-4578/+6515
| |\ \ | | |/
| * | extend GTEST_HAS_PTHREAD default to enable threading on Solaris, AIX and z/OSPaul Groke2022-08-311-1/+2
| | | | | | | | | | | | fix #3990
* | | Add example using EXPECT statement in custom matcherAbseil Team2024-05-021-3/+32
| |/ |/| | | | | | | | | | | | | | | `EXPECT_...` statements can be used inside matcher definitions – this is an important option that is glossed over in this documentation. Users should definitely be aware of this option, since writing custom messages to the `result_listener` can be very cumbersome (and unnecessary) sometimes. This change adds a relevant example and includes the associated error message it provides on failure. PiperOrigin-RevId: 630206661 Change-Id: Idee00ba77ce3c1245597aa082f9cd0efff16aceb
* | Adds "IWYU pragma: export" to gtest-param-util.hAbseil Team2024-04-251-1/+1
| | | | | | | | | | PiperOrigin-RevId: 628105419 Change-Id: I364e8089b62050c44059e208b610e324eb5a656d
* | Use `[[maybe_unused]]` when it is available to avoidDerek Mauro2024-04-167-124/+150
| | | | | | | | | | | | | | -Wused-but-marked-unused warnings PiperOrigin-RevId: 625430612 Change-Id: Ia9d2e47984e1e6f91966afae8a6750119ae69446
* | Modify example in the primer to match Testing FAQ.Krzysztof Kosiński2024-04-121-9/+8
| | | | | | | | | | | | | | The CtorVsSetUp section of the FAQ says that constructors and destructors should be preferred over SetUp() and TearDown(), because they will automatically chain up to the fixture's base class, whereas for methods the user must remember to add the chaining manually. PiperOrigin-RevId: 624273474 Change-Id: Ida41aae193d417eaf996587c7ae1a0099a8cab32
* | Fix https://github.com/google/googletest/issues/4423Abseil Team2024-04-101-2/+4
| | | | | | | | | | PiperOrigin-RevId: 623407029 Change-Id: I3559f11e1c18a4f151d521c6ac115c358a11b40c
* | Merge pull request #4508 from davidmatson:addJsonSkippedCopybara-Service2024-04-083-16/+61
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 622929007 Change-Id: Ifaf5a701baee74503e6845f32ebc27425882e950
| * | Add skipped messages to JSON output (fixes #4507).refs/pull/4508/headDavid Matson2024-04-033-16/+62
| | | | | | | | | | | | Fix the gap between JSON and XML output.
* | | No external changeAbseil Team2024-04-051-1/+1
| | | | | | | | | | | | | | | PiperOrigin-RevId: 622203227 Change-Id: Ic3c24edf917dbda7b02c6ab8ce695398a436dc4c
* | | [gtest] Use `std::index_sequence` and friends instead of rolling our ownLawrence Wolf-Sonkin2024-04-047-103/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | | Merge pull request #4505 from to01z:add-winapi-partition-games-supportCopybara-Service2024-04-034-23/+26
|\ \ \ | | | | | | | | | | | | | | | | PiperOrigin-RevId: 621631167 Change-Id: I0790f7082ce3c20fef92958c820d40ec854fe91d
| * | | Revert changes to googletest-port-test.ccrefs/pull/4505/headTroels Gram2024-03-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | GoogleTest's tests do not currently compile when WINAPI_FAMILY is set to anything else than WINAPI_FAMILY_DESKTOP_APP on Windows (if WINAPI_FAMILY is not set explicitly, it will default to WINAPI_FAMILY_DESKTOP_APP).
| * | | Add support for compiling GoogleTest for XboxTroels Gram2024-03-245-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for Xbox platforms, requires the code to support compilation with the WINAPI_FAMILY_GAMES subset of the Win32 API. - Add support for WINAPI_FAMILY_GAMES to enable GTEST_OS_WINDOWS_GAMES platform. - Disable stream redirection (GTEST_HAS_STREAM_REDIRECTION = 0) and colored TTY printing for GTEST_OS_WINDOWS_GAMES platform. Both features currently require Win32 functions that don't exist in the WINAPI_FAMILY_GAMES subset. Misc fixes: - gtest-port.cc: Move GTEST_DISABLE_MSC_DEPRECATED_PUSH_ into GTEST_HAS_STREAM_REDIRECTION conditional section where the corresponding GTEST_DISABLE_MSC_DEPRECATED_POP_ is located. - googletest-port-test.cc: Switch stream redirection tests to be conditional on GTEST_HAS_STREAM_REDIRECTION instead of !defined(GTEST_OS_WINDOWS_MOBILE).
* | | | Fix a race condition between the Watcher thread and the main threadDerek Mauro2024-04-031-10/+25
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | during program exit A race condition exist between the Watcher thread and main(). A case was found where the Watcher thread does not get execution time before the main function returns and calls atexit(). At that point the Watcher thread started runing tls_init() code while the main thread was shutting down. This resulted in rare crashes and deadlocks. Fixes #4493 Closes #4494 PiperOrigin-RevId: 621619768 Change-Id: I66f00d8f0f3c37f9937c6d13890f7fa10038256d
* | | Delete the unofficial GitHub actions tests.Derek Mauro2024-04-031-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | We do not look at these. Close #4509 PiperOrigin-RevId: 621511191 Change-Id: Icbd3fe0a18444e0888bbec61345c6a957d8899d6
* | | Merge pull request #4503 from davidmatson:fixTypoCopybara-Service2024-04-021-1/+1
|\ \ \ | | | | | | | | | | | | | | | | PiperOrigin-RevId: 621334548 Change-Id: I19747f832b51cc5bbb0231bbd9416a8373e4aa77
| * | | Fix typo in comment.refs/pull/4503/headDavid Matson2024-03-291-1/+1
| |/ /
* | | Merge pull request #4502 from davidmatson:fixStreamHelpTextOsCopybara-Service2024-04-021-1/+1
|\ \ \ | | | | | | | | | | | | | | | | PiperOrigin-RevId: 621172364 Change-Id: Ibaacb17c60b5ee0e58c3689b79aa2cd6b49dc1c4
| * | | Fix help text for stream_result_to flag.refs/pull/4502/headDavid Matson2024-03-281-1/+1
| |/ / | | | | | | | | | | | | Support for Mac was previously added, in addition to Linux. Fix the help text to match the code.
* | | Automated Code ChangeAbseil Team2024-03-301-2/+2
|/ / | | | | | | | | PiperOrigin-RevId: 620448229 Change-Id: I487a0d8a8f89ebe82c9ec66fbb60cbe2203188c9
* | Merge pull request #4490 from memdo:mainCopybara-Service2024-03-183-10/+13
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 616931521 Change-Id: Iffbb24e3f9add4e7acf8f1988a03afc8628b0733
| * | Add colored output support for Alacrittyrefs/pull/4490/headMustafa Berkay Düzenli2024-03-153-0/+5
|/ /
* | 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
* | Reland: Optimize Google Test process startupAbseil Team2024-03-086-144/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Google Test performs hidden test registration during process startup. For test binaries that contain a large number of tests, this registration can be costly. In this CL, we reduce the overhead of registration via several tactics: - Treat CodeLocation and FilePath as value types, using std::move to pass them around. - Reduce string copies in various places by either passing std::string values via std::move, or passing const-refs to std::string instances. - Use std::to_string to stringify an int in DefaultParamName rather than a std::stringstream. - Pull some std::string instances out of nested loops in ParameterizedTestSuiteInfo::RegisterTests so as to reuse some allocations, and replace stringstream with ordinary string appends. - Use std::unordered_map in UnitTestImpl::GetTestSuite and ParameterizedTestSuiteRegistry::GetTestSuitePatternHolder to spend a little memory to turn O(N) lookups into constant time lookpus. - Use range-based for loops in a few places. - Use emplace-ish methods to add to containers where appropriate. All together, these changes reduce the overall runtime of a series of 50 death tests in a single Chromium test executable by ~38% due to the fact that the registration costs are paid in every death test's child process. PiperOrigin-RevId: 613833210 Change-Id: I51a262a770edff98ffa1e3b60c4d78a8308f9a9f
* | Revert Optimize Google Test process startupAbseil Team2024-03-056-160/+162
| | | | | | | | | | PiperOrigin-RevId: 612878184 Change-Id: Ia8e23da1ad09c2e0ce635a855f0c250f368f6878
* | Optimize Google Test process startupAbseil Team2024-03-056-162/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Google Test performs hidden test registration during process startup. For test binaries that contain a large number of tests, this registration can be costly. In this CL, we reduce the overhead of registration via several tactics: - Treat CodeLocation and FilePath as value types, using std::move to pass them around. - Reduce string copies in various places by either passing std::string values via std::move, or passing const-refs to std::string instances. - Use std::to_string to stringify an int in DefaultParamName rather than a std::stringstream. - Pull some std::string instances out of nested loops in ParameterizedTestSuiteInfo::RegisterTests so as to reuse some allocations, and replace stringstream with ordinary string appends. - Use std::unordered_map in UnitTestImpl::GetTestSuite and ParameterizedTestSuiteRegistry::GetTestSuitePatternHolder to spend a little memory to turn O(N) lookups into constant time lookpus. - Use range-based for loops in various places. - Use emplace-ish methods to add to containers where appropriate. All together, these changes reduce the overall runtime of a series of 50 death tests in a single Chromium test executable by ~38% due to the fact that the registration costs are paid in every death test's child process. PiperOrigin-RevId: 612763676 Change-Id: I1f46e012ccb9004c009e1027e4f7c38780ffb9e2
* | 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
* | | Merge pull request #4477 from tmiguelf:feature/soup_cleanupCopybara-Service2024-02-281-10/+10
|\ \ \ | | | | | | | | | | | | | | | | PiperOrigin-RevId: 611133343 Change-Id: Ieef806f51fcbc2877805dae415f76d03547b8dfa
| * | | Fixed gcc linker error 58refs/pull/4477/headTiago Freire2024-02-231-10/+20
| | | |
* | | | Reland ↵Abseil Team2024-02-274-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/google/googletest/commit/9756ee7cbaef1b6652065616ab832810a6032bbf Since Fuchsia engineers rarely work within this repo, initialize a lightweight fake @fuchsia_sdk repo rather than distributing the Fuchsia SDK here. Tested locally via `bazel query --[no]enable_bzlmod "deps(set(//googletest/test:gtest_all_test))"` (#4472) PiperOrigin-RevId: 610826859 Change-Id: I7d41b1dbe9e7f133fe535d7337dc5bff5bf97d3a
* | | | Make sure that current_test_suite and current_test_info are mutex-protected ↵Abseil Team2024-02-273-30/+59
|/ / / | | | | | | | | | | | | | | | | | | while writing for thread-safety. PiperOrigin-RevId: 610810340 Change-Id: I37f33510373dff04b8e9c9e8a9f32d30fcce46ff
* | | Revert incorrect update.Abseil Team2024-02-221-2/+2
| | | | | | | | | | | | | | | PiperOrigin-RevId: 609387046 Change-Id: I03e42c39011fc7e9715f896591a44ebede1933b2
* | | Rollback ↵Derek Mauro2024-02-211-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/google/googletest/commit/9756ee7cbaef1b6652065616ab832810a6032bbf The commit breaks some bazel commands without @fuchsia_sdk being listed as a dependency. Fixes #4472 PiperOrigin-RevId: 609057667 Change-Id: I32ea8237862d7c10add55304ecc4547a7304ce36
* | | gtest.h: add IWYU export pragmasAbseil Team2024-02-151-10/+10
| | | | | | | | | | | | | | | PiperOrigin-RevId: 607136416 Change-Id: Ia29dd3156d4d455194745e58501eaee9d77045a1
* | | Support Fuchsia target builds.Abseil Team2024-02-141-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Fuchsia team has been using either fork branches (https://fuchsia.googlesource.com/third_ party/github.com/google/googletest/+/refs/heads/sandbox/fuchsia_bazel_sdk) or patch files (https://cs.opensource.google/fuchsia/fuchsia/+/main:build/bazel/patches/googletest/fuchsia-support.bundle) to support googletest-based tests that run against a Fuchsia target device. As our SDK is maturing and @platforms//os:fuchsia constraint has been added for a while now, upstream Fuchsia gtest support to reduce technical debt and overhead. This change is noop for non-fuchsia platform builds. PiperOrigin-RevId: 606843739 Change-Id: I61e0eb9c641f288d7ae57354fc0b484fce013223
* | | Add anchor for expectation ordering noteAbseil Team2024-02-131-0/+2
|/ / | | | | | | | | PiperOrigin-RevId: 606736565 Change-Id: Ifad0b34e1deeec1374377d733375c6210896d0d3
* | 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-074-45/+49
| | | | | | | | | | | | | | | | _Exit is standardized since C99, whereas _exit is POSIX-only. Fixes: #4447 PiperOrigin-RevId: 605000352 Change-Id: Ibfa84edaa043bd003a21383e8148bf45be7217f6
* | Destroy installed environments in normal code, not in static teardown.Abseil Team2024-02-074-51/+67
| | | | | | | | | | | | | | | | | | | | | | Destruction in static teardown causes issues for Environments which own threads and try to join them in their destruction. This may be a breaking change for users who call RUN_ALL_TESTS multiple times in the same main function if they also install environments, or those who access registered environments after RUN_ALL_TESTS. The easiest fix is to only call RUN_ALL_TESTS once as the last line of the main function. Another potential fix is to re-register new instances of the Environment once before each call to RUN_ALL_TESTS. PiperOrigin-RevId: 604800795 Change-Id: I37c44d4aca4a238052649f45a4b6b9cfb5355b71
* | Merge pull request #4458 from kaswhy:patch-1Copybara-Service2024-02-051-0/+1
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 604402563 Change-Id: If99952449430161609572dab998774fac4653f01
| * | Add myself to Contributorsrefs/pull/4458/headSoyeon Kim2024-01-311-0/+1
| | |
* | | Modifications to improve portability of googletest tests.Abseil Team2024-01-312-5/+12
|/ / | | | | | | | | PiperOrigin-RevId: 603034597 Change-Id: I4d716ed67f80f41075bfa266d975460d2ac27eb6
* | Do not emit stack traces for messages generated by SUCCEED()Abseil Team2024-01-302-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stack traces in assertion failures are an extremely useful tool for developers tasked with investigating failing tests. It's difficult to understate this. In contrast to ordinary test assertions (e.g., ASSERT_TRUE or EXPECT_FALSE), SUCCEED() is a developer-authored directive that indicates a success codepath. In fact, the documentation states that this directive doesn't generate any output. Generating stack traces for uses of SUCCEED() is wasted work since they are never printed. If this were to change one day in the future, they still would not be useful since any emitted message would include the file and line number where SUCCEED was used. In addition to being noise in the output in this case, symbolization of stack traces is not free. In some Chromium configurations, symbolization for use of SUCCEED() can incur a cost in excess of 25 seconds for a test that otherwise takes 0-1ms; see https://crbug.com/1517343. In this CL, we suppress generation and emission of stack traces for kSuccess messages to reduce the overhead of SUCCEED(). PiperOrigin-RevId: 602832162 Change-Id: I557dd6a1d3e6ed6562daf727d69fd01fe914827b
* | Merge pull request #4435 from kaswhy:mainCopybara-Service2024-01-291-5/+15
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 602385832 Change-Id: I755dae5707e98b6157930a74de90a8e19ef17603