| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 454616721
Change-Id: I33b5671646ec027da48cc941baf84b4ddc722e07
|
| |
| |
| |
| | |
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`
|
|/
|
|
|
|
|
| |
Fixes #3856
PiperOrigin-RevId: 453992227
Change-Id: I5f3330a454bdcd6b0522ebba4cdfe2c888f8e638
|
|
|
|
|
|
|
| |
EXPECT_FATAL_FAILURE.
PiperOrigin-RevId: 448237839
Change-Id: Id6242f278912f8c47cf19e3ea8c061f8b18ba832
|
|
|
|
|
|
|
|
|
| |
This CL adds a couple missing overrides in the googletest sources.
These were found downstream when -Wsuggest-override and
-Wsuggest-destructor-override were enabled.
PiperOrigin-RevId: 447754883
Change-Id: I7bf35a8757cbc5ae157827037aa3d13f47392406
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bazel build --define=absl=1 ...
A dependency on RE2 is now required when building GoogleTest with Abseil.
Using RE2 will provide a consistent cross-platform regex experience.
Users will need to add the com_googlesource_code_re2, bazel_skylib,
and platforms repository to their WORKSPACE files. See our WORKSPACE
file in the root directory of this project for an example of how to
add the dependencies.
Please note that the com_googlesource_code_re2 dependency must use a
commit from the `abseil` branch of the project:
https://github.com/google/re2/tree/abseil
PiperOrigin-RevId: 444650118
Change-Id: I45c55b26684c0c50d721a05b81c5f8a0c092400f
|
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 444444700
Change-Id: I8ac5cc96cc6eb9d583fa7e3fb304ef3dcaa95b5b
|
| |
| |
| |
| |
| |
| | |
This fixes -Wuninitialized warnings with GCC.
Fixes #3514.
|
| |
| |
| |
| |
| | |
PiperOrigin-RevId: 443715444
Change-Id: I3ffd54b63d2728ae4a668ee7875c8c3c8188087c
|
|/
|
|
|
| |
PiperOrigin-RevId: 443462203
Change-Id: I0c43f981663a7531ff5da4d4be01fb3d6762273d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When built with `--define=absl=1` under Bazel, GoogleTest
flags use ABSL_FLAG instead of GoogleTest's own implementation.
There are some minor behavior differences in this mode.
The most notable difference is that unrecognized flags result
in a flag parsing error, and are not returned to the user though
a modified argc/argv, unless they appear after the positional
argument delimiter ("--").
For example, to pass a non-Abseil flag, you would have to do
./mytest --gtest_color=false -- --myflag=myvalue
The documentation at https://abseil.io/docs/cpp/guides/flags
may be helpful in understanding the behavior.
There are some other minor differences. For example,
passing --help results in the program returning 1 instead of 0.
https://github.com/google/googletest/issues/3646
PiperOrigin-RevId: 439312700
Change-Id: Id696a25f50f24a5b1785c45ca8fa59794f86fd5c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
PiperOrigin-RevId: 434464892
Change-Id: Iaa2277f26d0049b3d792e87f64679774a28205c6
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
implementation files to prevent cyclic includes between gtest.h and gtest_pred_impl.h
PiperOrigin-RevId: 422863083
Change-Id: I299018a860152216adc206780c32923c03bedb2a
|
|
|
|
|
| |
PiperOrigin-RevId: 422559250
Change-Id: I9f630f2186724950e5e9fbd7093d5264e8bf0a71
|
|
|
|
|
| |
PiperOrigin-RevId: 421044680
Change-Id: If585089811f1b67eab6f339125c27174ee5bc290
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Add printer for std::type_info.
PiperOrigin-RevId: 408375407
|
|
|
|
|
|
|
|
| |
Address unused variable warning in gtest.h
Closes #3645
PiperOrigin-RevId: 407393922
|
|\
| |
| |
| | |
PiperOrigin-RevId: 407356792
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| | |
Remove GoogleTest's SleepMilliseconds function.
It is only used in tests and a portable implementation is available.
PiperOrigin-RevId: 405437102
|
|/
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Add printer for __{u,}int128_t.
PiperOrigin-RevId: 402417369
|
|\
| |
| |
| | |
PiperOrigin-RevId: 400792845
|
| | |
|
|/
|
|
|
| |
googletest: Add printer for {std,absl}::nullopt.
PiperOrigin-RevId: 399928554
|
|
|
|
| |
PiperOrigin-RevId: 387381497
|
|
|
|
|
|
| |
Delete GOOGLETEST_CM.* tags from C++ code.
PiperOrigin-RevId: 386268534
|
|
|
|
|
|
| |
Fix include guards in gen_pred_test.py
PiperOrigin-RevId: 386052814
|
|\
| |
| |
| | |
PiperOrigin-RevId: 385627491
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The documentation is clear that the FOO we'll be guarding always matches
the spelling of the DONT macro. A single guard macro should not toggle
more than one implementation macro.
This fixes a regression in 7413280c52c1f759395572a384165023d24eeb57.
Relatedly, improve the documentation of the DONT macros to bring the
list of valid FOO values up to date.
|
| |
| |
| |
| |
| |
| | |
Introduce GTEST_FLAG_GET and GTEST_FLAG_SET macros.
PiperOrigin-RevId: 382808313
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gtest: Add a flag to only set up/tear down test environments once when repeating
Currently when running a test multiple times using `--gtest_repeat` the global
test environment(s) are set up and torn down for each iteration of the test.
When checking for flakes in tests that have expensive dependencies that are set
up in the test environment (subprocesses, external dependencies, etc) this can
become expensive.
To support finding flakes in tests that fit into this category, where the setup
phase is expensive but each test case is fast, allow callers to specify via
`--gtest_recreate_environments_when_repeating=false` that the test environments
should only be set up once, for the first iteration, and only torn down once, on
the last iteration. This makes running a test with `--gtest_repeat=1000` a much
faster and more pleasant experience.
PiperOrigin-RevId: 382748942
|
|
|
|
|
|
|
|
|
|
| |
EXPECT_DEATH() and ASSERT_DEATH() have a switch case where every
possible case is covered. This makes the default case unnecessary
and triggers -Wcovered-switch-default.
Due to these being macros, the lines are expanded in user code and
are thus subject to warnings of the target codebase.
Fixes #3456
|
|\
| |
| |
| | |
PiperOrigin-RevId: 379383941
|
| | |
|
|\ \
| | |
| | |
| | | |
PiperOrigin-RevId: 378915968
|
| | |
| | |
| | |
| | |
| | | |
Reference is here: https://en.cppreference.com/w/cpp/feature_test
This PR fixes the weird case of compiling with `clang++ -std=c++17 -fchar8_t`
|
|\ \ \
| | | |
| | | |
| | | | |
PiperOrigin-RevId: 377367006
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This was causing the following linker error on Microsoft Visual C++ when compiling as a DLL:
```
googletest-param-test-test.cc.obj : error LNK2019: unresolved external symbol "public: __cdecl testing::internal::MarkAsIgnored::MarkAsIgnored(char const *)" (??0MarkAsIgnored@internal@testing@@QEAA@PEBD@Z) referenced in function "void __cdecl works_here::`dynamic initializer for 'gtest_allow_ignore_NotInstantiatedTest''(void)" (??__Egtest_allow_ignore_NotInstantiatedTest@works_here@@YAXXZ)
```
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
exports
This was causing the following linker error on Microsoft Visual C++ when compiling as a DLL:
```
googletest-printers-test.cc.obj : error LNK2019: unresolved external symbol "void __cdecl testing::internal::PrintTo(char16_t const *,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?PrintTo@internal@testing@@YAXPEB_SPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "public: static void __cdecl testing::internal::UniversalPrinter<char16_t const *>::Print(char16_t const * const &,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?Print@?$UniversalPrinter@PEB_S@internal@testing@@SAXAEBQEB_SPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
googletest-printers-test.cc.obj : error LNK2019: unresolved external symbol "void __cdecl testing::internal::PrintTo(char32_t const *,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?PrintTo@internal@testing@@YAXPEB_UPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "public: static void __cdecl testing::internal::UniversalPrinter<char32_t const *>::Print(char32_t const * const &,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?Print@?$UniversalPrinter@PEB_U@internal@testing@@SAXAEBQEB_UPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
```
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fix MSVC warning C4275: non dll-interface class
'testing::MatcherDescriberInterface' used as base for dll-interface
class 'testing::internal::MatcherBase<std::string>'
Fixes #3415
PiperOrigin-RevId: 377352684
|
|\ \ \ \
| |/ / /
|/| | |
| | | | |
PiperOrigin-RevId: 377289133
|
| | | |
| | | |
| | | |
| | | |
| | | | |
I spotted this in https://github.com/assimp/assimp/pull/3880/commits/7dd7a053a91322fad88cdf958c6d0b3b7b91cb90 and figured I'd fix it here, too.
If this is not the right thing to do, please lmk so I can undo it in assimp, too. Seems right, though. It's the only spot in gtest where a ctype call was made directly.
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
Add a note documenting that death test macros accept arbitrary gmock matchers against child-process stderr, not just regexes.
PiperOrigin-RevId: 372365998
|