mirror of
https://github.com/google/googletest.git
synced 2024-12-29 03:33:40 +08:00
Output source file path and line number in xml and json files.
It outputs the location of testcase only. Standalone EXPECT will have no location.
This commit is contained in:
parent
c9461a9b55
commit
f7621f0191
@ -4286,10 +4286,11 @@ void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
|
|||||||
OutputXmlAttribute(stream, kTestsuite, "type_param",
|
OutputXmlAttribute(stream, kTestsuite, "type_param",
|
||||||
test_info.type_param());
|
test_info.type_param());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OutputXmlAttribute(stream, kTestsuite, "file", test_info.file());
|
||||||
|
OutputXmlAttribute(stream, kTestsuite, "line",
|
||||||
|
StreamableToString(test_info.line()));
|
||||||
if (GTEST_FLAG_GET(list_tests)) {
|
if (GTEST_FLAG_GET(list_tests)) {
|
||||||
OutputXmlAttribute(stream, kTestsuite, "file", test_info.file());
|
|
||||||
OutputXmlAttribute(stream, kTestsuite, "line",
|
|
||||||
StreamableToString(test_info.line()));
|
|
||||||
*stream << " />\n";
|
*stream << " />\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4744,11 +4745,14 @@ void JsonUnitTestResultPrinter::OutputJsonTestInfo(::std::ostream* stream,
|
|||||||
OutputJsonKey(stream, kTestsuite, "type_param", test_info.type_param(),
|
OutputJsonKey(stream, kTestsuite, "type_param", test_info.type_param(),
|
||||||
kIndent);
|
kIndent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OutputJsonKey(stream, kTestsuite, "file", test_info.file(), kIndent);
|
||||||
|
OutputJsonKey(stream, kTestsuite, "line", test_info.line(), kIndent, false);
|
||||||
if (GTEST_FLAG_GET(list_tests)) {
|
if (GTEST_FLAG_GET(list_tests)) {
|
||||||
OutputJsonKey(stream, kTestsuite, "file", test_info.file(), kIndent);
|
|
||||||
OutputJsonKey(stream, kTestsuite, "line", test_info.line(), kIndent, false);
|
|
||||||
*stream << "\n" << Indent(8) << "}";
|
*stream << "\n" << Indent(8) << "}";
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
*stream << ",\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputJsonKey(stream, kTestsuite, "status",
|
OutputJsonKey(stream, kTestsuite, "status",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user