mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 02:20:30 +01: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;
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue