Repository: nodejs/node
Pull request: deps: update googletest to 1b96fa13f549387b7549cc89e1a785cf143a1a50

This is an automated update of googletest to 1b96fa13f549387b7549cc89e1a785cf143a1a50.

Changed files:
filename: deps/googletest/include/gtest/internal/gtest-port.h
patch: @@ -1424,12 +1424,11 @@ class GTEST_API_ Mutex {
 // "MutexLock l(&mu)".  Hence the typedef trick below.
 class GTestMutexLock {
  public:
-  explicit GTestMutexLock(Mutex* mutex) : mutex_(mutex) { mutex_->lock(); }
-
-  ~GTestMutexLock() { mutex_->unlock(); }
+  explicit GTestMutexLock(Mutex& mutex) : mutex_(mutex) { mutex_.lock(); }
+  ~GTestMutexLock() { mutex_.unlock(); }
 
  private:
-  Mutex* const mutex_;
+  Mutex& mutex_;
 
   GTestMutexLock(const GTestMutexLock&) = delete;
   GTestMutexLock& operator=(const GTestMutexLock&) = delete;
@@ -1716,12 +1715,11 @@ class Mutex : public MutexBase {
 // "MutexLock l(&mu)".  Hence the typedef trick below.
 class GTestMutexLock {
  public:
-  explicit GTestMutexLock(MutexBase* mutex) : mutex_(mutex) { mutex_->lock(); }
-
-  ~GTestMutexLock() { mutex_->unlock(); }
+  explicit GTestMutexLock(MutexBase& mutex) : mutex_(mutex) { mutex_.lock(); }
+  ~GTestMutexLock() { mutex_.unlock(); }
 
  private:
-  MutexBase* const mutex_;
+  MutexBase& mutex_;
 
   GTestMutexLock(const GTestMutexLock&) = delete;
   GTestMutexLock& operator=(const GTestMutexLock&) = delete;
@@ -1881,7 +1879,7 @@ class Mutex {
 // "MutexLock l(&mu)".  Hence the typedef trick below.
 class GTestMutexLock {
  public:
-  explicit GTestMutexLock(Mutex*) {}  // NOLINT
+  explicit GTestMutexLock(Mutex&) {}  // NOLINT
 };
 
 typedef GTestMutexLock MutexLock;

filename: deps/googletest/src/gtest-port.cc
patch: @@ -499,7 +499,7 @@ class ThreadLocalRegistryImpl {
     MemoryIsNotDeallocated memory_is_not_deallocated;
 #endif  // _MSC_VER
     DWORD current_thread = ::GetCurrentThreadId();
-    MutexLock lock(&mutex_);
+    MutexLock lock(mutex_);
     ThreadIdToThreadLocals* const thread_to_thread_locals =
         GetThreadLocalsMapLocked();
     ThreadIdToThreadLocals::iterator thread_local_pos =
@@ -532,7 +532,7 @@ class ThreadLocalRegistryImpl {
     // Clean up the ThreadLocalValues data structure while holding the lock, but
     // defer the destruction of the ThreadLocalValueHolderBases.
     {
-      MutexLock lock(&mutex_);
+      MutexLock lock(mutex_);
       ThreadIdToThreadLocals* const thread_to_thread_locals =
           GetThreadLocalsMapLocked();
       for (ThreadIdToThreadLocals::iterator it =
@@ -559,7 +559,7 @@ class ThreadLocalRegistryImpl {
     // Clean up the ThreadIdToThreadLocals data structure while holding the
     // lock, but defer the destruction of the ThreadLocalValueHolderBases.
     {
-      MutexLock lock(&mutex_);
+      MutexLock lock(mutex_);
       ThreadIdToThreadLocals* const thread_to_thread_locals =
           GetThreadLocalsMapLocked();
       ThreadIdToThreadLocals::iterator thread_local_pos =

filename: deps/googletest/src/gtest.cc
patch: @@ -1086,14 +1086,14 @@ void DefaultPerThreadTestPartResultReporter::ReportTestPartResult(
 // Returns the global test part result reporter.
 TestPartResultReporterInterface*
 UnitTestImpl::GetGlobalTestPartResultReporter() {
-  internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
+  internal::MutexLock lock(global_test_part_result_reporter_mutex_);
   return global_test_part_result_reporter_;
 }
 
 // Sets the global test part result reporter.
 void UnitTestImpl::SetGlobalTestPartResultReporter(
     TestPartResultReporterInterface* reporter) {
-  internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
+  internal::MutexLock lock(global_test_part_result_reporter_mutex_);
   global_test_part_result_reporter_ = reporter;
 }
 
@@ -2347,7 +2347,7 @@ void TestResult::RecordProperty(const std::string& xml_element,
   if (!ValidateTestProperty(xml_element, test_property)) {
     return;
   }
-  internal::MutexLock lock(&test_properties_mutex_);
+  internal::MutexLock lock(test_properties_mutex_);
   const std::vector<TestProperty>::iterator property_with_matching_key =
       std::find_if(test_properties_.begin(), test_properties_.end(),
                    internal::TestPropertyKeyIs(test_property.key()));
@@ -5088,7 +5088,7 @@ std::string OsStackTraceGetter::CurrentStackTrace(int max_depth, int skip_count)
 
   void* caller_frame = nullptr;
   {
-    MutexLock lock(&mutex_);
+    MutexLock lock(mutex_);
     caller_frame = caller_frame_;
   }
 
@@ -5127,7 +5127,7 @@ void OsStackTraceGetter::UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_) {
     caller_frame = nullptr;
   }
 
-  MutexLock lock(&mutex_);
+  MutexLock lock(mutex_);
   caller_frame_ = caller_frame;
 #endif  // GTEST_HAS_ABSL
 }
@@ -5390,13 +5390,13 @@ void UnitTest::UponLeavingGTest() {
 
 // Sets the TestSuite object for the test that's currently running.
 void UnitTest::set_current_test_suite(TestSuite* a_current_test_suite) {
-  internal::MutexLock lock(&mutex_);
+  internal::MutexLock lock(mutex_);
   impl_->set_current_test_suite(a_current_test_suite);
 }
 
 // Sets the TestInfo object for the test that's currently running.
 void UnitTest::set_current_test_info(TestInfo* a_current_test_info) {
-  internal::MutexLock lock(&mutex_);
+  internal::MutexLock lock(mutex_);
   impl_->set_current_test_info(a_current_test_info);
 }
 
@@ -5435,7 +5435,7 @@ void UnitTest::AddTestPartResult(TestPartResult::Type result_type,
   Message msg;
   msg << message;
 
-  internal::MutexLock lock(&mutex_);
+  internal::MutexLock lock(mutex_);
   if (!impl_->gtest_trace_stack().empty()) {
     msg << "\n" << GTEST_NAME_ << " trace:";
 
@@ -5618,15 +5618,15 @@ const char* UnitTest::original_working_dir() const {
 // or NULL if no test is running.
 const TestSuite* UnitTest::current_test_suite() const
     GTEST_LOCK_EXCLUDED_(mutex_) {
-  internal::MutexLock lock(&mutex_);
+  internal::MutexLock lock(mutex_);
   return impl_->current_test_suite();
 }
 
 // Legacy API is still available but deprecated
 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
 const TestCase* UnitTest::current_test_case() const
     GTEST_LOCK_EXCLUDED_(mutex_) {
-  internal::MutexLock lock(&mutex_);
+  internal::MutexLock lock(mutex_);
   return impl_->current_test_suite();
 }
 #endif
@@ -5635,7 +5635,7 @@ const TestCase* UnitTest::current_test_case() const
 // or NULL if no test is running.
 const TestInfo* UnitTest::current_test_info() const
     GTEST_LOCK_EXCLUDED_(mutex_) {
-  internal::MutexLock lock(&mutex_);
+  internal::MutexLock lock(mutex_);
   return impl_->current_test_info();
 }
 
@@ -5659,13 +5659,13 @@ UnitTest::~UnitTest() { delete impl_; }
 // Google Test trace stack.
 void UnitTest::PushGTestTrace(const internal::TraceInfo& trace)
     GTEST_LOCK_EXCLUDED_(mutex_) {
-  internal::MutexLock lock(&mutex_);
+  internal::MutexLock lock(mutex_);
   impl_->gtest_trace_stack().push_back(trace);
 }
 
 // Pops a trace from the per-thread Google Test trace stack.
 void UnitTest::PopGTestTrace() GTEST_LOCK_EXCLUDED_(mutex_) {
-  internal::MutexLock lock(&mutex_);
+  internal::MutexLock lock(mutex_);
   impl_->gtest_trace_stack().pop_back();
 }
 
@@ -6088,15 +6088,17 @@ bool UnitTestImpl::RunAllTests() {
         repeater->OnEnvironmentsTearDownEnd(*parent_);
       }
     } else if (GTEST_FLAG_GET(fail_if_no_test_selected)) {
-      // If there were no tests to run, bail if we were requested to be strict.
+      // If there were no tests to run, bail if we were requested to be
+      // strict.
       constexpr char kNoTestsSelectedMessage[] =
-          "No tests were selected to run. Please make sure at least one test "
-          "exists and is not disabled! If the test is sharded, you may have "
-          "defined more shards than test cases, which is wasteful. If you also "
-          "defined --gtest_filter, that filter is taken into account, so "
-          "shards with no matching test cases will hit this error. Either "
-          "disable sharding, set --gtest_fail_if_no_test_selected=false, or "
-          "remove the filter to resolve this error.";
+          "No tests ran. Check that tests exist and are not disabled or "
+          "filtered out.\n\n"
+          "For sharded runs, this error indicates an empty shard. This can "
+          "happen if you have more shards than tests, or if --gtest_filter "
+          "leaves a shard with no tests.\n\n"
+          "To permit empty shards (e.g., when debugging with a filter), "
+          "specify \n"
+          "--gtest_fail_if_no_test_selected=false.";
       ColoredPrintf(GTestColor::kRed, "%s\n", kNoTestsSelectedMessage);
       return false;
     }