summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-03-28 11:48:52 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-03-28 18:56:38 +1000
commit24445374b296072ce70699cf96f5b8371c97c729 (patch)
tree6fef5bce3b90f4c69c0fb2e9219c3694f76470f6 /test
parent6ab2999be9033189f9a5f5d14b66557688020f42 (diff)
test: highlight the various state machines with colors
Makes visual identification easier Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r--test/litest.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/litest.c b/test/litest.c
index acba871..c7869e8 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -800,7 +800,7 @@ litest_log_handler(struct libinput *libinput,
break;
case LIBINPUT_LOG_PRIORITY_ERROR:
priority = "error";
- color = ANSI_RED;
+ color = ANSI_BRIGHT_RED;
break;
case LIBINPUT_LOG_PRIORITY_DEBUG:
priority = "debug";
@@ -815,6 +815,25 @@ litest_log_handler(struct libinput *libinput,
if (had_newline)
fprintf(stderr, "%slitest %s ", color, priority);
+
+ if (strstr(format, "tap state:"))
+ color = ANSI_BLUE;
+ else if (strstr(format, "thumb state:"))
+ color = ANSI_YELLOW;
+ else if (strstr(format, "button state:"))
+ color = ANSI_MAGENTA;
+ else if (strstr(format, "touch-size:") ||
+ strstr(format, "pressure:"))
+ color = ANSI_GREEN;
+ else if (strstr(format, "palm:") ||
+ strstr(format, "thumb:"))
+ color = ANSI_CYAN;
+ else if (strstr(format, "edge state:"))
+ color = ANSI_BRIGHT_GREEN;
+
+ if (is_tty)
+ fprintf(stderr, "%s ", color);
+
vfprintf(stderr, format, args);
had_newline = strlen(format) >= 1 &&
format[strlen(format) - 1] == '\n';