test: rework the output for the xkeyboard-config layout tester
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 15 Apr 2021 00:39:05 +0000 (10:39 +1000)
committerRan Benita <ran@unusedvar.com>
Tue, 20 Apr 2021 07:30:17 +0000 (10:30 +0300)
commit1cae250052114250b641cbd55d1b9861e7f9084a
tree12751eebf831b114e205444f6a5f286aa2447b08
parent44e8d4b04484270df15c9615ceb1eb7451f6d0f7
test: rework the output for the xkeyboard-config layout tester

The previous output is largely unusable. The result in the CI test runs is a 6GB
file with every compiled keymap in it and while we can grep for ERROR, it's not
particularly useful.

Let's change this and print out YAML instead - that can be machine-processed.
This patch adds a new parent class that prints itself in YAML format,
the tool invocations are child classes of that class. The result looks like this:

Example output:
- rmlvo: ["evdev", "pc105", "us", "haw", "grp:rwin_switch"]
  cmd: "xkbcli-compile-keymap --verbose --rules evdev --model pc105 --layout us --variant haw --options grp:rwin_switch"
  status: 0
- rmlvo: ["evdev", "pc105", "us", "foo", ""]
  cmd: "xkbcli-compile-keymap --verbose --rules evdev --model pc105 --layout us --variant foo"
  status: 1
  error: "failed to compile keymap"

Special status codes are: 99 for "unrecognized keysym" and 90 for "Cannot open
display" in the setxkbmap case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/xkeyboard-config-test.py.in