From 5e09bb236687287ba038284dae17af1540f0a7a1 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 16 Dec 2022 17:28:34 -0500 Subject: [PATCH] gtestutils: Do not use default log handler when using TAP Only use g_test_log() because it will prepend `#` to log messages when using TAP protocol. Meson >=1.0 rightfully prints a warning when using TAP protocol and stdout contains non-comment unknown TAP command. --- glib/gtestutils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glib/gtestutils.c b/glib/gtestutils.c index 44498beee..0da3df771 100644 --- a/glib/gtestutils.c +++ b/glib/gtestutils.c @@ -3280,9 +3280,10 @@ gtest_default_log_handler (const gchar *log_domain, msg = g_strjoinv ("", (gchar**) strv); g_test_log (fatal ? G_TEST_LOG_ERROR : G_TEST_LOG_MESSAGE, msg, NULL, 0, NULL); - g_log_default_handler (log_domain, log_level, message, unused_data); - g_free (msg); + + if (!test_tap_log) + g_log_default_handler (log_domain, log_level, message, unused_data); } void