From d9a4667a1488d0e738f055ecbf24279ec2d8f479 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 27 Jun 2025 10:37:33 +1000 Subject: [PATCH] test: track bug messages separately in log captures Notably, this also tracks kernel bugs now as opposed to just other bugs. It is up to tests checking for the expected message. Part-of: --- test/litest.c | 6 ++++++ test/litest.h | 1 + 2 files changed, 7 insertions(+) diff --git a/test/litest.c b/test/litest.c index ad484ea0..130120f5 100644 --- a/test/litest.c +++ b/test/litest.c @@ -4785,6 +4785,7 @@ litest_logcapture_destroy(struct litest_logcapture *c) strv_free(c->errors); strv_free(c->infos); strv_free(c->debugs); + strv_free(c->bugs); free(c); } @@ -4822,6 +4823,11 @@ litest_log_handler_msgcapture(struct libinput *libinput, use_colors ? ANSI_NORMAL : "", message); + if (strstr(message, "kernel bug: ") || strstr(message, "client bug: ") || + strstr(message, "libinput bug: ") || strstr(message, "plugin bug: ")) { + capture->bugs = strv_append_strdup(capture->bugs, message); + } + switch (pri) { case LIBINPUT_LOG_PRIORITY_ERROR: capture->errors = strv_append_take(capture->errors, &message); diff --git a/test/litest.h b/test/litest.h index 4b310146..fdde0907 100644 --- a/test/litest.h +++ b/test/litest.h @@ -1361,6 +1361,7 @@ struct litest_logcapture { char **errors; char **infos; char **debugs; + char **bugs; }; void