From 085af2cc08600bdb13827ca40261abcbe5048bb5 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Sat, 8 Nov 2025 02:52:45 -0800 Subject: [PATCH] Automated rollback of commit 37678c92fb183b148163dd173430b4ab88586a26. PiperOrigin-RevId: 829765029 Change-Id: Ia5534b109e0abfd17a74d89ce58d6588a6255f94 --- googletest/src/gtest.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index cd218c9b0..76b49e903 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -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; }