4208 Commits

Author SHA1 Message Date
Abseil Team
dfa6735236 Add GoogleTest workaround for MSVC crash with Address Sanitizer (ASAN) on version 17.3.3
PiperOrigin-RevId: 477240422
Change-Id: I894037850617252e462783c0885e30fc8e7ad122
2022-09-27 12:09:46 -07:00
Christian Clauss
9836817d82
Branding: macOS 2022-09-27 12:47:32 +02:00
Christian Clauss
83bd792e36
Upgrade GitHub Actions Checkout
https://github.com/actions/checkout/releases
2022-09-27 12:44:59 +02:00
Marat Dukhan
7a3abfec0a Port GoogleTest to QuRT (Hexagon RTOS) 2022-09-26 14:49:00 -07:00
Baruch
173dd7c7d6
Merge branch 'google:main' into custom_type_combine 2022-09-25 13:35:27 +03:00
Copybara-Service
63907e1bfe Merge pull request #4011 from softwaregravy:patch-1
PiperOrigin-RevId: 475928562
Change-Id: I0539fa76b788410dd88b3285056a3b6a324dbc52
2022-09-21 14:45:58 -07:00
John Hinnegan
05cc575c65
Update link to Bazel installation guide
The Bazel docs have moved!
2022-09-18 10:54:36 -04:00
Paul Groke
096014a45d work around GCC 6~11 ADL bug
see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51577
ADL seems to work properly when we do the SFINAE check via the return type, but not when using a dummy template parameter

fix #3992
2022-09-15 13:36:49 +02:00
Baruch
56070d8903
Merge branch 'google:main' into custom_type_combine 2022-09-14 21:46:21 +03:00
Derek Mauro
1336c4b6d1 Fix MSVC C++14 flag for GitHub workflow
PiperOrigin-RevId: 474053482
Change-Id: If5cdf7458139ba3ad04b8c078734d6890199a348
2022-09-13 10:13:37 -07:00
Derek Mauro
7cafeff7bd Rollback 4fa8cfe3f4dee8975ee02d98633a5245ab67c6d7
Breaks the intended C++ version on some CI builds

PiperOrigin-RevId: 474022587
Change-Id: I41a58893802c90864e0f2cc3d15e6c169c59146d
2022-09-13 08:15:24 -07:00
Copybara-Service
4fa8cfe3f4 Merge pull request #3984 from keith:ks/bazel-move-std-c-14-to-.bazelrc
PiperOrigin-RevId: 473908876
Change-Id: Ie850a4029c33fa9eec5f670a18f70b2cf6635d6f
2022-09-12 20:06:25 -07:00
Abseil Team
c29315dda4 Use UnorderedElementsAre in example about using matchers with maps
PiperOrigin-RevId: 473353707
Change-Id: Ief5bdbd2b8e28bac8f47be9aaeac4bb93875a793
2022-09-09 15:14:57 -07:00
Abseil Team
0f6885405c Remove obsolete MSVC warning pragmas for Invalid<T>()
Remove the MSVC pragmas for disabling warning C4717 (infinite recursion) for
Invalid<T>() because that warning has been fixed in cl/441474979.

PiperOrigin-RevId: 473012585
Change-Id: I5f1bf88379bd4f2bf005e029c04766ac4caadd84
2022-09-08 09:42:31 -07:00
Abseil Team
0e0d9feefa Fixed header guards to match style guide conventions.
PiperOrigin-RevId: 471524660
Change-Id: Ie11e6a7a5a5497f64d5b9c382f1017094e043093
2022-09-01 07:25:03 -07:00
Copybara-Service
9080381758 Merge pull request #3916 from asmodai27:main
PiperOrigin-RevId: 471062949
Change-Id: I3f063c441b3d4275d931016c431519c14e68d51c
2022-08-30 12:40:01 -07:00
Abseil Team
afd902e992 Consider all TERM values ending in "-256color" to be color supporting. In particular this handles TERM=hterm-256color correctly.
PiperOrigin-RevId: 470232889
Change-Id: Iea594a3fde2b8b0a10e527956d70ba0bb3452e08
2022-08-26 06:35:30 -07:00
Baruch
dd969ed5fe
Merge branch 'google:main' into custom_type_combine 2022-08-25 10:55:49 +03:00
Hardik Vala
25cc5777a1 Add support of 19-member structs to gmock UnpackStructImpl.
PiperOrigin-RevId: 469171380
Change-Id: Ic75fc0523924e40e620552d4c04b79dad22a68e0
2022-08-22 06:42:57 -07:00
Keith Smiley
91c3669f21
bazel: move -std=c++14 to .bazelrc
Bazel defaults to -std=c++11 on macOS which gtest doesn't support.
2022-08-19 11:11:26 -07:00
Derek Mauro
c0e032efe5 Update README.md to point to the Foundational C++ Support Policy
PiperOrigin-RevId: 467959285
Change-Id: Ibd92b3a278f293736b31bd7e07fe502241bb1f05
2022-08-16 10:23:59 -07:00
Derek Mauro
7274ec1864 Add --features=external_include_paths to Bazel CI to ignore warnings
from dependencies

PiperOrigin-RevId: 467244441
Change-Id: Iefa65474d8c62e7c4c942957dc8e275715076e5f
2022-08-12 10:46:39 -07:00
Dino Radakovic
4c9a3bb62b gtest_unittest: Call FAIL() in lambda, fix incorrect fatality expectation
FAIL() evaluates into a return statement: 5b909beeec/googletest/include/gtest/internal/gtest-internal.h (L1347)
Calling it from the body of the test case turns all subsequent expectations into no-ops.

Fixes #3941

PiperOrigin-RevId: 466104977
Change-Id: Ic15f43acb734295a5c9690a2b5eec6f65e8c0814
2022-08-08 11:48:12 -07:00
Dino Radakovic
5b909beeec Explicitly instantiate matchee std::string in MatchesRegex
If this ever turns out to be a performance issue, we could use std::conditional and std::is_same to avoid copying std::strings.

Fixes #3949

PiperOrigin-RevId: 465353572
Change-Id: If2d691bccb626c692c87e006df5afe88a4ed1542
2022-08-04 10:53:57 -07:00
Copybara-Service
6045bf2ade Merge pull request #3918 from assafpr:master2main
PiperOrigin-RevId: 464586117
Change-Id: Icda62f13b962f7408bb5698ae2b627391257d152
2022-08-01 11:47:51 -07:00
Copybara-Service
fa3f444be1 Merge pull request #3951 from matdibu:main
PiperOrigin-RevId: 464546862
Change-Id: I6ee696f4f66a5f76015a36737b5cde5edc91a9bc
2022-08-01 08:59:08 -07:00
Baruch Burstein
3280a930bf Custom type with Combine(). Fix for #3781 2022-07-31 22:50:04 +03:00
Abseil Team
dd7a9d29a3 Add support of 18-member structs to gmock UnpackStructImpl.
PiperOrigin-RevId: 463961734
Change-Id: Ib62e320a745c190955f181c1f4f12e4cd407ef22
2022-07-28 17:15:30 -07:00
Copybara-Service
3bc8fb3723 Merge pull request #3953 from georgthegreat:patch-1
PiperOrigin-RevId: 463379193
Change-Id: Iac9757644b1f2b9a840dc78d82b4e3f44a230573
2022-07-26 10:57:52 -07:00
Dino Radakovic
b1e9b6323a Add IsEmpty overload for C-style strings
Fixes #3937

PiperOrigin-RevId: 463180144
Change-Id: I21b528acc4c3f3aba4234642be01fcead7fe7f00
2022-07-25 14:38:26 -07:00
Yuriy Chernyshov
aa2e91fd69
Continuation for #3183
Some of the #ifdefs were missed in original PR.
Should be fixed now.
2022-07-21 14:25:43 +03:00
Matei Dibu
61720589cb gtest-death-test: add 'noreturn' 2022-07-20 19:16:51 +03:00
Copybara-Service
7735334a46 Merge pull request #3940 from anpol:pdb-static-lib
PiperOrigin-RevId: 461703446
Change-Id: I61773eafa6d6bf6294218a5117fdebf5dd8a7bb1
2022-07-18 13:45:12 -07:00
Copybara-Service
43a6712a0c Merge pull request #3946 from anpol:export-tlvhbase
PiperOrigin-RevId: 461701938
Change-Id: I92601aeef9f0bb18a6d1c8b08e497d93dde4012a
2022-07-18 13:39:19 -07:00
Copybara-Service
71feea653b Merge pull request #3939 from anpol:python-find-strategy
PiperOrigin-RevId: 461699564
Change-Id: Id7043073f106f57433a99fea0e8e4ab015bf896d
2022-07-18 13:30:20 -07:00
Copybara-Service
91480a4e79 Merge pull request #3927 from yutotnh:fix-typo
PiperOrigin-RevId: 461699509
Change-Id: I9bab4474c5f52d4d66691dfb96a4d20f89fbcfeb
2022-07-18 13:29:19 -07:00
Copybara-Service
760acf30e3 Merge pull request #3921 from Krzmbrzl:patch-1
PiperOrigin-RevId: 461660066
Change-Id: Ie23e046caf24d350c91e4ee3c4baf512780c6984
2022-07-18 10:48:58 -07:00
Robert Adam
2d1cd6ee27 Set cmake policy CMP0069
This ensures that LTO works as expected whenever the main project
has it enabled.
2022-07-18 07:36:40 +02:00
Andrei Polushin
3655149a60 export ThreadLocalValueHolderBase which is required by exported APIs.
fixes #3944
2022-07-14 21:36:41 +07:00
Andrei Polushin
a2d6ee847e cmake: make PDB output directory match that of a static library.
PDB files should be created at the same location as their primary
artifact, which is either static library or a DLL.

On Windows, an artifact location is controlled by:

* RUNTIME_OUTPUT_DIRECTORY is a directory of a DLL artifact.
* ARCHIVE_OUTPUT_DIRECTORY is a directory of a LIB artifact.

A PDB file location is controlled:

* PDB_OUTPUT_DIRECTORY should match a directory of a DLL artifact.
* COMPILE_PDB_OUTPUT_DIRECTORY should match a directory of a LIB artifact.
2022-07-13 02:13:34 +07:00
Andrei Polushin
96ddde1235 cmake: find python in order specified by PATH environment variable.
CMake policy CMP0094 controls a lookup strategy used to find a Python
executable:

* CMP0094=OLD selects a Python executable with a higher version.
* CMP0094=NEW selects a Python executable found earlier in PATH.

NEW behavior is critical in presence of a Python virtual environment
established and activated, i.e. added to the PATH variable.

In case GoogleTest is embedded into a larger project, the result of
`find_package(Python)` affects the whole build, not only GoogleTest
component itself.
2022-07-13 02:12:53 +07:00
Copybara-Service
bea621c3c3 Merge pull request #3928 from venik:venik-clean-up
PiperOrigin-RevId: 460455562
Change-Id: I29efc09887651d8734586703fe0691482ba4c981
2022-07-12 07:19:18 -07:00
Copybara-Service
78aa2ba440 Merge pull request #3787 from codeinred:fix-quickstart
PiperOrigin-RevId: 460272863
Change-Id: I139e31faca4dab6f697e0cd1b3491f791fda5f8a
2022-07-11 12:23:26 -07:00
Derek Mauro
4086e92d86 Add envvar BAZEL_CXXOPTS=-std=c++14 to the GitHub Actions CI
PiperOrigin-RevId: 460242683
Change-Id: I182a2e082d3a7e38fd3686e9e7af200ba0f954e0
2022-07-11 10:17:32 -07:00
Copybara-Service
2e1346de56 Merge pull request #3868 from eidosmontreal:fix_undefined_symbol_kMaxRange
PiperOrigin-RevId: 460222898
Change-Id: I652b8058aa98b56d849c5ab1399f75e531dcc959
2022-07-11 08:49:28 -07:00
Copybara-Service
8f01400b77 Merge pull request #3844 from akohlmey:intel-llvm-utf8-fix
PiperOrigin-RevId: 460222266
Change-Id: I2fbeac0b333ca16639f172ca1f23794ea9ddc2ad
2022-07-11 08:46:06 -07:00
Derek Mauro
4556086674 CMake: raise the default C++ standard to cxx_std_14
PiperOrigin-RevId: 459761499
Change-Id: Ifb4b8b9f2dc598f3f4afc66a9efc403e001e0262
2022-07-08 08:21:42 -07:00
Chris Kennelly
e009c3d3dc Enable heterogeneous lookup for RegisteredTestsMap.
PiperOrigin-RevId: 459529190
Change-Id: I6b29693000023b3562990742f27a98cc279b6452
2022-07-07 09:18:52 -07:00
Alexander Nikforov
7107c44188 cleanup from unique_ptr branch 2022-07-01 15:33:13 -07:00
Derek Mauro
4219e7254c Remove the Bazel provided default cxxopt -std=c++0x and replace it
with -std=c++14 when testing with GCC 5.

PiperOrigin-RevId: 458502826
Change-Id: I83637a222b5c0a54e55d93ce7fdbc878af27b250
2022-07-01 10:53:54 -07:00
yutotnh
644a4bea02
fix: some typos in source 2022-07-01 18:33:14 +09:00
yutotnh
6c57d607c7
fix: typo in test name 2022-07-01 18:33:00 +09:00
yutotnh
2cf9987ce3
fix: some typos in comment 2022-07-01 18:32:49 +09:00
Derek Mauro
96f51426e4 Remove support for C++11
v1.12.x is the last branch to support C++11
Future releases will require at least C++14

PiperOrigin-RevId: 458250106
Change-Id: Ibee2248649ff3c13daaa179135887848bf730f3f
2022-06-30 09:53:51 -07:00
Derek Mauro
219af0d535 Update version number in CMakeLists.txt
Note that this is 1.12.1 as there will be a patch release to fix this

PiperOrigin-RevId: 458216994
Change-Id: Ibca52a8db22ed06cb1a1adc4832be67fce69459a
2022-06-30 07:10:22 -07:00
Abseil Team
d9335595b4 Add support of 17-member structs to gmock UnpackStructImpl.
PiperOrigin-RevId: 458018249
Change-Id: I7df8f75ef5b5a6478e7301f959c221810ff9f0b3
2022-06-29 11:10:54 -07:00
Abseil Team
9406a60c78 Mark internal-only function as having internal linkage.
PiperOrigin-RevId: 457550818
Change-Id: I9046801b64ce4581d742d650451332fd56489632
2022-06-27 13:16:09 -07:00
Copybara-Service
cdbed602b9 Merge pull request #3912 from jarkenau:main
PiperOrigin-RevId: 457479731
Change-Id: Ia883186c01886196f23c3957381566eab3d76c5f
2022-06-27 07:55:52 -07:00
assafpr
dd72ed19fe
Update gtest.cc
fix a broken link
2022-06-27 09:59:06 +03:00
assafpr
d0af91ead3
Update gmock-matchers.h
branch master changed to main on link
2022-06-27 09:56:59 +03:00
assafpr
1547c2acc8
Update gmock-actions.h
master branch changed to main in links
2022-06-27 09:55:28 +03:00
assafpr
66d2463610
Update gmock-spec-builders_test.cc
master branch changed to main in link
2022-06-27 09:53:40 +03:00
assafpr
64df55449a
Update gtest-death-test.cc 2022-06-27 09:51:44 +03:00
assafpr
dfa990f942
Update gmock-spec-builders.cc 2022-06-27 09:50:36 +03:00
assafpr
df4b8edee0
Update advanced.md
master branch changed to main branch in links
2022-06-27 09:48:05 +03:00
Jérôme Travert
5eaa113903
Avoid implicit conversion from int to char 2022-06-26 19:01:00 +02:00
Jérôme Travert
72901486ba
Avoid implicit conversion from int to char 2022-06-26 18:59:46 +02:00
Julian Arkenau
b9d2e1f62f docs: update googletest README for release 1.12.0 2022-06-25 14:41:57 +02:00
Derek Mauro
5376968f69 Update README.md for release 1.12.0
PiperOrigin-RevId: 456833286
Change-Id: Iefcc6a71f5da9bb710f112b668cddcd1683a10ae
2022-06-23 12:18:54 -07:00
Derek Mauro
15460959cb Update versions of WORKSPACE dependencies
PiperOrigin-RevId: 456532035
Change-Id: I60fa4d4e7827516d317ce893377d1f72e49c6a2f
release-1.12.0 v1.12.0-pre v1.12.0
2022-06-22 09:23:46 -07:00
assafpr
fde6af6790
documentation, change mater branch to main 2022-06-22 16:21:35 +03:00
assafpr
b59ae848d1
Update faq.md 2022-06-22 16:12:54 +03:00
assafpr
f2f099fb70
Update CONTRIBUTING.md 2022-06-22 16:09:54 +03:00
assafpr
1b772a9bc4
documentation, change mater branch to main 2022-06-22 14:36:10 +03:00
assafpr
358a3f6e3e
documentation, change mater branch to main 2022-06-22 14:31:03 +03:00
assafpr
b3f3819a62
Update gmock_output_test_golden.txt 2022-06-22 14:21:07 +03:00
assafpr
3d1dcac4c4
change link from master to main in documentation
since master branch was changed to main, the links should be changed accordingly.
2022-06-22 14:15:53 +03:00
Derek Mauro
7df7853ea0 Update GCC floor container used by CI to fix the Bazel cache error
PiperOrigin-RevId: 456323043
Change-Id: I86e3d52b72b51c2d4e96f536daa7f84a52c598f5
2022-06-21 12:27:37 -07:00
Derek Mauro
86add13493 Disable warning C4251 around refactored code
PiperOrigin-RevId: 455452553
Change-Id: I1dc3772ae61daf6d2d39484a0b1aad7eb0134525
2022-06-16 13:18:32 -07:00
Copybara-Service
191ca1f3a9 Merge pull request #3863 from eidosmontreal:fix_unused-variable_warning
PiperOrigin-RevId: 454940948
Change-Id: Ic87dadfe9c6fc8882b0f425aa2056f0cc7a90b55
2022-06-14 13:24:55 -07:00
Abseil Team
8b521aa43a gmock_cook_book.md: Delete superfluous statement from 2014.
PiperOrigin-RevId: 454677195
Change-Id: I7a1419e22d617db41a5c310bc6f6158ba4cec1ab
2022-06-13 12:51:26 -07:00
Copybara-Service
b644b4fbbf Merge pull request #3866 from eidosmontreal:simplify_shouldusecolor
PiperOrigin-RevId: 454616721
Change-Id: I33b5671646ec027da48cc941baf84b4ddc722e07
2022-06-13 08:38:29 -07:00
Gaspard Petit
fe735a6986 Move declaration of kStdOutFileNo and kStdErrFileno
Move declaration of kStdOutFileNo and kStdErrFileno closer to where they are used to avoid having to guard for GTEST_HAS_STREAM_REDIRECTION twice
2022-06-11 10:26:41 -04:00
Abseil Team
b1f84bf176 Update googletest docs to indicate that RE2 is now used for regexp implementation when building with Bazel and using Abseil.
PiperOrigin-RevId: 454012698
Change-Id: I3a9df78368ffe3cb7cf3d315001125b97b1aebbe
2022-06-09 14:25:17 -07:00
Abseil Team
49c6185ae7 Remove undefined internal function.
Fixes #3856

PiperOrigin-RevId: 453992227
Change-Id: I5f3330a454bdcd6b0522ebba4cdfe2c888f8e638
2022-06-09 12:57:51 -07:00
Derek Mauro
0320f517fd Work around a maybe-uninitialized warning under GCC 12
Some Mock constructors insert the pointer to the Mock itself into a
global registry. Since GCC cannot see how the pointer is used (only as
an identifier), it cannot tell that the object doesn't need to be
initialized at that point at all. Work around this by using uintptr_t
instead.

PiperOrigin-RevId: 452380347
Change-Id: Ia5a493057ed90719de1d0efab71de9a8a08ddf8b
2022-06-01 14:08:04 -07:00
Gaspard Petit
a86777edf9 Fix for undefined symbol: testing::internal::Random::kMaxRange 2022-05-31 17:35:34 -04:00
Abseil Team
548b13dc3c Fix internal files
PiperOrigin-RevId: 452053766
Change-Id: I9498e8809f5e66e42cfa365199a5bbc41462a533
2022-05-31 08:33:31 -07:00
Gaspard Petit
3727a90075
Merge branch 'google:main' into simplify_shouldusecolor 2022-05-30 22:01:15 -04:00
Gaspard Petit
900c3f9cd5
Merge branch 'google:main' into fix_unused-variable_warning 2022-05-30 22:00:02 -04:00
Aaron Jacobs
e649993a40 gmock-spec-builders: remove the name for an unused parameter.
This fixes unused parameter errors under both MSVC and clang (when
`-Werror=unused-parameter` is used, as reported
[here](9d21db9e0a (r74769946))).

Fixes #3858

PiperOrigin-RevId: 451907906
Change-Id: Ic07da19ea6a547eb1797fbbab19cd57cc2a83fe8
2022-05-30 12:46:59 -07:00
Gaspard Petit
59006287cd Simplify ColoredPrintf to rely on ShouldUseColor
Use ShouldUseColor to set use_color instead of having a separate check for the windows mobile cases; these cases are now moved directly to `DoIsATTY`
2022-05-30 14:19:50 -04:00
Gaspard Petit
410e5f9e04 Fix "unused variable" warning
Fix "unused variable" warning when GTEST_HAS_STREAM_REDIRECTION is set to false in gtest-port.cc
2022-05-30 11:04:54 -04:00
Aaron Jacobs
9d21db9e0a gmock-spec-builders: add support for non-moveable types.
Do this by ripping out the "untyped perform action" machinery, which isn't
necessary: we can simply template the entry point on the result type, and use
RAII to avoid the need to special case void. This makes it easier to understand
the code and harder to introduce type-related undefined behavior, to boot.
PiperOrigin-RevId: 451493451
Change-Id: I225305f83164752ca92f2916721972eafba33168
2022-05-27 15:25:37 -07:00
elixir
6cd3823783 Clarify that this-> is needed to access members of type-parameterized tests.
PiperOrigin-RevId: 451439108
Change-Id: I8929df21d53cbe6c42e38653e1bb0cac72fc36f9
2022-05-27 11:32:10 -07:00
Aaron Jacobs
28356773cb gmock-actions: properly support non-moveable results in is_callable_r.
Previously this excluded callables that return non-moveable types. This is the
same as the
[libc++ std::is_invocable_r bug](https://github.com/llvm/llvm-project/issues/55346)
fixed by
[this commit](https://github.com/llvm/llvm-project/commit/c3a24882903d): it's
wrong to use std::is_convertible for checking the return type, since (despite
its name) that doesn't check the standard-defined notion of "implicitly
convertible". Instead we must base the check on whether the source type can be
used as an argument to a function that accepts the destination type.

PiperOrigin-RevId: 451341205
Change-Id: I2530051312a0361ea7a2ce26993ae973c9242089
2022-05-27 02:23:49 -07:00
Aaron Jacobs
56246cdb94 gmock-spec-builders: move a method to the header.
In order to make the diff more readable in an upcoming commit that requires the
method to be templated on the action's result type.

PiperOrigin-RevId: 451157029
Change-Id: I57beb7544efccd0459efb3a1f039ea45cd7c7602
2022-05-26 07:25:17 -07:00
Abseil Team
cf942a5d69 Update GoogleTest documentation's spelling of "GoogleTest".
PiperOrigin-RevId: 451067898
Change-Id: I658ab92c4ea616736f0170ac4d1548bb15a944e2
2022-05-25 19:18:09 -07:00
Abseil Team
7041051488 Clarify the pitfalls of EXPECT_THAT and highlight it's best practices
PiperOrigin-RevId: 450721917
Change-Id: I34d63a65b7158975abd46a9a14cded75439e7e7f
2022-05-24 10:57:53 -07:00
Axel Kohlmeyer
6f3f9a9e61 set -utf-8 flag only for real MSVC compilers. E.g. not Intel's icx.exe 2022-05-18 15:51:33 -04:00