Skip to content

Commit c67de11

Browse files
pizzudcopybara-github
authored andcommitted
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
1 parent a45468c commit c67de11

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

googletest/src/gtest.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6092,7 +6092,11 @@ bool UnitTestImpl::RunAllTests() {
60926092
constexpr char kNoTestsSelectedMessage[] =
60936093
"No tests were selected to run. Please make sure at least one test "
60946094
"exists and is not disabled! If the test is sharded, you may have "
6095-
"defined more shards than test cases, which is wasteful.";
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.";
60966100
ColoredPrintf(GTestColor::kRed, "%s\n", kNoTestsSelectedMessage);
60976101
return false;
60986102
}

0 commit comments

Comments
 (0)