From b3cbc6053f992ed194bfb167610368b72e2c0896 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 18 Jun 2025 14:55:16 +1000 Subject: [PATCH] test: handle plugin bugs and log messages in the test suite For the bug log handler check we need to print our message to search for the "plugin bug:" prefix. And since we have that message printed now anyway we might as well add it to the abort message. Part-of: --- test/litest.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/litest.c b/test/litest.c index e77f595c..944fff6b 100644 --- a/test/litest.c +++ b/test/litest.c @@ -1327,11 +1327,14 @@ litest_log_handler(struct libinput *libinput, color = ANSI_BRIGHT_GREEN; else if (strstr(format, "gesture:")) color = ANSI_BRIGHT_YELLOW; + else if (strstr(msg, "Plugin:")) + color = ANSI_BRIGHT_CYAN; fprintf(stderr, "%slitest %s %s%s", color, priority, msg, color_reset); if (strstr(msg, "client bug: ") || - strstr(msg, "libinput bug: ")) { + strstr(msg, "libinput bug: ") || + strstr(msg, "plugin bug: ")) { /* valgrind is too slow and some of our offsets are too * short, don't abort if during a valgrind run we get a * negative offset */ @@ -2169,7 +2172,13 @@ litest_bug_log_handler(struct libinput *libinput, strstr(format, "kernel bug: ")) return; - litest_abort_msg("Expected bug statement in log msg, aborting."); + /* messages from plugins don't have the string in the format, it's one of the + * args... */ + _autofree_ char *msg = strdup_vprintf(format, args); + if (strstr(msg, "plugin bug:")) + return; + + litest_abort_msg("Expected bug statement in log msg ('%s'), aborting.", msg); } void