Commit Graph

3787 Commits

Author SHA1 Message Date
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
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
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
Abseil Team
de34ef4e4c Internal change
PiperOrigin-RevId: 397651677
2021-09-23 23:31:03 +00:00
Vertexwahn
277e0a0168 Remove bazelbuild/rules_cc dependency 2021-09-17 10:04:26 +02:00
Christian Clauss
5b43f14be9
Fix typos discovered by codespell 2021-09-16 21:44:29 +02:00
Christian Clauss
861a75ed5d
Fix typos discovered by codespell 2021-09-16 21:00:42 +02:00
Christian Clauss
a070f33c19
Fix typo discovered by codespell
https://pypi.org/project/codespell/
2021-09-16 20:40:35 +02:00
Derek Mauro
40dfd4b775 Merge pull request #3519 from AkashKumarSingh11032001:master
PiperOrigin-RevId: 397082478
2021-09-16 13:00:21 -04:00
Abseil Team
6bfab0becc Googletest export
Add a caveat section for potential memory leak with derived classes using `SetUpTestSuite`.

PiperOrigin-RevId: 396986728
2021-09-16 13:00:01 -04:00
dmauro
8aa657ee39 Googletest export
Delete unsupported/deprecated scripts

PiperOrigin-RevId: 396847020
2021-09-15 13:34:06 -04:00
Abseil Team
314adcd40e Googletest export
gmock-internal-utils.cc: Use `static_cast` instead of implicit conversion between signed and unsigned types
Fixes #3550

PiperOrigin-RevId: 396826071
2021-09-15 13:34:00 -04:00
dmauro
4ea61b9669 Googletest export
Rollback delete of unsupported/deprecated scripts

PiperOrigin-RevId: 396699187
2021-09-15 13:33:54 -04:00
dmauro
7ee2683007 Googletest export
Delete unsupported/deprecated scripts

PiperOrigin-RevId: 396685976
2021-09-15 13:33:48 -04:00
Abseil Team
6202251f09 Googletest export
Introduce GMOCK_FLAG_GET and GMOCK_FLAG_SET macros.

PiperOrigin-RevId: 396649214
2021-09-15 13:33:42 -04:00
Derek Mauro
061973710e
Revert grammatically incorrect change 2021-09-15 12:54:09 -04:00
Abseil Team
159c9ad23e Googletest export
Avoid segfault on null premature_exit_filepath.

PiperOrigin-RevId: 395965853
2021-09-14 10:15:17 -04:00
CJ Johnson
955c7f837e Merge pull request #3531 from theidexisted:patch-1
PiperOrigin-RevId: 392720416
2021-08-26 14:30:09 -04:00
CJ Johnson
ff21b36e1e Merge pull request #3513 from victordk13:patch-1
PiperOrigin-RevId: 392665206
2021-08-24 12:29:05 -04:00
Abseil Team
6204633979 Googletest export
Bump `cmake_minimum_required` to 3.5.

Delete conditional branches exclusive to older versions.

Notable dependents:
  - github.com/grpc/grpc >= 3.5.1
  - github.com/abseil/abseil-cpp >= 3.5
  - github.com/googleapis/google-cloud-cpp >= 3.5

On the other hand, github.com/protocolbuffers/protobuf is >= 3.1.3, but it only depends on GoogleTest 1.10.

Fixes #3523

PiperOrigin-RevId: 392073834
2021-08-24 12:28:58 -04:00
Abseil Team
2f80c2ba71 Googletest export
Standardize access to GoogleTest flags on GTEST_FLAG_GET/GTEST_FLAG_SET

Custom implementations can decide how access to flags is performed depending on the implementation of flags being used.

PiperOrigin-RevId: 391971115
2021-08-20 15:08:40 -04:00
theidexisted
088e6ed9a8
Simplify example code with c++11 2021-08-19 16:35:14 +08:00
Derek Mauro
0134d73a49 Merge pull request #3504 from duianto:patch-1
PiperOrigin-RevId: 390486428
2021-08-13 12:42:35 -04:00