mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
gtest: output tap comments as yamlish
This makes yaml-ish parsers happy. Note: gtest still seems to output the expected/result slightly different making the full traceback less informational. PR-URL: https://github.com/nodejs/node/pull/9262 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Myles Borins <myles.borins@gmail.com>
This commit is contained in:
committed by
Myles Borins
parent
747013bc39
commit
36abbbe736
16
deps/gtest/src/gtest.cc
vendored
16
deps/gtest/src/gtest.cc
vendored
@@ -3596,13 +3596,15 @@ void TapUnitTestResultPrinter::OutputTapTestInfo(int* count,
|
||||
*stream << " ---\n";
|
||||
*stream << " duration_ms: " <<
|
||||
FormatTimeInMillisAsSeconds(result.elapsed_time()) << "\n";
|
||||
*stream << " ...\n";
|
||||
|
||||
for (int i = 0; i < result.total_part_count(); ++i) {
|
||||
const TestPartResult& part = result.GetTestPartResult(i);
|
||||
OutputTapComment(stream, part.message());
|
||||
if (result.total_part_count() > 0) {
|
||||
*stream << " stack: |-\n";
|
||||
for (int i = 0; i < result.total_part_count(); ++i) {
|
||||
const TestPartResult& part = result.GetTestPartResult(i);
|
||||
OutputTapComment(stream, part.message());
|
||||
}
|
||||
}
|
||||
|
||||
*stream << " ...\n";
|
||||
*count += 1;
|
||||
}
|
||||
|
||||
@@ -3610,11 +3612,11 @@ void TapUnitTestResultPrinter::OutputTapComment(::std::ostream* stream,
|
||||
const char* comment) {
|
||||
const char* start = comment;
|
||||
while (const char* end = strchr(start, '\n')) {
|
||||
*stream << "# " << std::string(start, end) << "\n";
|
||||
*stream << " " << std::string(start, end) << "\n";
|
||||
start = end + 1;
|
||||
}
|
||||
if (*start)
|
||||
*stream << "# " << start << "\n";
|
||||
*stream << " " << start << "\n";
|
||||
}
|
||||
|
||||
// Formats the given time in milliseconds as seconds.
|
||||
|
||||
Reference in New Issue
Block a user