Derek Mauro
c9461a9b55
Update GCC/Clang Linux tests to use Bazel 5.0.0
...
PiperOrigin-RevId: 429400664
Change-Id: I6454cf52cb2fc616a96663823de997591b63dfae
2022-02-17 14:19:07 -08:00
Abseil Team
ea55f1f52c
Address conversion warning by explicitly casting to size_t
...
Closes #3762
PiperOrigin-RevId: 428593750
Change-Id: Ifac216568fbc7d999adb71996ec6a1bbe3b97412
2022-02-14 13:28:28 -08:00
Abseil Team
0e402173c9
Add a 3-arg overload for ResultOf() matcher that takes a description string for better error messages.
...
PiperOrigin-RevId: 427598749
Change-Id: I8c7a5d7b2dde017641534f1c7eed8dd56c33e845
2022-02-09 16:20:06 -08:00
Copybara-Service
06519cedc3
Merge pull request #3751 from noiseless:gtest-help-test-OpenBSD
...
PiperOrigin-RevId: 427207981
Change-Id: Ib93f8f61bf568d4651f9148fbc522288308c0d71
2022-02-08 09:11:25 -08:00
Copybara-Service
504eb98953
Merge pull request #3746 from IYP-Programer-Yeah:use-constant-time-lookup-for-exact-match
...
PiperOrigin-RevId: 427179775
Change-Id: I9928be2421d559acf0e0f03643ce0b856b63f737
2022-02-08 06:51:54 -08:00
Copybara-Service
43efa0a4ef
Merge pull request #3617 from Bagira80:fix_3616
...
PiperOrigin-RevId: 426976022
Change-Id: Ib9f49cf84775a50cbc806d331349e61a1060b498
2022-02-07 11:51:52 -08:00
Hossein Ghahramanzadeh
d6841c040d
Apply requested changes by using std::inserter with move.
2022-02-05 17:43:21 +01:00
Andrew Krasavin
631f4f9947
Fix gtest-help-test failure on OpenBSD
2022-02-05 03:44:54 +03:00
Copybara-Service
14aa11db02
Merge pull request #3724 from jjfvanderpol:main
...
PiperOrigin-RevId: 426450614
Change-Id: Iccbe56ddd81f4f3935b3d44aa5b835146758ff83
2022-02-04 11:28:32 -08:00
Abseil Team
25ad42aabe
GetCurrentOsStackTraceExceptTop (both the method of UnitTestImpl and the wrapper function in gtest.cc) rely on the fact that the inner call is not getting optimized.
...
This CL annotates them with the appropriate attributes.
PiperOrigin-RevId: 425663217
Change-Id: Ib9ec2a69a7dd98d37640b56d4d7798572da66669
2022-02-01 10:44:59 -08:00
Copybara-Service
4517697675
Merge pull request #3744 from danger89:patch-2
...
PiperOrigin-RevId: 425519462
Change-Id: I196b22675e471f66929c1cdd0f85a405ebac8484
2022-01-31 20:01:13 -08:00
Hossein Ghahramanzadeh
2eadda6e00
Do constant time matching for exact match filters.
2022-01-31 19:22:37 +01:00
Derek Mauro
28e1da21d8
Finish some missed pieces of the TestCase to TestSuite Migration
...
PiperOrigin-RevId: 424864779
Change-Id: Iac5cafa3568f5fe41c85c52d28f7d61845f76868
2022-01-28 07:27:11 -08:00
Dino Radakovic
0b7798b2fb
Change ReturnArg
to use perfect forwarding of arguments ( #3733 )
...
PiperOrigin-RevId: 424355706
Change-Id: I618e5574b4b2c56a343905c20d8cc6d2a70cbcd1
2022-01-26 08:40:27 -08:00
Melroy van den Berg
f2d71f0be2
Let me give a change to try it again - updating to latest version
2022-01-25 22:45:24 +01:00
Abseil Team
f45d5865ed
Make recreate_environments_when_repeating=false the default.
...
So that global test environments are by default set up and torn down once,
regardless of the value of the repeat flag.
The point of global environments is to be set up and torn down once, and shared
by all tests in the process. There is no obvious reason why multiple runs of the
same test should be treated distinctly from single runs of different tests.
Having this be false by default means that repeats using a global environment
run faster. It can still be set to true if it's desired that every repeat get a
fresh environment, but this seems less important given the nature of a global
environment. Every test I've seen using a global environment uses it to set up
some expensive external resource, not something that can/should be set up for
each test anew. (Again this is unsurprising, since the environment is a global.)
PiperOrigin-RevId: 424003937
Change-Id: I9e8a825cb8900960dd65b85fe5ffcc0a337e57f3
2022-01-24 23:46:52 -08:00
Copybara-Service
7eae8de0da
Merge pull request #3723 from ramkumar-kr:patch-1
...
PiperOrigin-RevId: 423920083
Change-Id: I5e172813387f841d5a6c56eea155b876a465d208
2022-01-24 15:04:20 -08:00
Copybara-Service
f64cf6b7b8
Merge pull request #3732 from joshiayush:i2174
...
PiperOrigin-RevId: 423906844
Change-Id: I1c34a3ce8a5c761ef9f1d7ce48bef8826742e97d
2022-01-24 14:08:19 -08:00
Copybara-Service
3d81736c97
Merge pull request #3615 from IYP-Programer-Yeah:fix-per-test-filter-processing
...
PiperOrigin-RevId: 423326942
Change-Id: I913f31960d7917b176c9f390424630708473837a
2022-01-21 08:18:49 -08:00
Abseil Team
2ddfdf819d
Factor out AssertionResult into dedicated gtest-assertion-result header + implementation files to prevent cyclic includes between gtest.h and gtest_pred_impl.h
...
PiperOrigin-RevId: 422863083
Change-Id: I299018a860152216adc206780c32923c03bedb2a
2022-01-19 11:31:36 -08:00
Abseil Team
100f6fbf5f
Consistently apply IWYU pragmas across googletest and googlemock headers
...
PiperOrigin-RevId: 422559250
Change-Id: I9f630f2186724950e5e9fbd7093d5264e8bf0a71
2022-01-18 08:11:11 -08:00
Copybara-Service
c9643a2e45
Merge pull request #3721 from joshiayush:i3719
...
PiperOrigin-RevId: 422405356
Change-Id: I8ea22485d9a25dce81a28d0c323a73b36d15e912
2022-01-17 12:59:48 -08:00
Dino Radakovic
4e9fe30884
Fix reference to source file in gmock FAQ
...
PiperOrigin-RevId: 421915817
Change-Id: I22800e8943f9eb050304c521701d4040b1b7a914
2022-01-14 14:40:35 -08:00
Derek Mauro
4e82924686
Update test Docker image to GCC 11.2, Clang 14 (prerelease),
...
CMake 3.22.1, and Bazel 4.2.2
PiperOrigin-RevId: 421814198
Change-Id: Ief4e39d7f077089f10afdc8d63cc1e51dc18e97f
2022-01-14 06:52:59 -08:00
Ayush Joshi
ca3ffd90f2
FIX #2174 -- remove DEBUG_POSTFIX
...
while this is not synced with the pkg-config file, it only breaks things
Fix #2174
Signed-off-by: Ayush Joshi <ayush854032@gmail.com>
2022-01-13 21:24:56 +05:30
Abseil Team
2d07f12b60
Fix run-on sentence
...
dispatch. It will use the definition from the class the constructor of which
PiperOrigin-RevId: 421291241
Change-Id: If81e3d6d3774edfbbb4baaec8a3cd96566b3b09c
2022-01-12 07:19:51 -08:00
Copybara-Service
aea0874c42
Merge pull request #3725 from bsilver8192:remove-another-disallow-assign
...
PiperOrigin-RevId: 421044680
Change-Id: If585089811f1b67eab6f339125c27174ee5bc290
2022-01-11 09:01:32 -08:00
Copybara-Service
1d9f7c5fb2
Merge pull request #3713 from PhilipMourdjis:cmake-qnx-link-regex
...
PiperOrigin-RevId: 420863433
Change-Id: Ie8c43caff6fb2493ecd47bed50de9db87221f46f
2022-01-10 14:56:50 -08:00
Hossein Ghahramanzadeh
29bc520e5b
Fix a typo in comments.
2022-01-06 15:46:52 +01:00
Hossein Ghahramanzadeh
4fc151ae69
Use normal for loop instead of accumulate.
2022-01-06 15:46:52 +01:00
Hossein Ghahramanzadeh
aea981dd54
Improve code readablity.
2022-01-06 15:46:52 +01:00
Hossein Ghahramanzadeh
4adbc9c9b2
Apply requested changes to preserve old behavior.
2022-01-06 15:46:52 +01:00
Hossein Ghahramanzadeh
d03d23a6e5
Reimplement MatchesFilter with new interfaces.
2022-01-06 15:46:52 +01:00
Hossein Ghahramanzadeh
3fc1ab6632
Apply requested changes.
2022-01-06 15:46:52 +01:00
Hossein Ghahramanzadeh
f20688737a
Get rid of redundant filter matching code
2022-01-06 15:46:52 +01:00
Hossein Ghahramanzadeh
f5b4efef5f
Add comments describing the behavior of filters
2022-01-06 15:46:52 +01:00
Hossein Ghahramanzadeh
2377c8d32b
Process filter string once instead of per test
2022-01-06 15:46:52 +01:00
Brian
58b71c9ea2
Remove another GTEST_DISALLOW_ASSIGN_ that crept in
...
They were all removed in #2815 , but it looks like this one got added
from a Google export which missed the update. See #2815 for reasons why
removing this is desirable.
2022-01-05 21:33:05 -08:00
Joris van der Pol
91461509de
Set CMake Policy CMP0077 to NEW
2022-01-05 11:07:50 +01:00
Ram Kumar K R
0256210376
Update example to reflect the tests below
2022-01-04 13:36:22 -08:00
Ayush Joshi
1b4cf35958
FIX #3719 -- Fix clang
conversion warnings
...
We should perform an explicit type conversion to `unsigned char` before passing the
`const char` data to `IsValidXmlCharacter()` and `IsNormalizableWhitespace()` functions
in order to avoid compile time conversion warnings
Signed-off-by: Ayush Joshi <ayush854032@gmail.com>
2022-01-01 19:28:21 +05:30
Abseil Team
6b74da4757
Include the param names in the generated description of the MATCHER_P matchers.
...
PiperOrigin-RevId: 418497526
Change-Id: Ie53c3c0810c10a32cbcb941e3ca1ee8fb1ddd9f9
2021-12-27 08:05:24 -08:00
Abseil Team
d81ae2f0bf
Clarify "package" means "Bazel package", and promote testonly=True
rather than testing
sub-directory.
...
PiperOrigin-RevId: 417945818
Change-Id: I8686ee0414fb80269528677f291877a231d1c991
2021-12-22 22:50:04 -08:00
Derek Mauro
c58f562fa2
Makes the Python imports consistently use full paths from the repository root,
...
unifying the behavior between Bazel and CMake
This fixes one of the CI failures on Windows
PiperOrigin-RevId: 417872531
Change-Id: I156989323b7e6d4a4420f4f9691b078829db933d
2021-12-22 13:01:24 -08:00
Derek Mauro
71d4e2f742
Makes TestForDeathTest.CRTDebugDeath only run when _DEBUG is defined
...
PiperOrigin-RevId: 417678422
Change-Id: I8e42a906459b8fd5a7789a7ed728d12448046c44
2021-12-21 13:16:17 -08:00
Philip Mourdjis
4745746725
link to regex on qnx in cmake
2021-12-21 16:14:03 +00:00
Copybara-Service
9a32aee22d
Merge pull request #3684 from ludgerpaehler:patch-1
...
PiperOrigin-RevId: 417474317
Change-Id: I4c84f59ba272a6bec3f992f7afae36e1c5617fad
2021-12-20 13:59:26 -08:00
Dino Radakovic
97a467571a
Release tests for UnitTestOptions::MatchesFilter
...
PiperOrigin-RevId: 416567004
Change-Id: Ic407e0fcdf8ffd1c012a1b12df2837bdac1dccb4
2021-12-15 08:36:08 -08:00
Copybara-Service
054a986a85
Merge pull request #3694 from joshiayush:main
...
PiperOrigin-RevId: 415014511
Change-Id: If2e20eb9408a23b5574a2c87f651c2905f14fcac
2021-12-08 08:53:55 -08:00
Abseil Team
4c5650f688
Add NOLINT to address modernize-use-trailing-return-type in TEST_F uses
...
Example command:
```
clang_tidy '--config={Checks: "modernize-use-trailing-return-type"}' googletest-death-test-test.cc
```
Example error:
```
warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TEST(NotADeathTest, Test) {
^
```
PiperOrigin-RevId: 414836261
Change-Id: I5f758423667559abfbf313190543666bc4ce0e6e
2021-12-07 15:09:13 -08:00
Ayush Joshi
3ea587050d
Allow to specify a random seed independently of whether shuffling is requested
...
This commit fixes issue #3681
Signed-off-by: Ayush Joshi <ayush854032@gmail.com>
2021-12-04 21:18:18 +05:30
Abseil Team
d61d4d8e64
Support std::reference_wapper as a smart pointer type in gmock
...
PiperOrigin-RevId: 413963503
Change-Id: I33440780bf087698f4e4325399227405885430b3
2021-12-03 10:14:13 -08:00
Abseil Team
1b2606425c
Fix typo in GoogleMock Cookbook.
...
PiperOrigin-RevId: 413674665
Change-Id: I466f87348390f42434a70f183efdf0557be9dddd
2021-12-02 07:44:32 -08:00
Abseil Team
bb9216085f
Work around Android KitKat tzset bug
...
On KitKat, calling tzset with UTC+nn doesn't initialize all the
timezone state. If the previous timezone was something like
America/Chicago, then changing it to UTC+nn might have no effect.
Setting the timezone to an intermediate value like "UTC" avoids the
problem.
Works around https://github.com/android/ndk/issues/1604 .
PiperOrigin-RevId: 413050236
Change-Id: I99b2d3330ae68f1d58cd2ca278d3eaae30bd1e83
2021-11-29 20:53:29 -08:00
Ludger Paehler
b4d4e6e348
Fix typo in the queue test.
2021-11-25 16:53:19 +01:00
Copybara-Service
e2f3978937
Merge pull request #3620 from hzeller:add-simple-ci
...
PiperOrigin-RevId: 411929458
Change-Id: Id102172091fb708c0c8252da6d3570771fc15dba
2021-11-23 17:23:00 -08:00
Copybara-Service
3e0e32ba30
Merge pull request #3664 from kuzkry:typo-fixes
...
PiperOrigin-RevId: 410816561
Change-Id: I466575011dd468dd93b5ecb683955713d261e96b
2021-11-18 08:55:29 -08:00
Copybara-Service
183a20b40e
Merge pull request #3669 from assafpr:main
...
PiperOrigin-RevId: 410816213
Change-Id: Ic33a2f432b2a125ce36355fa802b51a33a1eea23
2021-11-18 08:54:40 -08:00
Copybara-Service
a0dc888bf1
Merge pull request #3672 from densamoilov:densamoilov/main/suppress-warning
...
PiperOrigin-RevId: 410816204
Change-Id: Ib4c4851ae4e8a612d60184f53cd565c75671c4c6
2021-11-18 08:53:52 -08:00
Denis Samoilov
035a101b62
Suppress unused-value warning
...
When _DEBUG is not defined the _CrtSetDbgFlag turns into ((int)0),
which causes unused-value warning for clang.
2021-11-16 19:07:19 -08:00
assafpr
ca2952c5ef
fixed branch from master to main in readme.md
2021-11-16 13:33:26 +02:00
assafpr
6e271e4aea
Update README.md
2021-11-16 13:32:51 +02:00
Krystian Kuzniarek
dfc3675361
fix a typo
2021-11-16 09:18:03 +01:00
Taylor Cramer
1a3e2a265f
Clarify "Times() after X" error message
...
The previous error message could be misinterpreted to mean that `Times` could not be
used in combination with `WillRepeatedly`, when in fact the call to `Times` just needs to happen *first*.
PiperOrigin-RevId: 410070405
Change-Id: I747d34a4334cf2e56d589dcad3a08a8f322d77c8
2021-11-15 13:48:12 -08:00
Derek Mauro
4848324c5f
Update URLs in Bazel Quickstart
...
PiperOrigin-RevId: 410041507
Change-Id: I6ca514249a54e7fbe6d8fbf4f07317a39af40929
2021-11-15 11:51:27 -08:00
Abseil Team
1b18723e87
Fix typo in gmock-matchers_test.cc: CanDescribeNegationOfExpectingOneElment => CanDescribeNegationOfExpectingOneElement
...
PiperOrigin-RevId: 409484263
Change-Id: I7448d6f04a9868602e0bc8dec40ea3eb63d3e387
2021-11-12 13:09:59 -08:00
dinord
25208a60a2
Merge pull request #3650 from tambry:std_iterator
...
PiperOrigin-RevId: 409417242
2021-11-12 13:00:07 -05:00
Abseil Team
9ca071b6e5
Googletest export
...
Revert CL that updated example for SetUpTestSuite/TearDownTestSuite to initialize static member variables inline.
It seems that non-const static data members for some reason still must be initialized out-of-line.
PiperOrigin-RevId: 408913846
2021-11-10 17:21:19 -05:00
dinord
7f2288476b
Merge pull request #3657 from BioDataAnalysis:bda_add_winerr
...
PiperOrigin-RevId: 408896910
2021-11-10 17:21:09 -05:00
dmauro
6c8a386513
Googletest export
...
Explicitly used unsigned chars for testing for valid XML characters
PiperOrigin-RevId: 408692969
2021-11-10 17:21:00 -05:00
Mario Emmenlauer
e4ffd4d715
googletest/src/gtest-port.cc: Added GetLastError() on Windows for CreateThread()
2021-11-10 13:36:38 +01:00
Abseil Team
79efd968bf
Googletest export
...
Update example for SetUpTestSuite/TearDownTestSuite to use modern C++ standards.
Currently it is using an outdated C++ construct (defining static member variables separately from the declaration).
PiperOrigin-RevId: 408663014
2021-11-09 16:31:33 -05:00
Abseil Team
aa486f165e
Googletest export
...
Add missing InitGoogleTest line in "Registering tests" example code
Copying the original code gives the following error message
"""
IMPORTANT NOTICE - DO NOT IGNORE:
This test program did NOT call testing::InitGoogleTest() before calling RUN_ALL_TESTS(). This is INVALID. Soon Google Test will start to enforce the valid usage. Please fix it ASAP, or IT WILL START TO FAIL.
"""
PiperOrigin-RevId: 408385714
2021-11-09 10:24:14 -05:00
Abseil Team
c3792825bf
Googletest export
...
Add printer for std::type_info.
PiperOrigin-RevId: 408375407
2021-11-09 10:24:05 -05:00
Abseil Team
d4e084a1cc
Googletest export
...
Style only change. Make use of advanced testing functions `FloatLE` and `DoubleLE` consistent.
PiperOrigin-RevId: 407660542
2021-11-09 10:23:55 -05:00
Raul Tambre
5d1e4af673
Replace use of deprecated std::iterator
...
This was deprecated by P0174 in C++17.
2021-11-05 13:01:19 +02:00
Abseil Team
bf0701daa9
Googletest export
...
Address unused variable warning in gtest.h
Closes #3645
PiperOrigin-RevId: 407393922
2021-11-03 15:12:53 -04:00
CJ Johnson
51536300a1
Merge pull request #3638 from limitedAtonement:3637-disabled-output
...
PiperOrigin-RevId: 407356792
2021-11-03 13:46:13 -04:00
dmauro
cbf46d3f27
Googletest export
...
Guard #includes for threading related headers with GTEST_IS_THREADSAFE
Some platforms that don't support threading give errors for including
these headers
PiperOrigin-RevId: 406133623
2021-11-03 13:46:02 -04:00
dmauro
5a93ce1247
Googletest export
...
Remove the subprocess fallback code for older versions of Python
PiperOrigin-RevId: 405967578
2021-11-03 13:45:56 -04:00
Abseil Team
7cf37a18d1
Googletest export
...
Add docs section on test sharding
Fixes #3622
PiperOrigin-RevId: 405712812
2021-11-03 13:45:51 -04:00
Abseil Team
b3062166a1
Googletest export
...
Internal change
PiperOrigin-RevId: 405710296
2021-11-03 13:45:46 -04:00
dmauro
489ef888d9
Googletest export
...
Remove GoogleTest's SleepMilliseconds function.
It is only used in tests and a portable implementation is available.
PiperOrigin-RevId: 405437102
2021-11-03 13:45:40 -04:00
dmauro
f503588aee
Googletest export
...
Replace the multiple implementations of Notification with a single
portable implementation.
The also removes the awkward loop with sleep in Notification and will
allow the removal of SleepMilliseconds.
PiperOrigin-RevId: 405399733
2021-11-03 13:45:35 -04:00
lmat
3c958ac47c
Re #3637 Show Disabled Tests in testing output
...
Showing disabled tests is implemented by a new member function on the
TestEventListener interface (which is responsible for printing
testing output). The new function is called OnTestSkipped and it is
invoked when a disabled test is encountered.
The PrettyUnitTestResultPrinter has the canonical implementation of this
new function. The BriefUnitTestResultPrinter and the
EmptyTestEventListener get a nullary implementation. The
JsonUnitTestResultPrinter and XmlUnitTestResultPrinter
inherit that trivial implementation from the EmptyTestEventListener.
2021-11-01 16:17:25 -04:00
Henner Zeller
24898650b1
Start a simple github actions CI
...
Running on major platforms.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
2021-10-20 15:26:11 -07:00
Deniz Bahadir
64f19a9fc3
CMake: Fix values of INTERFACE_INCLUDE_DIRECTORIES property
...
Replace semicolon by `$<SEMICOLON>` in generator-expressions of target
property `INTERFACE_INCLUDE_DIRECTORIES` of CMake targets `gtest`,
`gtest_main`, `gmock` and `gmock_main`.
Fixes : #3616
Signed-off-by: Deniz Bahadir <deniz@code.bahadir.email>
2021-10-19 15:14:44 +02:00
Abseil Team
16f637fbf4
Googletest export
...
Add printer for __{u,}int128_t.
PiperOrigin-RevId: 402417369
2021-10-13 12:28:20 -04:00
Abseil Team
178cfacb24
Googletest export
...
add missing using ::testing::DoAll when DoAll used in example
PiperOrigin-RevId: 402416497
2021-10-13 12:28:13 -04:00
Andy Soffer
dc7a0779d1
Merge pull request #3602 from yesudeep:try-fix-linker-errors-on-freebsd
...
PiperOrigin-RevId: 402414489
2021-10-13 12:28:06 -04:00
Abseil Team
b2dda9ed83
Googletest export
...
Use newer Docker images in CI
The new floor image contains GCC 5.5.0, like the old one.
PiperOrigin-RevId: 402402465
2021-10-13 12:28:00 -04:00
Yesudeep Mangalapilly
9e3fb4ea94
Fix linker errors on FreeBSD.
2021-10-08 08:55:39 -07:00
dinord
075810f7a2
Merge pull request #3581 from cclauss:codespell
...
PiperOrigin-RevId: 400792845
2021-10-05 10:59:42 -04:00
Abseil Team
3b49be074d
Googletest export
...
googletest: Add printer for {std,absl}::nullopt.
PiperOrigin-RevId: 399928554
2021-09-30 19:07:32 -04:00
Abseil Team
ab36804e42
Googletest export
...
Ensure `.what()` is printed in `ThrowsMessage(...)` to address https://github.com/google/googletest/issues/3582
Closes #3582
PiperOrigin-RevId: 399462851
2021-09-28 16:33:40 -04:00
Christian Clauss
ee1be03b43
Fix remaining typos discovered by codespell
2021-09-24 08:09:32 +02:00
dinord
e4717df71a
Merge pull request #3195 from Inujel:fix-3194
...
PiperOrigin-RevId: 398271948
2021-09-23 23:31:42 +00:00
dinord
09074c1571
Merge pull request #3573 from cclauss:patch-1
...
PiperOrigin-RevId: 397998384
2021-09-23 23:31:33 +00:00
dinord
319a9d19bc
Merge pull request #3574 from Vertexwahn:switch_to_native_cc_rules
...
PiperOrigin-RevId: 397995447
2021-09-23 23:31:25 +00:00
Abseil Team
0570d97fb6
Googletest export
...
Do not attempt to continue running a test suite if it already failed during
`SetUpTestSuite`.
The suite already failed and running the tests might just add noise to the run, or even crash the process unnecessarily.
Fixes #2187
PiperOrigin-RevId: 397770405
2021-09-23 23:31:14 +00:00