summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest/internal/gtest-internal.h
Commit message (Collapse)AuthorAgeFilesLines
* Use `[[maybe_unused]]` when it is available to avoidDerek Mauro2024-04-161-1/+2
| | | | | | | -Wused-but-marked-unused warnings PiperOrigin-RevId: 625430612 Change-Id: Ia9d2e47984e1e6f91966afae8a6750119ae69446
* [gtest] Use `std::index_sequence` and friends instead of rolling our ownLawrence Wolf-Sonkin2024-04-041-44/+10
| | | | | | | | | * 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
* Reland: Optimize Google Test process startupAbseil Team2024-03-081-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-051-12/+17
| | | | | PiperOrigin-RevId: 612878184 Change-Id: Ia8e23da1ad09c2e0ce635a855f0c250f368f6878
* Optimize Google Test process startupAbseil Team2024-03-051-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
* changed http to httpsrefs/pull/4349/headsthd2023-08-221-5/+5
|
* Merge pull request #4330 from IncludeGuardian:remove-iomanipCopybara-Service2023-08-081-1/+0
|\ | | | | | | | | PiperOrigin-RevId: 554867591 Change-Id: Ib32da50384951532419cb54fb70f8ab0920178d7
| * Remove public includes of `<iomanip>`refs/pull/4330/headElliot Goodrich2023-08-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #4313 from kimvaleen:mainCopybara-Service2023-07-181-13/+14
|\ \ | |/ |/| | | | | PiperOrigin-RevId: 549039222 Change-Id: I96bea310beede5ba0ed6160155251ffd9d7a2103
| * Fixed variables that could be declared 'const'refs/pull/4313/headkimvaleen2023-07-111-1/+1
|/
* Use '=default' to define trivial constructor/destructorsrefs/pull/4221/headTom Hughes2023-04-211-1/+1
| | | | | | | https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html PiperOrigin-RevId: 526079054 Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
* Use "#ifdef GTEST_OS_..." instead of "#if GTEST_OS_..."Tom Hughes2023-03-061-2/+2
| | | | | | | This is compatible with compiling with "-Wundef" (#3267). PiperOrigin-RevId: 513943378 Change-Id: I47cf5fabbb77be061c4483a0adc54511af6b191c
* Avoid redundant declaration of static constexpr members in c++17Dino Radakovic2023-02-221-0/+2
| | | | | | | | | Keep declarations in c++ < 17 using new macro, GTEST_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL. Fixes #4148. PiperOrigin-RevId: 511510401 Change-Id: I76c3f2fccf07a0978adcbe5f8f0203b9d0c33872
* Remove FloatingPoint::Max() in favor of std::numeric_limits::max()Derek Mauro2023-01-241-14/+0
| | | | | | | | | | | In #4113 a user says Max clashes with a macro. Since it is only used in a test, use std::numeric_limits::max() instead. Note that in headers, the macro issue can be mitigated with parenthesis like this: `(std::numeric_limits<T>::max)()` PiperOrigin-RevId: 504284906 Change-Id: Ibf430caec1a6afdf6b303534fec6a4fd00a6373f
* IWYU: Add missing std includesTom Hughes2023-01-051-0/+1
| | | | | PiperOrigin-RevId: 499893032 Change-Id: I33304802b7c82ae2d008f3ee89df38866e5f57ba
* Merge pull request #3927 from yutotnh:fix-typoCopybara-Service2022-07-181-1/+1
|\ | | | | | | | | PiperOrigin-RevId: 461699509 Change-Id: I9bab4474c5f52d4d66691dfb96a4d20f89fbcfeb
| * fix: some typos in commentyutotnh2022-07-011-1/+1
| |
* | Merge pull request #3928 from venik:venik-clean-upCopybara-Service2022-07-121-2/+1
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 460455562 Change-Id: I29efc09887651d8734586703fe0691482ba4c981
| * | cleanup from unique_ptr branchrefs/pull/3928/headAlexander Nikforov2022-07-011-2/+1
| |/
* | Enable heterogeneous lookup for RegisteredTestsMap.Chris Kennelly2022-07-071-1/+2
|/ | | | | PiperOrigin-RevId: 459529190 Change-Id: I6b29693000023b3562990742f27a98cc279b6452
* Remove undefined internal function.Abseil Team2022-06-091-8/+0
| | | | | | | Fixes #3856 PiperOrigin-RevId: 453992227 Change-Id: I5f3330a454bdcd6b0522ebba4cdfe2c888f8e638
* Remove the legacy internal GTEST_DISALLOW_* macrosDerek Mauro2022-04-221-33/+41
| | | | | PiperOrigin-RevId: 443715444 Change-Id: I3ffd54b63d2728ae4a668ee7875c8c3c8188087c
* Running clang-format over all of GoogleTestAbseil Team2022-03-151-115/+123
| | | | | | | | | | | | | | | | A few tests are examining code locations and looking af the resulting line numbers to verify that GoogleTest shows those to users correctly. Some of those locations change when clang-format is run. For those locations, I've wrapped portions in: // clang-format off ... // clang-format on There may be other locations that are currently not tickled by running clang-format. PiperOrigin-RevId: 434844712 Change-Id: I3a9f0a6f39eff741c576b6de389bef9b1d11139d
* Consistently apply IWYU pragmas across googletest and googlemock headersAbseil Team2022-01-181-1/+5
| | | | | PiperOrigin-RevId: 422559250 Change-Id: I9f630f2186724950e5e9fbd7093d5264e8bf0a71
* Fix remaining typos discovered by codespellrefs/pull/3581/headChristian Clauss2021-09-241-2/+2
|
* Googletest exportAbseil Team2021-07-221-2/+0
| | | | | | Delete GOOGLETEST_CM.* tags from C++ code. PiperOrigin-RevId: 386268534
* chore: fix spellingrefs/pull/3364/headJohn Bampton2021-04-151-1/+1
|
* Internal changeAbseil Team2021-03-161-4/+4
| | | | PiperOrigin-RevId: 362216935
* Googletest exportAbseil Team2021-02-181-3/+3
| | | | | | Make include guards conform with https://google.github.io/styleguide/cppguide.html#The__define_Guard, attempt #2 PiperOrigin-RevId: 357056902
* Googletest exportAbseil Team2021-02-111-3/+3
| | | | | | Revert include guard fix PiperOrigin-RevId: 356588893
* Googletest exportAbseil Team2021-02-111-3/+3
| | | | | | Make include guards conform with https://google.github.io/styleguide/cppguide.html#The__define_Guard PiperOrigin-RevId: 355882793
* Googletest exportAbseil Team2021-02-051-4/+0
| | | | | | Remove uses of GTEST_HAS_TYPED_TEST_P and GTEST_HAS_TYPED_TEST. PiperOrigin-RevId: 353935996
* Googletest exportAbseil Team2020-11-121-8/+3
| | | | | | | Use a tagged constructor for FlatTuple instead. Some versions of MSVC are getting confused with that constructor and generating invalid code. PiperOrigin-RevId: 342050957
* fix typosrefs/pull/3109/headHyuk Myeong2020-11-081-3/+3
|
* Googletest exportdmauro2020-10-151-1/+1
| | | | | | | Fixes build warnings from previous CL Add CMake to internal presubmit to prevent these PiperOrigin-RevId: 337325504
* Googletest exportAbseil Team2020-10-141-3/+9
| | | | | Add ::testing::FieldsAre matcher for objects that support get<> and structured bindings. PiperOrigin-RevId: 337165285
* Googletest exportdmauro2020-10-141-4/+12
| | | | | | Disable -Wmismatched-tags warning for struct/class tuple_size PiperOrigin-RevId: 337087493
* Googletest exportdmauro2020-10-141-2/+2
| | | | | | Fix -Wmismatched-tags error with struct tuple_size vs class tuple_size PiperOrigin-RevId: 336930166
* Googletest exportofats2020-10-141-14/+48
| | | | | | Add helper methos to internal FlatTuple. Refactor constructors. PiperOrigin-RevId: 336306681
* Merge pull request #2837 from inazarenko:duck_type_protosDerek Mauro2020-10-141-4/+27
|\ | | | | | | PiperOrigin-RevId: 336087297
| * Detect proto messages based on presense of DebugString.Igor Nazarenko2020-05-051-4/+27
| |
* | Merge pull request #2972 from srz-zumix:fix/remove_legacy_testcase_api_Derek Mauro2020-08-071-0/+12
|\ \ | | | | | | | | | PiperOrigin-RevId: 325220934
| * | fix testssrz_zumix2020-08-021-0/+12
| | |
* | | fix clang tidy modernize-use-equals-default warningsrefs/pull/2952/headjasjuang2020-07-191-1/+1
|/ /
* | Merge pull request #2903 from AmatanHead:informative-exception-assertsvslashg2020-07-151-32/+81
|\ \ | | | | | | | | | PiperOrigin-RevId: 320425648
| * | Make EXPECT_THROW and EXPECT_NO_THROW macros more informativeVladimir Goncharov2020-06-201-5/+38
|/ / | | | | | | | | | | EXPECT_THROW and EXPECT_NO_THROW will now print exception type and message when an unexpected std::exception-derived error is thrown. Fixes #2878
* | Googletest exportAbseil Team2020-05-141-1/+6
|/ | | | | | | | Fixed #2823 - Make it so that a semicolon appearing after an invocation of GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ does not trigger a redundant semicolon warning. This works by introducing an else block with a statement that intentionally does not end with a semicolon, forcing users to place the semicolon after the expansion. The approach here is preferred as opposed to removing semicolons that appear after each invocation because complete statements that do not have a visible semicolon or braces confuse users and code formatters, since the macro invocation looks superficially like an expression. PiperOrigin-RevId: 311327491
* Merge pull request #2818 from inazarenko:masterGennadiy Rozental2020-05-011-13/+2
|\ | | | | | | PiperOrigin-RevId: 308711492
* \ Merge pull request #2818 from inazarenko:masterGennadiy Rozental2020-05-011-2/+13
|\ \ | |/ | | | | PiperOrigin-RevId: 308650221