From 6268ba1c77e248ea7ef829ec6d3ffedabe17086e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 19 Oct 2020 11:51:27 +1000 Subject: 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. --- test/xkeyboard-config-test.py.in | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') 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) -- cgit v1.2.1