@@ -1086,14 +1086,14 @@ void DefaultPerThreadTestPartResultReporter::ReportTestPartResult(
10861086// Returns the global test part result reporter.
10871087TestPartResultReporterInterface*
10881088UnitTestImpl::GetGlobalTestPartResultReporter () {
1089- internal::MutexLock lock (& global_test_part_result_reporter_mutex_);
1089+ internal::MutexLock lock (global_test_part_result_reporter_mutex_);
10901090 return global_test_part_result_reporter_;
10911091}
10921092
10931093// Sets the global test part result reporter.
10941094void UnitTestImpl::SetGlobalTestPartResultReporter (
10951095 TestPartResultReporterInterface* reporter) {
1096- internal::MutexLock lock (& global_test_part_result_reporter_mutex_);
1096+ internal::MutexLock lock (global_test_part_result_reporter_mutex_);
10971097 global_test_part_result_reporter_ = reporter;
10981098}
10991099
@@ -2347,7 +2347,7 @@ void TestResult::RecordProperty(const std::string& xml_element,
23472347 if (!ValidateTestProperty (xml_element, test_property)) {
23482348 return ;
23492349 }
2350- internal::MutexLock lock (& test_properties_mutex_);
2350+ internal::MutexLock lock (test_properties_mutex_);
23512351 const std::vector<TestProperty>::iterator property_with_matching_key =
23522352 std::find_if (test_properties_.begin (), test_properties_.end (),
23532353 internal::TestPropertyKeyIs (test_property.key ()));
@@ -5088,7 +5088,7 @@ std::string OsStackTraceGetter::CurrentStackTrace(int max_depth, int skip_count)
50885088
50895089 void * caller_frame = nullptr ;
50905090 {
5091- MutexLock lock (& mutex_);
5091+ MutexLock lock (mutex_);
50925092 caller_frame = caller_frame_;
50935093 }
50945094
@@ -5127,7 +5127,7 @@ void OsStackTraceGetter::UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_) {
51275127 caller_frame = nullptr ;
51285128 }
51295129
5130- MutexLock lock (& mutex_);
5130+ MutexLock lock (mutex_);
51315131 caller_frame_ = caller_frame;
51325132#endif // GTEST_HAS_ABSL
51335133}
@@ -5390,13 +5390,13 @@ void UnitTest::UponLeavingGTest() {
53905390
53915391// Sets the TestSuite object for the test that's currently running.
53925392void UnitTest::set_current_test_suite (TestSuite* a_current_test_suite) {
5393- internal::MutexLock lock (& mutex_);
5393+ internal::MutexLock lock (mutex_);
53945394 impl_->set_current_test_suite (a_current_test_suite);
53955395}
53965396
53975397// Sets the TestInfo object for the test that's currently running.
53985398void UnitTest::set_current_test_info (TestInfo* a_current_test_info) {
5399- internal::MutexLock lock (& mutex_);
5399+ internal::MutexLock lock (mutex_);
54005400 impl_->set_current_test_info (a_current_test_info);
54015401}
54025402
@@ -5435,7 +5435,7 @@ void UnitTest::AddTestPartResult(TestPartResult::Type result_type,
54355435 Message msg;
54365436 msg << message;
54375437
5438- internal::MutexLock lock (& mutex_);
5438+ internal::MutexLock lock (mutex_);
54395439 if (!impl_->gtest_trace_stack ().empty ()) {
54405440 msg << " \n " << GTEST_NAME_ << " trace:" ;
54415441
@@ -5618,15 +5618,15 @@ const char* UnitTest::original_working_dir() const {
56185618// or NULL if no test is running.
56195619const TestSuite* UnitTest::current_test_suite () const
56205620 GTEST_LOCK_EXCLUDED_(mutex_) {
5621- internal::MutexLock lock (& mutex_);
5621+ internal::MutexLock lock (mutex_);
56225622 return impl_->current_test_suite ();
56235623}
56245624
56255625// Legacy API is still available but deprecated
56265626#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
56275627const TestCase* UnitTest::current_test_case () const
56285628 GTEST_LOCK_EXCLUDED_(mutex_) {
5629- internal::MutexLock lock (& mutex_);
5629+ internal::MutexLock lock (mutex_);
56305630 return impl_->current_test_suite ();
56315631}
56325632#endif
@@ -5635,7 +5635,7 @@ const TestCase* UnitTest::current_test_case() const
56355635// or NULL if no test is running.
56365636const TestInfo* UnitTest::current_test_info () const
56375637 GTEST_LOCK_EXCLUDED_(mutex_) {
5638- internal::MutexLock lock (& mutex_);
5638+ internal::MutexLock lock (mutex_);
56395639 return impl_->current_test_info ();
56405640}
56415641
@@ -5659,13 +5659,13 @@ UnitTest::~UnitTest() { delete impl_; }
56595659// Google Test trace stack.
56605660void UnitTest::PushGTestTrace (const internal::TraceInfo& trace)
56615661 GTEST_LOCK_EXCLUDED_(mutex_) {
5662- internal::MutexLock lock (& mutex_);
5662+ internal::MutexLock lock (mutex_);
56635663 impl_->gtest_trace_stack ().push_back (trace);
56645664}
56655665
56665666// Pops a trace from the per-thread Google Test trace stack.
56675667void UnitTest::PopGTestTrace () GTEST_LOCK_EXCLUDED_(mutex_) {
5668- internal::MutexLock lock (& mutex_);
5668+ internal::MutexLock lock (mutex_);
56695669 impl_->gtest_trace_stack ().pop_back ();
56705670}
56715671
@@ -6088,15 +6088,17 @@ bool UnitTestImpl::RunAllTests() {
60886088 repeater->OnEnvironmentsTearDownEnd (*parent_);
60896089 }
60906090 } else if (GTEST_FLAG_GET (fail_if_no_test_selected)) {
6091- // If there were no tests to run, bail if we were requested to be strict.
6091+ // If there were no tests to run, bail if we were requested to be
6092+ // strict.
60926093 constexpr char kNoTestsSelectedMessage [] =
6093- " No tests were selected to run. Please make sure at least one test "
6094- " exists and is not disabled! If the test is sharded, you may have "
6095- " defined more shards than test cases, which is wasteful. If you also "
6096- " defined --gtest_filter, that filter is taken into account, so "
6097- " shards with no matching test cases will hit this error. Either "
6098- " disable sharding, set --gtest_fail_if_no_test_selected=false, or "
6099- " remove the filter to resolve this error." ;
6094+ " No tests ran. Check that tests exist and are not disabled or "
6095+ " filtered out.\n\n "
6096+ " For sharded runs, this error indicates an empty shard. This can "
6097+ " happen if you have more shards than tests, or if --gtest_filter "
6098+ " leaves a shard with no tests.\n\n "
6099+ " To permit empty shards (e.g., when debugging with a filter), "
6100+ " specify \n "
6101+ " --gtest_fail_if_no_test_selected=false." ;
61006102 ColoredPrintf (GTestColor::kRed , " %s\n " , kNoTestsSelectedMessage );
61016103 return false ;
61026104 }
0 commit comments