4300 Commits

Author SHA1 Message Date
Copybara-Service
ccdeec888e Merge pull request #4225 from TurboGawron:non_moveable_struct_fix
PiperOrigin-RevId: 526972449
Change-Id: I77d8bd37807f6c6ab5256f1e6c4abc64cceee740
2023-04-25 08:21:31 -07:00
Patryk Gawroński
51eeae5a55 gmock: fix issue #4222
Rename 'Result' struct to 'NonMoveableStruct' in
gmock-spec-builders_test.cc in ExpectCallTest.NonMoveableType test
2023-04-25 01:45:26 +02:00
Tom Hughes
783d00fd19 Use '=default' to define trivial constructor/destructors
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html

PiperOrigin-RevId: 526079054
Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
2023-04-21 10:41:25 -07:00
Tom Hughes
baf182e006 Use the empty method to check for emptiness
PiperOrigin-RevId: 526046714
Change-Id: I6ad0deff2a7f6dfef75a643c95ad914c83b9ba38
2023-04-21 08:42:42 -07:00
Tom Hughes
a5308bb992 Add missing std includes
PiperOrigin-RevId: 525850646
Change-Id: I64387f5b933beb79cd05636dca81b7a75213383e
2023-04-20 14:29:09 -07:00
Tom Hughes
9c1efac2a1 Use std::make_unique
PiperOrigin-RevId: 525828947
Change-Id: I66f47c835bc93ba171eba0da8df09eff89c6c77b
2023-04-20 13:09:18 -07:00
Tom Hughes
d7fb5e1af4 Fix spelling
PiperOrigin-RevId: 525820426
Change-Id: Ib5baa8da4a54ebb17b6ace12240ed03eedb46091
2023-04-20 12:36:18 -07:00
Tom Hughes
d8a5fb7ee6 Add missing std includes
PiperOrigin-RevId: 525794940
Change-Id: Ib2639058610c91cbffbb0f22a5e71573e0cbd651
2023-04-20 11:01:56 -07:00
Tom Hughes
01bcf8c70d Make parameter names in function declaration match the names in the
definitions

https://clang.llvm.org/extra/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.html

PiperOrigin-RevId: 525752102
Change-Id: Ibf9d3d1dbae8f95cfc7c6ad29fe4b677f4ee19cf
2023-04-20 08:22:57 -07:00
Copybara-Service
d25e625364 Merge pull request #4219 from jerylvaz:main
PiperOrigin-RevId: 524932412
Change-Id: Ie70282f7e82cb3b9442bd15bbe49bb9b00e56eb9
2023-04-17 13:23:38 -07:00
Abseil Team
922e0b7d80 Update gMock Cookbook to reflect deprecation of testing::ByMove
PiperOrigin-RevId: 524868227
Change-Id: I702ede27570e3d3f06d534d6ccf8b39689105d07
2023-04-17 09:31:34 -07:00
Jeryl Vaz
952560d3ec Suppress a clang-tidy warning in the MATCHER_P macro 2023-04-14 11:15:21 +02:00
Copybara-Service
12a5852e45 Merge pull request #3993 from pgroke-dt:work-around-GCC-11-ADL-bug
PiperOrigin-RevId: 523706897
Change-Id: If6dcc97c81a20f8fe675241518ae1d6cf23ebf39
2023-04-12 08:28:57 -07:00
Abseil Team
8fa9461cc2 Fix FunctionMocker compilation slowdown in 9d21db9e0a60a1ea61ec19331c9bc0dd33e907b1
The slowdown appears to be due to an implicit conversion of distinct (yet semantically identical) lambdas to `std::function`. Lifting out the lambdas into functors that don't get re-instantiated reduces compilation times by nearly half.

Fixes #4156

PiperOrigin-RevId: 523447948
Change-Id: Ib0ae0761a54d7b1f2b706b14b2858eedf47e2297
2023-04-11 10:55:11 -07:00
Abseil Team
7f6f9c12ad Support --gtest_stream_result_to on macOS
This seems to just have been an oversight. POSIX socket APIs work just
fine on macOS.

Fixes https://github.com/google/googletest/issues/4214.

PiperOrigin-RevId: 523398386
Change-Id: I9d56cd9c6933318c1f0b0024f7fef44122fd0c83
2023-04-11 07:41:50 -07:00
Abseil Team
057b4e904f gtest.cc: run tests within a test suite in a deterministic order.
Ensure that tests are run in the order specified in the source code, even if
they are registered manually using RegisterTest. There should be no behavior
change for the common case.

PiperOrigin-RevId: 522136303
Change-Id: If155e2666780af0e514fbbf5ff2b157d5fe2fef1
2023-04-05 13:27:21 -07:00
Abseil Team
7ee260c549 Rolled back due to breaking existing tests.
PiperOrigin-RevId: 521555658
Change-Id: I09742faceb82b2b7ceb423e850a8b50d532ad6ff
2023-04-03 14:01:45 -07:00
Aaron Jacobs
b5fd99bbd5 gtest.cc: run tests within a test suite in a deterministic order.
Ensure that tests are run in the order specified in the source code, even if
they are registered manually using RegisterTest. There should be no behavior
change for the common case.

PiperOrigin-RevId: 520729483
Change-Id: I400c78400c6929fccae0676214d993251f31888f
2023-03-30 13:35:22 -07:00
Abseil Team
0cd05c6ea9 Update naming to "GoogleTest" in the GoogleTest Primer.
PiperOrigin-RevId: 520409541
Change-Id: I75a0b8615ece923137d4f5dcdb915f38e4c3b1b2
2023-03-29 12:25:22 -07:00
Copybara-Service
ca0d46e95d Merge pull request #4103 from gonzalobg:bugfix/nvcxx_support
PiperOrigin-RevId: 520017251
Change-Id: Ib2be28787b739344c80a5d937f875737ba44a0ec
2023-03-28 07:04:28 -07:00
Derek Mauro
3656c2713e Fix redundant redeclaration warning
Fixes #4200

PiperOrigin-RevId: 520017094
Change-Id: Id707a1c0489edde083771ccd412d7035612474dc
2023-03-28 07:03:07 -07:00
Derek Mauro
13b1900717 Remove the Win64 arch from the CMake Generator since
this can't be used with MSVC 2022

We also have to use Python 3.4 since that is what the base image has,
however, I will create a new image soon that has a modern version
of Python.

PiperOrigin-RevId: 520010732
Change-Id: Icf2420fd97d2bbc310382a17793045b6e16d62bb
2023-03-28 06:28:10 -07:00
Derek Mauro
88af49efa7 Migrate CI builds to MSVC 2022
PiperOrigin-RevId: 519792199
Change-Id: Ic821b264bf1aef5e03f22fb0e288dd9d56fd536b
2023-03-27 12:10:12 -07:00
Abseil Team
e9fb5c7bac Replace const char* with absl::string_view as the latter is preferred.
PiperOrigin-RevId: 519122695
Change-Id: I7dcf969d15d26ccc4b376e3ab6db7f4c08c7386f
2023-03-24 05:58:11 -07:00
Abseil Team
a0ced33ac6 Internal Code Change
PiperOrigin-RevId: 519071084
Change-Id: I6459d60606e93bf658e505544538367508722857
2023-03-24 00:23:16 -07:00
Abseil Team
6f01e3dc12 Internal Code Change
PiperOrigin-RevId: 518810140
Change-Id: Id3f9471f827894761080bc9199b0a092dc829b5f
2023-03-23 03:08:22 -07:00
gonzalobg
5d6ba6d3b0 Add doc comment 2023-03-23 10:28:12 +01:00
Aaron Jacobs
5fce13091d gtest.cc: add a newline after a failure when there is no OS stack trace.
This makes the behavior consistent when GTEST_STACK_TRACE_DEPTH is set to zero
and not: there is always vertical whitespace separating failure messages.

PiperOrigin-RevId: 518744611
Change-Id: I5b4af40633849850660504c3f497a76601d4311d
2023-03-22 20:19:44 -07:00
Abseil Team
974e18ee6f Fix minor bug -- if ExecDeathTestChildMain() ever returns, we should exit
with a non-zero status.

PiperOrigin-RevId: 518306642
Change-Id: I72fb2764e477acb0362593c63f7748c4f64db0c6
2023-03-21 10:07:29 -07:00
Abseil Team
e9faae170f Internal Code Change
PiperOrigin-RevId: 518213370
Change-Id: I88d0acc195dadf8d03cd15c8534c721141db14ea
2023-03-21 02:36:37 -07:00
Copybara-Service
fa87209829 Merge pull request #4157 from dpogue:patch-1
PiperOrigin-RevId: 518065122
Change-Id: I3a71c85626050b9aecebd4aa10d668ea3c48c82c
2023-03-20 13:46:39 -07:00
Phoebe Liang
3288c4deae Revise documentation to include AbslStringify
PiperOrigin-RevId: 518039451
Change-Id: Ife548d0f83266746ce1981bea31e70e6b43027c9
2023-03-20 12:11:55 -07:00
Abseil Team
471087fbfc Introduce std::make_unique and bool literals where possible
PiperOrigin-RevId: 517910526
Change-Id: I398704f4b2ca0a55c86a06ca8b47d34c8670ddd7
2023-03-20 02:43:48 -07:00
Abseil Team
9fd3fb00ff Remove unused using-declarations in sample unit tests
PiperOrigin-RevId: 517910369
Change-Id: I87f29fb09bc83e7d1c7cffdf267b2f691d261c26
2023-03-20 02:42:55 -07:00
Abseil Team
28219b169c Fix typo in test case name.
PiperOrigin-RevId: 517814929
Change-Id: I2bc498ba048d4deab1cf2a021487f63fe44c466d
2023-03-19 14:30:57 -07:00
Copybara-Service
837f2229a9 Merge pull request #4182 from venik:venik-char8-lib-fix
PiperOrigin-RevId: 517470997
Change-Id: I12b079dc1536f136dd0514871fe79f9678b1fd6a
2023-03-17 11:58:34 -07:00
Copybara-Service
e49c6b946a Merge pull request #4180 from sergio-nsk:patch-3
PiperOrigin-RevId: 517200256
Change-Id: I2ad5d4644f9e2095909ef646a7207c42a38082cf
2023-03-16 12:46:37 -07:00
Deanna Garcia
f53219cdcb Move transitive dependencies of googletest to googletest_deps.bzl to allow other bazel projects to depend on that rule instead of googletests' transitive dependencies directly.
PiperOrigin-RevId: 517166391
Change-Id: I9158e24d3f9613f3bcc811c028e1a15f213b7c40
2023-03-16 10:48:24 -07:00
Maciej Sroczyński
abad8af018 Add COMPONENT to install 2023-03-14 23:48:08 +01:00
Abseil Team
391ce627de Internal Code Change
PiperOrigin-RevId: 515855852
Change-Id: I8016eefd45c36089e189bbd1ebbe9fdabe68255b
2023-03-11 02:48:36 -08:00
Lawrence Wolf-Sonkin
038e392ebd [gtest] Drop custom-rolled heterogeneous comparator functors in favor of C++ standard ones
* Standard heterogeneous comparator functors such as `std::equal_to<>` and `std::less<>` [have been available since C++14](https://en.cppreference.com/w/cpp/utility/functional/less_void)
* Now that [C++14 is the minimum supported version of C++ in Googletest](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md), let's delete these duplications of the standard library

PiperOrigin-RevId: 515743068
Change-Id: I1563a2f94039c3a6688429298555545a922f6d7e
2023-03-10 14:43:13 -08:00
Sergey
2d3b36d40a Environment variables are accessible in UWP/WinRT apps
Environment variables, for example `GTEST_FILTER`, `GTEST_OUTPUT` can be set
before getting WinRT app run. GoogleTest can read environment variables and use
them. It's easier than setting and passing command line parameters to WinRT app.
2023-03-10 09:30:49 -07:00
Abseil Team
50e07d1c92 Apply clang-tidy fixes
PiperOrigin-RevId: 515265927
Change-Id: Iea11668fa4bbf08f6d418a3823e836fb5b874dcc
2023-03-09 01:19:58 -08:00
Abseil Team
48a1b11058 Add a comment to clarify Fuchsia process launcher requirement.
PiperOrigin-RevId: 515154129
Change-Id: I3dd9e912e160d09d1f74a467336212701d4e1b7d
2023-03-08 15:10:45 -08:00
Abseil Team
82a570453c Apply clang-tidy fixes
PiperOrigin-RevId: 514936218
Change-Id: I24c443a2ca75c875052b0cf2d0a48e808d03ae43
2023-03-07 22:33:56 -08:00
Tom Hughes
a798c2f102 Add -Wundef to the CI scripts when building with Bazel
The CMake build already adds -Wundef for gcc/clang. This change makes sure that
the gcc/clang Bazel builds also compile correctly with -Wundef (#3267).

PiperOrigin-RevId: 514864451
Change-Id: I7798a4a4c68d037e23625db24ee29df454367734
2023-03-07 15:58:12 -08:00
Tom Hughes
678c1c73de Fix compilation of googletest-printers-test.cc when using -Wundef
#3267

PiperOrigin-RevId: 514858420
Change-Id: Ic712aafad25f5e63ae48f647557de95cef890978
2023-03-07 15:34:41 -08:00
Abseil Team
cf4f4400db Suppress std::string DLL interface warning introduced in commit f063cd25c90cbd4089a0ff96f5991df4f2721338
Fixes #4171

PiperOrigin-RevId: 514777144
Change-Id: I6f4b309c407684522fc1bc94dcc980ea1fe09cd9
2023-03-07 10:40:39 -08:00
Abseil Team
1a727c27aa Internal Code Change
PiperOrigin-RevId: 514678702
Change-Id: I5b0089d905152ccb85022be395ed340e42586234
2023-03-07 03:06:06 -08:00
Alexander Nikforov
92f0d72507 __cpp_char8_t does not cover std::u8string implementation, but __cpp_lib_char8_t does 2023-03-06 16:34:55 -08:00