Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions deps/googletest/src/gtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ std::string UnitTestOptions::GetAbsolutePathToOutputFile() {
const char* const gtest_output_flag = s.c_str();

std::string format = GetOutputFormat();
if (format.empty()) format = std::string(kDefaultOutputFormat);
if (format.empty()) format = kDefaultOutputFormat;

const char* const colon = strchr(gtest_output_flag, ':');
if (colon == nullptr)
Expand Down Expand Up @@ -3305,6 +3305,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
const bool term_supports_color =
term != nullptr && (String::CStringEquals(term, "xterm") ||
String::CStringEquals(term, "xterm-color") ||
String::CStringEquals(term, "xterm-ghostty") ||
String::CStringEquals(term, "xterm-kitty") ||
String::CStringEquals(term, "alacritty") ||
String::CStringEquals(term, "screen") ||
Expand Down Expand Up @@ -4354,8 +4355,8 @@ void XmlUnitTestResultPrinter::OutputXmlTestResult(::std::ostream* stream,
internal::FormatCompilerIndependentFileLocation(part.file_name(),
part.line_number());
const std::string summary = location + "\n" + part.summary();
*stream << " <skipped message=\""
<< EscapeXmlAttribute(summary.c_str()) << "\">";
*stream << " <skipped message=\"" << EscapeXmlAttribute(summary)
<< "\">";
const std::string detail = location + "\n" + part.message();
OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str());
*stream << "</skipped>\n";
Expand Down Expand Up @@ -6091,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;
}
Expand Down
Loading