Skip to content

Commit c9eef0c

Browse files
deps: update googletest to e47544a
PR-URL: #49982 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent f3ed57b commit c9eef0c

File tree

6 files changed

+56
-46
lines changed

6 files changed

+56
-46
lines changed

deps/googletest/include/gtest/gtest-message.h

+9-10
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#ifdef GTEST_HAS_ABSL
6060
#include <type_traits>
6161

62-
#include "absl/strings/internal/has_absl_stringify.h"
62+
#include "absl/strings/has_absl_stringify.h"
6363
#include "absl/strings/str_cat.h"
6464
#endif // GTEST_HAS_ABSL
6565

@@ -121,14 +121,14 @@ class GTEST_API_ Message {
121121
// Streams a non-pointer value to this object. If building a version of
122122
// GoogleTest with ABSL, this overload is only enabled if the value does not
123123
// have an AbslStringify definition.
124-
template <typename T
124+
template <
125+
typename T
125126
#ifdef GTEST_HAS_ABSL
126-
,
127-
typename std::enable_if<
128-
!absl::strings_internal::HasAbslStringify<T>::value, // NOLINT
129-
int>::type = 0
127+
,
128+
typename std::enable_if<!absl::HasAbslStringify<T>::value, // NOLINT
129+
int>::type = 0
130130
#endif // GTEST_HAS_ABSL
131-
>
131+
>
132132
inline Message& operator<<(const T& val) {
133133
// Some libraries overload << for STL containers. These
134134
// overloads are defined in the global namespace instead of ::std.
@@ -153,9 +153,8 @@ class GTEST_API_ Message {
153153
// Streams a non-pointer value with an AbslStringify definition to this
154154
// object.
155155
template <typename T,
156-
typename std::enable_if<
157-
absl::strings_internal::HasAbslStringify<T>::value, // NOLINT
158-
int>::type = 0>
156+
typename std::enable_if<absl::HasAbslStringify<T>::value, // NOLINT
157+
int>::type = 0>
159158
inline Message& operator<<(const T& val) {
160159
// ::operator<< is needed here for a similar reason as with the non-Abseil
161160
// version above

deps/googletest/include/gtest/gtest-printers.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
#include <vector>
117117

118118
#ifdef GTEST_HAS_ABSL
119-
#include "absl/strings/internal/has_absl_stringify.h"
119+
#include "absl/strings/has_absl_stringify.h"
120120
#include "absl/strings/str_cat.h"
121121
#endif // GTEST_HAS_ABSL
122122
#include "gtest/internal/gtest-internal.h"
@@ -292,10 +292,9 @@ struct ConvertibleToStringViewPrinter {
292292

293293
#ifdef GTEST_HAS_ABSL
294294
struct ConvertibleToAbslStringifyPrinter {
295-
template <
296-
typename T,
297-
typename = typename std::enable_if<
298-
absl::strings_internal::HasAbslStringify<T>::value>::type> // NOLINT
295+
template <typename T,
296+
typename = typename std::enable_if<
297+
absl::HasAbslStringify<T>::value>::type> // NOLINT
299298
static void PrintValue(const T& value, ::std::ostream* os) {
300299
*os << absl::StrCat(value);
301300
}

deps/googletest/include/gtest/internal/gtest-port.h

+38-26
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,22 @@
281281
#error C++ versions less than C++14 are not supported.
282282
#endif
283283

284+
// MSVC >= 19.11 (VS 2017 Update 3) supports __has_include.
285+
#ifdef __has_include
286+
#define GTEST_INTERNAL_HAS_INCLUDE __has_include
287+
#else
288+
#define GTEST_INTERNAL_HAS_INCLUDE(...) 0
289+
#endif
290+
291+
// Detect C++ feature test macros as gracefully as possible.
292+
// MSVC >= 19.15, Clang >= 3.4.1, and GCC >= 4.1.2 support feature test macros.
293+
#if GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L && \
294+
(!defined(__has_include) || GTEST_INTERNAL_HAS_INCLUDE(<version>))
295+
#include <version> // C++20 and later
296+
#elif (!defined(__has_include) || GTEST_INTERNAL_HAS_INCLUDE(<ciso646>))
297+
#include <ciso646> // Pre-C++20
298+
#endif
299+
284300
#include <ctype.h> // for isspace, etc
285301
#include <stddef.h> // for ptrdiff_t
286302
#include <stdio.h>
@@ -829,9 +845,9 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
829845
#ifndef GTEST_API_
830846

831847
#ifdef _MSC_VER
832-
#if GTEST_LINKED_AS_SHARED_LIBRARY
848+
#if defined(GTEST_LINKED_AS_SHARED_LIBRARY) && GTEST_LINKED_AS_SHARED_LIBRARY
833849
#define GTEST_API_ __declspec(dllimport)
834-
#elif GTEST_CREATE_SHARED_LIBRARY
850+
#elif defined(GTEST_CREATE_SHARED_LIBRARY) && GTEST_CREATE_SHARED_LIBRARY
835851
#define GTEST_API_ __declspec(dllexport)
836852
#endif
837853
#elif GTEST_HAVE_ATTRIBUTE_(visibility)
@@ -2351,9 +2367,9 @@ using Any = ::absl::any;
23512367
} // namespace internal
23522368
} // namespace testing
23532369
#else
2354-
#ifdef __has_include
2355-
#if __has_include(<any>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L && \
2356-
(!defined(_MSC_VER) || GTEST_HAS_RTTI)
2370+
#if defined(__cpp_lib_any) || (GTEST_INTERNAL_HAS_INCLUDE(<any>) && \
2371+
GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L && \
2372+
(!defined(_MSC_VER) || GTEST_HAS_RTTI))
23572373
// Otherwise for C++17 and higher use std::any for UniversalPrinter<>
23582374
// specializations.
23592375
#define GTEST_INTERNAL_HAS_ANY 1
@@ -2365,8 +2381,7 @@ using Any = ::std::any;
23652381
} // namespace testing
23662382
// The case where absl is configured NOT to alias std::any is not
23672383
// supported.
2368-
#endif // __has_include(<any>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
2369-
#endif // __has_include
2384+
#endif // __cpp_lib_any
23702385
#endif // GTEST_HAS_ABSL
23712386

23722387
#ifndef GTEST_INTERNAL_HAS_ANY
@@ -2386,8 +2401,8 @@ inline ::absl::nullopt_t Nullopt() { return ::absl::nullopt; }
23862401
} // namespace internal
23872402
} // namespace testing
23882403
#else
2389-
#ifdef __has_include
2390-
#if __has_include(<optional>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
2404+
#if defined(__cpp_lib_optional) || (GTEST_INTERNAL_HAS_INCLUDE(<optional>) && \
2405+
GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L)
23912406
// Otherwise for C++17 and higher use std::optional for UniversalPrinter<>
23922407
// specializations.
23932408
#define GTEST_INTERNAL_HAS_OPTIONAL 1
@@ -2401,19 +2416,17 @@ inline ::std::nullopt_t Nullopt() { return ::std::nullopt; }
24012416
} // namespace testing
24022417
// The case where absl is configured NOT to alias std::optional is not
24032418
// supported.
2404-
#endif // __has_include(<optional>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
2405-
#endif // __has_include
2419+
#endif // __cpp_lib_optional
24062420
#endif // GTEST_HAS_ABSL
24072421

24082422
#ifndef GTEST_INTERNAL_HAS_OPTIONAL
24092423
#define GTEST_INTERNAL_HAS_OPTIONAL 0
24102424
#endif
24112425

2412-
#ifdef __has_include
2413-
#if __has_include(<span>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L
2426+
#if defined(__cpp_lib_span) || (GTEST_INTERNAL_HAS_INCLUDE(<span>) && \
2427+
GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L)
24142428
#define GTEST_INTERNAL_HAS_STD_SPAN 1
2415-
#endif // __has_include(<span>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L
2416-
#endif // __has_include
2429+
#endif // __cpp_lib_span
24172430

24182431
#ifndef GTEST_INTERNAL_HAS_STD_SPAN
24192432
#define GTEST_INTERNAL_HAS_STD_SPAN 0
@@ -2430,8 +2443,9 @@ using StringView = ::absl::string_view;
24302443
} // namespace internal
24312444
} // namespace testing
24322445
#else
2433-
#ifdef __has_include
2434-
#if __has_include(<string_view>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
2446+
#if defined(__cpp_lib_string_view) || \
2447+
(GTEST_INTERNAL_HAS_INCLUDE(<string_view>) && \
2448+
GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L)
24352449
// Otherwise for C++17 and higher use std::string_view for Matcher<>
24362450
// specializations.
24372451
#define GTEST_INTERNAL_HAS_STRING_VIEW 1
@@ -2443,9 +2457,7 @@ using StringView = ::std::string_view;
24432457
} // namespace testing
24442458
// The case where absl is configured NOT to alias std::string_view is not
24452459
// supported.
2446-
#endif // __has_include(<string_view>) && GTEST_INTERNAL_CPLUSPLUS_LANG >=
2447-
// 201703L
2448-
#endif // __has_include
2460+
#endif // __cpp_lib_string_view
24492461
#endif // GTEST_HAS_ABSL
24502462

24512463
#ifndef GTEST_INTERNAL_HAS_STRING_VIEW
@@ -2464,8 +2476,8 @@ using Variant = ::absl::variant<T...>;
24642476
} // namespace internal
24652477
} // namespace testing
24662478
#else
2467-
#ifdef __has_include
2468-
#if __has_include(<variant>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
2479+
#if defined(__cpp_lib_variant) || (GTEST_INTERNAL_HAS_INCLUDE(<variant>) && \
2480+
GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L)
24692481
// Otherwise for C++17 and higher use std::variant for UniversalPrinter<>
24702482
// specializations.
24712483
#define GTEST_INTERNAL_HAS_VARIANT 1
@@ -2477,16 +2489,16 @@ using Variant = ::std::variant<T...>;
24772489
} // namespace internal
24782490
} // namespace testing
24792491
// The case where absl is configured NOT to alias std::variant is not supported.
2480-
#endif // __has_include(<variant>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
2481-
#endif // __has_include
2492+
#endif // __cpp_lib_variant
24822493
#endif // GTEST_HAS_ABSL
24832494

24842495
#ifndef GTEST_INTERNAL_HAS_VARIANT
24852496
#define GTEST_INTERNAL_HAS_VARIANT 0
24862497
#endif
24872498

2488-
#if defined(GTEST_INTERNAL_CPLUSPLUS_LANG) && \
2489-
GTEST_INTERNAL_CPLUSPLUS_LANG < 201703L
2499+
#if (defined(__cpp_constexpr) && !defined(__cpp_inline_variables)) || \
2500+
(defined(GTEST_INTERNAL_CPLUSPLUS_LANG) && \
2501+
GTEST_INTERNAL_CPLUSPLUS_LANG < 201703L)
24902502
#define GTEST_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL 1
24912503
#endif
24922504

deps/googletest/src/gtest-filepath.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ bool FilePath::CreateDirectoriesRecursively() const {
336336
return false;
337337
}
338338

339-
if (pathname_.length() == 0 || this->DirectoryExists()) {
339+
if (pathname_.empty() || this->DirectoryExists()) {
340340
return true;
341341
}
342342

deps/googletest/src/gtest.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -5400,7 +5400,7 @@ void UnitTest::RecordProperty(const std::string& key,
54005400
int UnitTest::Run() {
54015401
#ifdef GTEST_HAS_DEATH_TEST
54025402
const bool in_death_test_child_process =
5403-
GTEST_FLAG_GET(internal_run_death_test).length() > 0;
5403+
!GTEST_FLAG_GET(internal_run_death_test).empty();
54045404

54055405
// Google Test implements this protocol for catching that a test
54065406
// program exits before returning control to Google Test:

doc/contributing/maintaining/maintaining-dependencies.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This a list of all the dependencies:
1515
* [c-ares 1.19.0][]
1616
* [cjs-module-lexer 1.2.2][]
1717
* [corepack][]
18-
* [googletest d1467f5][]
18+
* [googletest e47544a][]
1919
* [histogram 0.11.8][]
2020
* [icu-small 73.2][]
2121
* [libuv 1.46.0][]
@@ -189,7 +189,7 @@ In practical terms, Corepack will let you use Yarn and pnpm without having to
189189
install them - just like what currently happens with npm, which is shipped
190190
by Node.js by default.
191191

192-
### googletest d1467f5
192+
### googletest e47544a
193193

194194
The [googletest](https://github.com/google/googletest) dependency is Google’s
195195
C++ testing and mocking framework.
@@ -326,7 +326,7 @@ performance improvements not currently available in standard zlib.
326326
[cjs-module-lexer 1.2.2]: #cjs-module-lexer-122
327327
[corepack]: #corepack
328328
[dependency-update-action]: ../../../.github/workflows/tools.yml
329-
[googletest d1467f5]: #googletest-d1467f5
329+
[googletest e47544a]: #googletest-e47544a
330330
[histogram 0.11.8]: #histogram-0118
331331
[icu-small 73.2]: #icu-small-732
332332
[libuv 1.46.0]: #libuv-1460

0 commit comments

Comments
 (0)