gtestutils: "Bail out!" TAP message cannot be multiline

Extra lines must be prepended with `#` which g_test_message() does for
us. Note that lines after "Bail out" are ignored, so we print
stdout/stderr before.
This commit is contained in:
Xavier Claessens 2022-12-16 18:07:20 -05:00 committed by Marco Trevisan (Treviño)
parent 250f3f0644
commit 28299eb467

View File

@ -4122,8 +4122,10 @@ g_test_trap_assertions (const char *domain,
logged_child_output = logged_child_output || log_child_output (process_id);
msg = g_strdup_printf ("stdout of child process (%s) %s: %s\nstdout was:\n%s",
process_id, match_error, stdout_pattern, test_trap_last_stdout);
g_test_message ("stdout was:\n%s", test_trap_last_stdout);
msg = g_strdup_printf ("stdout of child process (%s) %s: %s",
process_id, match_error, stdout_pattern);
g_assertion_message (domain, file, line, func, msg);
g_free (msg);
}
@ -4133,8 +4135,10 @@ g_test_trap_assertions (const char *domain,
logged_child_output = logged_child_output || log_child_output (process_id);
msg = g_strdup_printf ("stderr of child process (%s) %s: %s\nstderr was:\n%s",
process_id, match_error, stderr_pattern, test_trap_last_stderr);
g_test_message ("stderr was:\n%s", test_trap_last_stderr);
msg = g_strdup_printf ("stderr of child process (%s) %s: %s",
process_id, match_error, stderr_pattern);
g_assertion_message (domain, file, line, func, msg);
g_free (msg);
}