summaryrefslogtreecommitdiffstats
path: root/googletest/include
Commit message (Collapse)AuthorAgeFilesLines
* Workaround GCC 12 -Wrestrict false-positiveDerek Mauro2024-07-101-3/+3
| | | | | | | | | Suggested workaround from https://github.com/Nekto89/googletest/commit/751760ad543f205e1d76797bcc5c7e2ca0c30cce Fixes #4570 PiperOrigin-RevId: 651044944 Change-Id: I21f099a15dd3182d335a7891d99b9b1293e5c53e
* Make EXPECT_DEATH_IF_SUPPORTED work with matchersAbseil Team2024-05-132-26/+27
| | | | | | | | | If death tests were not supported the macro would try to force the second parameter as a string. The second parameter can be a matcher or a string. PiperOrigin-RevId: 633199517 Change-Id: If5e71b4be0b569adb273eb4960202197bb264a8f
* Merge pull request #4527 from abhina-sree:abhina/add_zosCopybara-Service2024-05-061-1/+1
|\ | | | | | | | | PiperOrigin-RevId: 631167807 Change-Id: I563883341972bbb82c7407ebf3755d64317b84fc
| * add zos for death test supportrefs/pull/4527/headAbhina Sreeskantharajan2024-05-021-1/+1
| |
* | Merge branch 'main' into default-enable-thread-support-for-Solaris-AIX-zOSrefs/pull/3991/headPaul Groke2024-05-0218-669/+1115
|\ \ | |/
| * 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-164-72/+97
| | | | | | | | | | | | | | -Wused-but-marked-unused warnings PiperOrigin-RevId: 625430612 Change-Id: Ia9d2e47984e1e6f91966afae8a6750119ae69446
| * 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-042-48/+14
| | | | | | | | | | | | | | | | | | * 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-032-6/+9
| |\ | | | | | | | | | | | | PiperOrigin-RevId: 621631167 Change-Id: I0790f7082ce3c20fef92958c820d40ec854fe91d
| | * Add support for compiling GoogleTest for XboxTroels Gram2024-03-242-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
| * | Automated Code ChangeAbseil Team2024-03-301-2/+2
| |/ | | | | | | | | PiperOrigin-RevId: 620448229 Change-Id: I487a0d8a8f89ebe82c9ec66fbb60cbe2203188c9
| * Reland: Optimize Google Test process startupAbseil Team2024-03-084-91/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-054-94/+91
| | | | | | | | | | PiperOrigin-RevId: 612878184 Change-Id: Ia8e23da1ad09c2e0ce635a855f0c250f368f6878
| * Optimize Google Test process startupAbseil Team2024-03-054-91/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Make sure that current_test_suite and current_test_info are mutex-protected ↵Abseil Team2024-02-271-0/+16
| | | | | | | | | | | | | | while writing for thread-safety. PiperOrigin-RevId: 610810340 Change-Id: I37f33510373dff04b8e9c9e8a9f32d30fcce46ff
| * gtest.h: add IWYU export pragmasAbseil Team2024-02-151-10/+10
| | | | | | | | | | PiperOrigin-RevId: 607136416 Change-Id: Ia29dd3156d4d455194745e58501eaee9d77045a1
| * 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
| * Destroy installed environments in normal code, not in static teardown.Abseil Team2024-02-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | 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
| * Fix double-promotion warnings in AppropriateResolution()Abseil Team2024-01-231-21/+28
| | | | | | | | | | | | | | When -Wdouble-promotion is enabled, the templatized function AppropriateResolution fails to compile since its float instantiation promotes floats to doubles when doing arithmetic and comparisons. Add static casts to resolve these errors. PiperOrigin-RevId: 600776333 Change-Id: Ia530b4bbca6ddce27caf0a817196d87efef711cb
| * googletest: Fix incorrect comment about `value_param` of ↵Dino Radakovic2024-01-221-1/+1
| | | | | | | | | | | | | | | | | | `internal::MakeAndRegisterTestInfo` This was probably a copy-paste from the comment about `type_param`. PiperOrigin-RevId: 600493462 Change-Id: I4a41c2673dd6560db0f68856aab3d32b103164b1
| * If GTEST_NO_ABSL_FLAGS is #defined, then the Abseil flag libraryAbseil Team2024-01-181-5/+7
| | | | | | | | | | | | | | will not be used by googletest, even if GTEST_HAS_ABSL is #defined. PiperOrigin-RevId: 599625032 Change-Id: Ieb994a15683dec89e88578120071eca8ac9fead1
| * Make posix::FileNo available under !GTEST_HAS_FILE_SYSTEMAbseil Team2024-01-161-2/+9
| | | | | | | | | | | | | | | | This enables automatic color output without filesystem support, as that only requires testing to see if the output is a terminal. Fixes: #4439 PiperOrigin-RevId: 598929397 Change-Id: Idca7490e6e090951a78cd1cdd710f41d756a68b4
| * Disable -Wfloat-equal in AppropriateResolution().Krzysztof Kosiński2024-01-091-0/+7
| | | | | | | | | | | | | | This function makes exact floating point that are correct in this context, but trigger the compiler warning. PiperOrigin-RevId: 596944060 Change-Id: I4bba3c2abcf3ac189107530978961955ad47d6f0
| * 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
| * Improve error message for invalid parameterized test names.Abseil Team2023-10-191-2/+2
| | | | | | | | | | PiperOrigin-RevId: 574992011 Change-Id: Id6030a9e5f317966186cc48ef2c09ad97fa15d3e
| * 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
| * 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
| * 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: Add universal printer for `std::span`Dino Radakovic2023-08-252-2/+37
| | | | | | | | | | | | | | Fixes #4318 PiperOrigin-RevId: 560089120 Change-Id: I9d0d098140033520266747a1689e953ee8307c47
| * changed http to httpsrefs/pull/4349/headsthd2023-08-222-6/+6
| |
| * Improve error message for invalid parameterized test names.Abseil Team2023-08-171-1/+3
| | | | | | | | | | PiperOrigin-RevId: 557910190 Change-Id: Ia965a6c96e4cc5997d8af2611abc62c42e81653e
| * Merge pull request #4330 from IncludeGuardian:remove-iomanipCopybara-Service2023-08-082-6/+4
| |\ | | | | | | | | | | | | PiperOrigin-RevId: 554867591 Change-Id: Ib32da50384951532419cb54fb70f8ab0920178d7
| | * Remove public includes of `<iomanip>`refs/pull/4330/headElliot Goodrich2023-08-032-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes `<iomanip>` from public GoogleTest header files. As `<iomanip>` is not a common included file, its content is unlikely to be included in translation units other than through GoogleTest includes. By reducing the number of include directives public headers in GoogleTest, this may reduce the time taken to compile tests as it would reduce the amount of work that the preprocessor and compiler front-end need to do.
| * | Remove the GTEST_HAS_DOWNCAST_ customization point.Derek Mauro2023-08-021-14/+4
| | | | | | | | | | | | | | | PiperOrigin-RevId: 553150809 Change-Id: I10d19a45a85c5f63a5e65dc322413307116e1c25
| * | Make testing::Message support streamed AbslStringify valuesPhoebe Liang2023-08-011-2/+34
| | | | | | | | | | | | | | | | | | | | | This allows types that provide an AbslStringify definition to be streamed into GoogleTest macros. PiperOrigin-RevId: 552914482 Change-Id: I5fb386980d4d24873f95f0a8ef83067a6a3c86ac
| * | Make `AbslStringify` usage public in GoogleTestAbseil Team2023-07-211-0/+22
| | | | | | | | | | | | | | | | | | | | | Fixes #4314 PiperOrigin-RevId: 549986457 Change-Id: Iff74f02ab1c106696f288540e9c623d56b76e3f7
| * | Remove unused cast implementationDerek Mauro2023-07-191-41/+0
| | | | | | | | | | | | | | | PiperOrigin-RevId: 549456180 Change-Id: I10862e6de981087a5c590cccf6152255e9a176a0
| * | Merge pull request #4313 from kimvaleen:mainCopybara-Service2023-07-182-15/+16
| |\ \ | | | | | | | | | | | | | | | | PiperOrigin-RevId: 549039222 Change-Id: I96bea310beede5ba0ed6160155251ffd9d7a2103
| | * | Fixed variables that could be declared 'const'refs/pull/4313/headkimvaleen2023-07-112-2/+2
| | | |
| * | | Merge pull request #4302 from ciband:feat/nrf52Copybara-Service2023-07-182-1/+3
| |\ \ \ | | |_|/ | |/| | | | | | | | | | PiperOrigin-RevId: 549006105 Change-Id: Ifbe2bf57e10df4c71e51dbfaf1687f4f621f5106
| | * | add support for nrf52refs/pull/4302/headChris Johnson2023-06-272-1/+3
| | | | | | | | | | | | | | | | Added support for Nordic nRF52 series of MCUs
| * | | Merge pull request #4308 from smr99:fix-float-castCopybara-Service2023-07-111-2/+2
| |\ \ \ | | |_|/ | |/| | | | | | | | | | PiperOrigin-RevId: 547250378 Change-Id: I084c30e45f331cb296535822923da1cb7e848e11
| | * | Use template type FloatType in the cast.refs/pull/4308/headSteve Robbins2023-07-041-2/+2
| | | |
| * | | Update docstring of PrintWithFallback(..) to reflect the recently changed ↵Abseil Team2023-07-071-1/+1
| |/ / | | | | | | | | | | | | | | | | | | ordering. PiperOrigin-RevId: 546373360 Change-Id: I2538b45d8c7710592071cc352da6771480c324e6
| * | Fix C++20 compatibility bug.Mike Kruskal2023-07-012-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This was shown to work for C++14, C++17, and C++20 after patched into googletest for the protobuf repo's CI. Closes #3659 PiperOrigin-RevId: 544795507 Change-Id: I3e0a94f675e78a6ee9aeccae86c23d940efed8eb
| * | Resolve an issue where the resolution of `operator<<` overloads would ↵Abseil Team2023-06-271-2/+4
| |/ | | | | | | | | | | | | attempt to instantiate the incomplete `testing::internal::Secret` type. PiperOrigin-RevId: 543799815 Change-Id: Ic0a4f48d825bef26cb8cc74d8a0117b3a5ef3f14
| * Merge branch 'google:main' into feat/qn9090refs/pull/4301/headChris Johnson2023-06-221-1/+4
| |\
| | * Allow clients to un-suppress output from gUnit EXPECT_EXIT tests.Abseil Team2023-06-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | This is useful for running individual tests in a separate process, which is useful for testing e.g. flag changes which have a process-global effect. PiperOrigin-RevId: 540580573 Change-Id: I18a5d24d79425a9d595be3369efc44e2f655f6f8