Use a full message in the JSON output for failures

The full message unlike summary also includes stack trace.
This commit is contained in:
Petr Hosek 2018-03-01 13:19:34 -08:00
parent 447d58b4ee
commit 7a2050d4d7

View File

@ -4012,9 +4012,9 @@ void JsonUnitTestResultPrinter::OutputJsonTestInfo(::std::ostream* stream,
const std::string location = const std::string location =
internal::FormatCompilerIndependentFileLocation(part.file_name(), internal::FormatCompilerIndependentFileLocation(part.file_name(),
part.line_number()); part.line_number());
const std::string summary = EscapeJson(location + "\n" + part.summary()); const std::string message = EscapeJson(location + "\n" + part.message());
*stream << kIndent << " {\n" *stream << kIndent << " {\n"
<< kIndent << " \"failure\": \"" << summary << "\",\n" << kIndent << " \"failure\": \"" << message << "\",\n"
<< kIndent << " \"type\": \"\"\n" << kIndent << " \"type\": \"\"\n"
<< kIndent << " }"; << kIndent << " }";
} }