mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-07 04:58:21 +02:00
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: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1229>
This commit is contained in:
parent
8f132481b3
commit
b3cbc6053f
1 changed files with 11 additions and 2 deletions
|
|
@ -1327,11 +1327,14 @@ litest_log_handler(struct libinput *libinput,
|
||||||
color = ANSI_BRIGHT_GREEN;
|
color = ANSI_BRIGHT_GREEN;
|
||||||
else if (strstr(format, "gesture:"))
|
else if (strstr(format, "gesture:"))
|
||||||
color = ANSI_BRIGHT_YELLOW;
|
color = ANSI_BRIGHT_YELLOW;
|
||||||
|
else if (strstr(msg, "Plugin:"))
|
||||||
|
color = ANSI_BRIGHT_CYAN;
|
||||||
|
|
||||||
fprintf(stderr, "%slitest %s %s%s", color, priority, msg, color_reset);
|
fprintf(stderr, "%slitest %s %s%s", color, priority, msg, color_reset);
|
||||||
|
|
||||||
if (strstr(msg, "client bug: ") ||
|
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
|
/* valgrind is too slow and some of our offsets are too
|
||||||
* short, don't abort if during a valgrind run we get a
|
* short, don't abort if during a valgrind run we get a
|
||||||
* negative offset */
|
* negative offset */
|
||||||
|
|
@ -2169,7 +2172,13 @@ litest_bug_log_handler(struct libinput *libinput,
|
||||||
strstr(format, "kernel bug: "))
|
strstr(format, "kernel bug: "))
|
||||||
return;
|
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
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue