Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 36abbbe

Browse filesBrowse files
jbergstroemMyles Borins
authored andcommitted
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: #9262 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent 747013b commit 36abbbe
Copy full SHA for 36abbbe

File tree

Expand file treeCollapse file tree

1 file changed

+9
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-7
lines changed
Open diff view settings
Collapse file

‎deps/gtest/src/gtest.cc‎

Copy file name to clipboardExpand all lines: deps/gtest/src/gtest.cc
+9-7Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3596,25 +3596,27 @@ void TapUnitTestResultPrinter::OutputTapTestInfo(int* count,
35963596
*stream << " ---\n";
35973597
*stream << " duration_ms: " <<
35983598
FormatTimeInMillisAsSeconds(result.elapsed_time()) << "\n";
3599-
*stream << " ...\n";
36003599

3601-
for (int i = 0; i < result.total_part_count(); ++i) {
3602-
const TestPartResult& part = result.GetTestPartResult(i);
3603-
OutputTapComment(stream, part.message());
3600+
if (result.total_part_count() > 0) {
3601+
*stream << " stack: |-\n";
3602+
for (int i = 0; i < result.total_part_count(); ++i) {
3603+
const TestPartResult& part = result.GetTestPartResult(i);
3604+
OutputTapComment(stream, part.message());
3605+
}
36043606
}
3605-
3607+
*stream << " ...\n";
36063608
*count += 1;
36073609
}
36083610

36093611
void TapUnitTestResultPrinter::OutputTapComment(::std::ostream* stream,
36103612
const char* comment) {
36113613
const char* start = comment;
36123614
while (const char* end = strchr(start, '\n')) {
3613-
*stream << "# " << std::string(start, end) << "\n";
3615+
*stream << " " << std::string(start, end) << "\n";
36143616
start = end + 1;
36153617
}
36163618
if (*start)
3617-
*stream << "# " << start << "\n";
3619+
*stream << " " << start << "\n";
36183620
}
36193621

36203622
// Formats the given time in milliseconds as seconds.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.