Skip to content

Commit 828f0d7

Browse files
nodejs-github-bottargos
authored andcommitted
deps: update googletest to b75ecf1
PR-URL: #51657 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Ulises Gascón <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 3b60dbc commit 828f0d7

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

deps/googletest/include/gtest/gtest.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -2308,7 +2308,8 @@ TestInfo* RegisterTest(const char* test_suite_name, const char* test_name,
23082308
// tests are successful, or 1 otherwise.
23092309
//
23102310
// RUN_ALL_TESTS() should be invoked after the command line has been
2311-
// parsed by InitGoogleTest().
2311+
// parsed by InitGoogleTest(). RUN_ALL_TESTS will tear down and delete any
2312+
// installed environments and should only be called once per binary.
23122313
//
23132314
// This function was formerly a macro; thus, it is in the global
23142315
// namespace and has an all-caps name.

deps/googletest/include/gtest/internal/gtest-death-test-internal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
7171
//
7272
// exit status: The integer exit information in the format specified
7373
// by wait(2)
74-
// exit code: The integer code passed to exit(3), _exit(2), or
74+
// exit code: The integer code passed to exit(3), _Exit(2), or
7575
// returned from main()
7676
class GTEST_API_ DeathTest {
7777
public:

deps/googletest/src/gtest-death-test.cc

+8-6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
#include "gtest/gtest-death-test.h"
3434

35+
#include <stdlib.h>
36+
3537
#include <functional>
3638
#include <memory>
3739
#include <sstream>
@@ -115,7 +117,7 @@ GTEST_DEFINE_string_(
115117
GTEST_DEFINE_bool_(
116118
death_test_use_fork,
117119
testing::internal::BoolFromGTestEnv("death_test_use_fork", false),
118-
"Instructs to use fork()/_exit() instead of clone() in death tests. "
120+
"Instructs to use fork()/_Exit() instead of clone() in death tests. "
119121
"Ignored and always uses fork() on POSIX systems where clone() is not "
120122
"implemented. Useful when running under valgrind or similar tools if "
121123
"those do not support clone(). Valgrind 3.3.1 will just fail if "
@@ -299,7 +301,7 @@ enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
299301
fputc(kDeathTestInternalError, parent);
300302
fprintf(parent, "%s", message.c_str());
301303
fflush(parent);
302-
_exit(1);
304+
_Exit(1);
303305
} else {
304306
fprintf(stderr, "%s", message.c_str());
305307
fflush(stderr);
@@ -511,7 +513,7 @@ std::string DeathTestImpl::GetErrorLogs() { return GetCapturedStderr(); }
511513
// Signals that the death test code which should have exited, didn't.
512514
// Should be called only in a death test child process.
513515
// Writes a status byte to the child's status file descriptor, then
514-
// calls _exit(1).
516+
// calls _Exit(1).
515517
void DeathTestImpl::Abort(AbortReason reason) {
516518
// The parent process considers the death test to be a failure if
517519
// it finds any data in our pipe. So, here we write a single flag byte
@@ -523,13 +525,13 @@ void DeathTestImpl::Abort(AbortReason reason) {
523525
GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1));
524526
// We are leaking the descriptor here because on some platforms (i.e.,
525527
// when built as Windows DLL), destructors of global objects will still
526-
// run after calling _exit(). On such systems, write_fd_ will be
528+
// run after calling _Exit(). On such systems, write_fd_ will be
527529
// indirectly closed from the destructor of UnitTestImpl, causing double
528530
// close if it is also closed here. On debug configurations, double close
529531
// may assert. As there are no in-process buffers to flush here, we are
530532
// relying on the OS to close the descriptor after the process terminates
531533
// when the destructors are not run.
532-
_exit(1); // Exits w/o any normal exit hooks (we were supposed to crash)
534+
_Exit(1); // Exits w/o any normal exit hooks (we were supposed to crash)
533535
}
534536

535537
// Returns an indented copy of stderr output for a death test.
@@ -1333,7 +1335,7 @@ static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {
13331335
#endif // GTEST_HAS_CLONE
13341336

13351337
if (use_fork && (child_pid = fork()) == 0) {
1336-
_exit(ExecDeathTestChildMain(&args));
1338+
_Exit(ExecDeathTestChildMain(&args));
13371339
}
13381340
#endif // GTEST_OS_QNX
13391341
#ifdef GTEST_OS_LINUX

deps/googletest/src/gtest.cc

+12-3
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ void InsertSyntheticTestCase(const std::string& name, CodeLocation location,
536536
if (ignored.find(name) != ignored.end()) return;
537537

538538
const char kMissingInstantiation[] = //
539-
" is defined via TEST_P, but never instantiated. None of the test cases "
539+
" is defined via TEST_P, but never instantiated. None of the test "
540+
"cases "
540541
"will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only "
541542
"ones provided expand to nothing."
542543
"\n\n"
@@ -615,10 +616,12 @@ void TypeParameterizedTestSuiteRegistry::CheckForInstantiations() {
615616
"\n\n"
616617
"Ideally, TYPED_TEST_P definitions should only ever be included as "
617618
"part of binaries that intend to use them. (As opposed to, for "
618-
"example, being placed in a library that may be linked in to get other "
619+
"example, being placed in a library that may be linked in to get "
620+
"other "
619621
"utilities.)"
620622
"\n\n"
621-
"To suppress this error for this test suite, insert the following line "
623+
"To suppress this error for this test suite, insert the following "
624+
"line "
622625
"(in a non-header) in the namespace it is defined in:"
623626
"\n\n"
624627
"GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(" +
@@ -5991,6 +5994,12 @@ bool UnitTestImpl::RunAllTests() {
59915994
}
59925995

59935996
repeater->OnTestProgramEnd(*parent_);
5997+
// Destroy environments in normal code, not in static teardown.
5998+
bool delete_environment_on_teardown = true;
5999+
if (delete_environment_on_teardown) {
6000+
ForEach(environments_, internal::Delete<Environment>);
6001+
environments_.clear();
6002+
}
59946003

59956004
if (!gtest_is_initialized_before_run_all_tests) {
59966005
ColoredPrintf(

0 commit comments

Comments
 (0)