summaryrefslogtreecommitdiff
path: root/test/xkeyboard-config-test.py.in
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-10-19 11:51:27 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2020-10-20 11:02:03 +1000
commit6268ba1c77e248ea7ef829ec6d3ffedabe17086e (patch)
tree9afa5411582612959820c76188d98e204e4a627c /test/xkeyboard-config-test.py.in
parentafdc9ceee707cba3164f892fc3309140480c9b82 (diff)
downloadxorg-lib-libxkbcommon-6268ba1c77e248ea7ef829ec6d3ffedabe17086e.tar.gz
test: catch unrecognized keysyms in the xkeyboard-config test
Prompted by https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/127 We run the keymap tool with --verbose which will print the messages from the compiler to the log file as well. And then we can search for the warning regarding an unrecognized keysym and fail our test based on that.
Diffstat (limited to 'test/xkeyboard-config-test.py.in')
-rwxr-xr-xtest/xkeyboard-config-test.py.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/xkeyboard-config-test.py.in b/test/xkeyboard-config-test.py.in
index ed37d7e..001f1b6 100755
--- a/test/xkeyboard-config-test.py.in
+++ b/test/xkeyboard-config-test.py.in
@@ -42,6 +42,7 @@ def xkbcommontool(rmlvo):
o = rmlvo.get('o', None)
args = [
'xkbcli-compile-keymap', # this is run in the builddir
+ '--verbose',
'--rules', r,
'--model', m,
'--layout', l,
@@ -61,6 +62,12 @@ def xkbcommontool(rmlvo):
universal_newlines=True)
if verbose:
print(output, file=out)
+
+ if "unrecognized keysym" in output:
+ for line in output.split('\n'):
+ if "unrecognized keysym" in line:
+ print('ERROR: {}'.format(line))
+ success = False
except subprocess.CalledProcessError as err:
print('ERROR: Failed to compile: {}'.format(' '.join(args)), file=out)
print(err.output, file=out)