summaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authorDavid Pizzuto <pizzud@google.com>2025-06-27 22:17:44 (GMT)
committerCopybara-Service <copybara-worker@google.com>2025-06-27 22:18:25 (GMT)
commitc67de117379f4d1c889c7581a0a76aa0979c2083 (patch)
tree5827aa53a9181509d2c376b7724c8016ad5b7547 /googletest/src
parenta45468c0fcbeda1588573a7d8283b320bf9970cb (diff)
downloadgoogletest-c67de117379f4d1c889c7581a0a76aa0979c2083.zip
googletest-c67de117379f4d1c889c7581a0a76aa0979c2083.tar.gz
googletest-c67de117379f4d1c889c7581a0a76aa0979c2083.tar.bz2
gtest: Reword fail_if_no_test_selected_message for sharding and filtering.
Users have shown some confusion about the interaction between this flag, sharding, and --gtest_filter, so let's provide some more information. PiperOrigin-RevId: 776734799 Change-Id: Icdcf6aa056988095f15588758994604d326c0567
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index dafd968..804af46 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -6092,7 +6092,11 @@ bool UnitTestImpl::RunAllTests() {
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.";
+ "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.";
ColoredPrintf(GTestColor::kRed, "%s\n", kNoTestsSelectedMessage);
return false;
}