From f977ddf34f3973be8486ed664d4deef7b10d05ca Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 14 Jun 2022 15:19:47 +0100 Subject: [PATCH] tests: Fix non-TAP output from debugcontroller test When running under a strict TAP parser this was previously producing problematic non-conforming output. Signed-off-by: Philip Withnall --- gio/tests/debugcontroller.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gio/tests/debugcontroller.c b/gio/tests/debugcontroller.c index 01b8ebdef..862e8f666 100644 --- a/gio/tests/debugcontroller.c +++ b/gio/tests/debugcontroller.c @@ -383,6 +383,15 @@ test_dbus_properties (void) g_clear_object (&bus); } +static GLogWriterOutput +noop_log_writer_cb (GLogLevelFlags log_level, + const GLogField *fields, + gsize n_fields, + gpointer user_data) +{ + return G_LOG_WRITER_HANDLED; +} + int main (int argc, char *argv[]) @@ -390,6 +399,10 @@ main (int argc, setlocale (LC_ALL, ""); g_test_init (&argc, &argv, NULL); + /* Ignore the log messages, as the debug controller prints one when debug is + * enabled/disabled, and if debug is enabled then that will escape to stdout. */ + g_log_set_writer_func (noop_log_writer_cb, NULL, NULL); + g_test_add_func ("/debug-controller/dbus/basic", test_dbus_basic); g_test_add_func ("/debug-controller/dbus/duplicate", test_dbus_duplicate); g_test_add_func ("/debug-controller/dbus/properties", test_dbus_properties);