summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | 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
| * | Docs: Add mention of `gtest_recreate_environments_when_repeating`refs/pull/4435/headkaswhy2024-01-231-11/+13
| | |
| * | Docs: add conditions for calling SetUp and TearDown()kaswhy2024-01-111-8/+12
| | |
| * | Docs: add conditions for calling TearDown()kaswhy2023-12-281-3/+6
| | |
* | | Add support for Bzlmod for the next releaseDerek Mauro2024-01-258-22/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bazel.build/external/overview#bzlmod Bzlmod will be the default in a future Bazel release. By default it requires projects to be registered with the Bazel Central Registry (https://registry.bazel.build/) and thus uses regular releases by default. Users that want to "live-at-head" can still do this through with overrides (https://bazel.build/external/module#overrides). This change updates GoogleTest dependencies to use released versions. CI uses Bzlmod except in the case of linux_gcc-floor, which will keep testing the old WORKSPACE-based dependency system. PiperOrigin-RevId: 601489729 Change-Id: I6be52034eba0d0e5fe12110e5e82879305cf73ff
* | | 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
* | | Merge pull request #4444 from ↵Copybara-Service2024-01-221-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | michaeldleslie:only_apply_lregex_for_qnx710_and_newer PiperOrigin-RevId: 600548775 Change-Id: Ia693791321602e728aef9135b349602c790a058a
| * | | only apply -lregex for qnx710 and newerrefs/pull/4444/headMichael Leslie2024-01-101-1/+1
| | | |
* | | | 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-182-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-162-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Do not emit stack traces for messages generated by GTEST_SKIP()Abseil Team2024-01-163-8/+15
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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), GTEST_SKIP is a developer-authored directive to skip one or more tests. Stack traces emitted in skip messages do not give the developer useful information, as the skip message itself contains the code location where GTEST_SKIP was used. In addition to being noise in the output, symbolization of stack traces is not free. In some Chromium configurations, symbolization in a skipped test can incur a cost in excess of 25 seconds for a test that otherwise takes 0-1ms; see https://crbug.com/1517343#c9. In this CL, we suppress generation and emission of stack traces for kSkip messages to reduce the output noise and overhead of GTEST_SKIP(). PiperOrigin-RevId: 598899010 Change-Id: I46926fed452c8d7edcb3d636d8fed42cb6c0a9e9
* | | Update CI builds to use Bazel 7.0.0Derek Mauro2024-01-093-7/+5
| | | | | | | | | | | | | | | | | | | | | --features=external_include_paths has been removed from Windows builds since it appears cause build command errors currently PiperOrigin-RevId: 597020418 Change-Id: Ie37be0d05f3a154ab0d3c3f7d39b4e2c0ed650a3
* | | Add a note about argv requiring NULL termination.Abseil Team2024-01-091-1/+3
| | | | | | | | | | | | | | | | | | Fixes: #4434 PiperOrigin-RevId: 596960654 Change-Id: I1f70cc0801764fe0328030c46254f82eb9893a49
* | | 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
* | 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
| | |