Commit Graph

1476 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
Vertexwahn
277e0a0168 Remove bazelbuild/rules_cc dependency 2021-09-17 10:04:26 +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
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
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
dmauro
47f819c3ca Googletest export
Remove deprecated/unsupported scripts

PiperOrigin-RevId: 389873391
2021-08-10 12:30:54 -04:00
dmauro
eb7e38dfb4 Googletest export
Fix a Python 2 to 3 issue

PiperOrigin-RevId: 389720056
2021-08-10 12:30:49 -04:00
victordk13
26f9d55719
Format test properties in xml printer 2021-08-06 16:19:01 +03:00
Abseil Team
2d924d7a97 Internal change
PiperOrigin-RevId: 387381497
2021-07-29 03:27:05 +00:00
slowy07
2f3e2e39cc fix: typo codespelling comment 2021-07-24 17:38:47 +07:00
Abseil Team
96f4ce02a3 Googletest export
Delete GOOGLETEST_CM.* tags from C++ code.

PiperOrigin-RevId: 386268534
2021-07-22 14:54:03 -04:00
Abseil Team
ce4895aae8 Googletest export
Fix include guards in gen_pred_test.py

PiperOrigin-RevId: 386052814
2021-07-22 14:53:50 -04:00
CJ Johnson
8d6a4f8afe Merge pull request #3472 from jwnimmer-tri:fix-dont-macros
PiperOrigin-RevId: 385627491
2021-07-22 14:53:42 -04:00
Derek Mauro
a42111b49b
Fix location of GOOGLETEST_CM0011 marker 2021-07-14 16:02:00 -04:00
Abseil Team
977cffc442 Googletest export
Introduce GTEST_FLAG_GET and GTEST_FLAG_SET macros.

PiperOrigin-RevId: 382808313
2021-07-07 14:34:19 -04:00
Abseil Team
4cfd14984f Googletest export
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
2021-07-07 14:34:08 -04:00
Jeremy Nimmer
155de14cd8 Use GTEST_DONT_DEFINE_TEST_F to guard TEST_F
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 7413280c52.

Relatedly, improve the documentation of the DONT macros to bring the
list of valid FOO values up to date.
2021-07-01 11:48:36 -07:00
Andy Soffer
5f97ce4c70 Merge pull request #3465 from mbinna:bazel_qnx
PiperOrigin-RevId: 382189077
2021-06-30 13:33:48 -04:00
Andy Soffer
b89480e02c Merge pull request #3457 from alexkaratarakis:wcovered_switch_default
PiperOrigin-RevId: 382188112
2021-06-30 13:33:38 -04:00
Abseil Team
22e6055c75 Googletest export
Make multiple attempts to verify GetThreadCount()

Testing GetThreadCount() is inheritently noisy, as other threads can be started
or destroyed between two calls to GetThreadCount(). This is especially true
under certain analyzer configurations, such as TSAN.

PiperOrigin-RevId: 381951799
2021-06-30 13:33:29 -04:00
Manuel Binna
4281d2149c Don't link pthread on QNX
On QNX, pthread is part of libc [1]. There's no separate pthread library
to link.

[1] https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/p/pthread_create.html
2021-06-26 13:26:20 +02:00
Alex Karatarakis
1008850435 Fix EXPECT_DEATH() and ASSERT_DEATH() triggering -Wcovered-switch-default
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
2021-06-23 14:57:22 -07:00
dinord
355d57d90d Merge pull request #3443 from hyukmyeong:typo
PiperOrigin-RevId: 380705469
2021-06-22 13:30:42 +00:00
dmauro
f7902802f1 Googletest export
Remove -Werror from the CMake compiler flags

We should not force warnings as errors on users.
Sometimes compilers introduce new warnings which
will break builds.

Instead, we manually turn this flag on in our continuous integration
scripts so we can catch these errors, but not force them on our users.

Fixes #3447

PiperOrigin-RevId: 380241852
2021-06-22 13:30:21 +00:00
CJ Johnson
22a2e019c4 Merge pull request #3200 from ellert:port-to-GNU/Hurd
PiperOrigin-RevId: 379383941
2021-06-17 12:52:18 -04:00
CJ Johnson
996328bb8e Merge pull request #3183 from georgthegreat:patch-1
PiperOrigin-RevId: 378915968
2021-06-17 12:52:09 -04:00
Hyuk Myeong
1745a405eb fix typos 2021-06-13 19:53:04 +09:00
Abseil Team
c5be3930f5 Googletest export
cleanup: fix spurious MSAN warnings with Clang 12
PiperOrigin-RevId: 378430614
2021-06-11 10:41:50 -07:00
Derek Mauro
91e1bd6bfb Merge pull request #3421 from florin-crisan:bugfix/3420-dll-link-failure
PiperOrigin-RevId: 377367006
2021-06-08 18:36:29 -04:00
dmauro
9d698f6905 Googletest export
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
2021-06-08 18:36:20 -04:00
Derek Mauro
4feb6c77de Merge pull request #3393 from JC3:patch-1
PiperOrigin-RevId: 377289133
2021-06-08 18:36:11 -04:00
Florin Crișan
26a1569c72 #3420 Declare MarkAsIgnored as a DLL export
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)
```
2021-06-03 09:12:53 +03:00
Florin Crișan
e1cc005f4c #3420 Properly declare all overloads of testing::internal::PrintTo as DLL 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)
```
2021-06-03 09:12:53 +03:00
Abseil Team
c0777e6565 Googletest export
Remove the dependency on Objective C++ in iOS builds.

252ce9c52d introduced the use of
NSTemporaryDirectory() on iOS, which requires Core Foundation, and
Objective C++.

This CL replaces NSTemporaryDirectory() with an equivalent solution
(according to Apple's documentation at [1]) available to C/C++ code.
Avoiding Objective C++ and Core Foundation makes it easier to integrate
googletest in projects that can't use the supplied Bazel build files.

[1] https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html#//apple_ref/doc/uid/TP40002585-SW10

PiperOrigin-RevId: 375474990
2021-05-25 13:34:32 -04:00
durandal
df157130cb Googletest export
Add a note documenting that death test macros accept arbitrary gmock matchers against child-process stderr, not just regexes.

PiperOrigin-RevId: 372365998
2021-05-13 15:08:25 -04:00
Abseil Team
f381758e29 Googletest export
This callsite was previously updated to use ZX_INFO_PROCESS_V2 as a part of a soft transition. It is now time to revert back to `ZX_INFO_PROCESS` (which is now an alias of the former). See fxbug.dev/30751 for more details.

PiperOrigin-RevId: 372339833
2021-05-13 15:08:17 -04:00
Jason C
200c7ea1fb
isalnum -> IsAlNum for correct handling of signed chars
I spotted this in 7dd7a053a9 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.
2021-05-04 18:04:13 -04:00
Abseil Team
f5e592d8ee Googletest export
Revert ac3c2a8d04 -- it seems to break some gcc users (#3384)

PiperOrigin-RevId: 370834917
2021-04-29 10:40:44 -04:00
Abseil Team
252ce9c52d Googletest export
Fix iOS logging issues in tests

PiperOrigin-RevId: 370484087
2021-04-26 14:07:25 -04:00
Andy Soffer
23ef29555e Merge pull request #3314 from Vollstrecker:master
PiperOrigin-RevId: 369550590
2021-04-21 10:24:41 -04:00
Abseil Team
f16d43cd38 Googletest export
This callsite was previously updated to use ZX_INFO_PROCESS_V2 as a part of a soft transition. It is now time to revert back to `ZX_INFO_PROCESS` (which is now an alias of the former). See fxbug.dev/30751 for more details.

PiperOrigin-RevId: 369370855
2021-04-21 10:24:32 -04:00
Abseil Team
0d9daa9936 Googletest export
This callsite was previously updated to use ZX_INFO_PROCESS_V2 as a part of a soft transition. It is now time to revert back to `ZX_INFO_PROCESS` (which is now an alias of the former). See fxbug.dev/30751 for more details.

PiperOrigin-RevId: 369349579
2021-04-21 10:24:25 -04:00
Andy Soffer
566fdcc928 Merge pull request #3364 from jbampton:fix-spelling
PiperOrigin-RevId: 369217358
2021-04-21 10:24:17 -04:00
Vollstrecker
8043818e1b
Use URL instead of git-repo 2021-04-20 10:09:33 +02:00
dmauro
eaf9a3fd77 Googletest export
Use the time_point from steady_clock instead of the template
This fixes the build on some embedded compilers

PiperOrigin-RevId: 368879480
2021-04-16 17:33:13 -07:00
Abseil Team
831bc03504 Googletest export
Fix -Wconversion issues on Fuchsia

PiperOrigin-RevId: 368520510
2021-04-15 20:41:37 -07:00
John Bampton
050b517518 chore: fix spelling 2021-04-15 11:53:53 +10:00
Vollstrecker
c79eb87c11
Mention to explicitely set the option to it's default. 2021-04-14 23:13:01 +02:00
Vollstrecker
38c316fc5c
Changes like Requested. 2021-04-14 14:58:03 +02:00
Abseil Team
4400d68de4 Googletest export
Add support to run gtest on Xtensa platform.

This add support to run GTest base test suits on Xtensa
(https://ip.cadence.com/ipportfolio/tensilica-ip) base simulator.
Xtensa only provides libc and some basic operations and does not run an
operating system by default.

PiperOrigin-RevId: 368162205
2021-04-13 17:58:07 -07:00
Dino Radaković
ec7fa96f29 Merge pull request #3158 from GauthamBanasandra:patch-1
PiperOrigin-RevId: 367681693
2021-04-12 20:14:10 -07:00
Abseil Team
d0303e40c5 Googletest export
Migrate away from deprecated --heap_check=strict

PiperOrigin-RevId: 367226846
2021-04-07 23:39:25 -07:00
Abseil Team
601a68150d Googletest export
This is part of a soft transition over to having ZX_INFO_PROCESS
populate a new struct. See fxbug.dev/30751 for more details.

PiperOrigin-RevId: 367083068
2021-04-07 23:39:18 -07:00
Abseil Team
4048829db1 Googletest export
Add macros to omit {EXPECT,ASSERT}_{TRUE,FALSE}

PiperOrigin-RevId: 366455905
2021-04-05 16:13:34 -07:00
Dino Radaković
6c5c4554ac Merge pull request #3155 from ZedThree:cmake-alias-libraries
PiperOrigin-RevId: 365572439
2021-03-29 21:29:19 -07:00
Abseil Team
df7fee587d Googletest export
Delete extra whitespace in gtest_xml_test_utils.py

PiperOrigin-RevId: 365140844
2021-03-25 16:04:59 -07:00
Abseil Team
1a8ecf1813 Googletest export
Print std::u8string, std::u16string, and std::u32string as string literals

Previously, these types were printed as "{ U+123, U+456, U+789 }". However,
printed output in that form is difficult to compare against any literals that
might be defined in code. Instead, just treat these types like std::string
and std::wstring, escaping non-ASCII characters with a hexadecimal escape
sequence.

The tests have also been updated to cover the new functionality: as a bonus,
the tests now also pass with the MSVC toolchain.

Internally, the code has been reorganized to primarily operate in terms of
char32_t, under the assumption that char32_t will always be at least as big
as wchar_t. While that assumption is currently true, perhaps it won't be in
the future...

PiperOrigin-RevId: 364033132
2021-03-22 15:18:50 -04:00
Andy Soffer
b7d472f122 Merge pull request #3291 from Be-ing:remove_zi_msvc
PiperOrigin-RevId: 363063211
2021-03-16 09:51:31 -04:00
Abseil Team
ac1d60c2b5 Googletest export
gtest: Output a canned test suite for environment failures in XML/JSON

This surfaces useful information about the environment failure in a structured form.

As we can see from the updated test, previously unsurfaced information is now present.

PiperOrigin-RevId: 362292322
2021-03-16 09:51:18 -04:00