Skip to content

Commit 736c869

Browse files
nodejs-github-bottargos
authored andcommitted
deps: update googletest to d1467f5
PR-URL: #49676 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
1 parent cd99ee1 commit 736c869

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

deps/googletest/src/gtest-port.cc

+24-8
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ size_t GetThreadCount() {
158158
// we cannot detect it.
159159
size_t GetThreadCount() {
160160
int mib[] = {
161-
CTL_KERN,
162-
KERN_PROC,
163-
KERN_PROC_PID,
164-
getpid(),
161+
CTL_KERN,
162+
KERN_PROC,
163+
KERN_PROC_PID,
164+
getpid(),
165165
#ifdef GTEST_OS_NETBSD
166-
sizeof(struct kinfo_proc),
167-
1,
166+
sizeof(struct kinfo_proc),
167+
1,
168168
#endif
169169
};
170170
u_int miblen = sizeof(mib) / sizeof(mib[0]);
@@ -1028,6 +1028,16 @@ GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
10281028

10291029
#if GTEST_HAS_STREAM_REDIRECTION
10301030

1031+
namespace {
1032+
1033+
#if defined(GTEST_OS_LINUX_ANDROID) || defined(GTEST_OS_IOS)
1034+
bool EndsWithPathSeparator(const std::string& path) {
1035+
return !path.empty() && path.back() == GTEST_PATH_SEP_[0];
1036+
}
1037+
#endif
1038+
1039+
} // namespace
1040+
10311041
// Object that captures an output stream (stdout/stderr).
10321042
class CapturedStream {
10331043
public:
@@ -1064,7 +1074,13 @@ class CapturedStream {
10641074
// The location /data/local/tmp is directly accessible from native code.
10651075
// '/sdcard' and other variants cannot be relied on, as they are not
10661076
// guaranteed to be mounted, or may have a delay in mounting.
1067-
name_template = "/data/local/tmp/";
1077+
//
1078+
// However, prefer using the TMPDIR environment variable if set, as newer
1079+
// devices may have /data/local/tmp read-only.
1080+
name_template = TempDir();
1081+
if (!EndsWithPathSeparator(name_template))
1082+
name_template.push_back(GTEST_PATH_SEP_[0]);
1083+
10681084
#elif defined(GTEST_OS_IOS)
10691085
char user_temp_dir[PATH_MAX + 1];
10701086

@@ -1084,7 +1100,7 @@ class CapturedStream {
10841100
::confstr(_CS_DARWIN_USER_TEMP_DIR, user_temp_dir, sizeof(user_temp_dir));
10851101

10861102
name_template = user_temp_dir;
1087-
if (name_template.back() != GTEST_PATH_SEP_[0])
1103+
if (!EndsWithPathSeparator(name_template))
10881104
name_template.push_back(GTEST_PATH_SEP_[0]);
10891105
#else
10901106
name_template = "/tmp/";

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.20.1][]
1616
* [cjs-module-lexer][]
1717
* [corepack][]
18-
* [googletest 8a6feab][]
18+
* [googletest d1467f5][]
1919
* [histogram][]
2020
* [icu-small][]
2121
* [llhttp][]
@@ -187,7 +187,7 @@ In practical terms, Corepack will let you use Yarn and pnpm without having to
187187
install them - just like what currently happens with npm, which is shipped
188188
by Node.js by default.
189189

190-
### googletest 8a6feab
190+
### googletest d1467f5
191191

192192
The [googletest](https://github.com/google/googletest) dependency is Google’s
193193
C++ testing and mocking framework.
@@ -319,7 +319,7 @@ performance improvements not currently available in standard zlib.
319319
[cjs-module-lexer]: #cjs-module-lexer
320320
[corepack]: #corepack
321321
[dependency-update-action]: ../../../.github/workflows/tools.yml
322-
[googletest 8a6feab]: #googletest-8a6feab
322+
[googletest d1467f5]: #googletest-d1467f5
323323
[histogram]: #histogram
324324
[icu-small]: #icu-small
325325
[llhttp]: #llhttp

0 commit comments

Comments
 (0)