kbd/tests/check-data-keymaps.sh
Alexey Gladkov 9879410dc5
CI: Check all distributed keymaps for loadability
The new test verifies that all keymaps can be parsed and loaded into
the kernel without errors or warnings.

This test does not check the meaningfulness or correctness of the keymap
itself. This test checks the parser and the possibility of loading it
into the kernel.

Signed-off-by: Alexey Gladkov <legion@kernel.org>
2025-03-28 11:21:52 +01:00

36 lines
684 B
Bash
Executable File

#!/bin/sh -efu
TTY="${TTY:-/dev/tty60}"
workdir="$(readlink -f "$PWD")"
testdir="$(readlink -f "$0")"
testdir="${testdir%/*}"
topdir="${testdir%/*}"
cd "$topdir"
chmod 666 "$TTY"
kbd_mode -f -u -C "$TTY"
find "$PWD"/data/keymaps/i386/ \
\( -type f -a \! -regex '.*/include/.*' -a -name '*.map' \) \
-print |
sort -d -o "$workdir"/keymaps.list
export LOADKEYS_INCLUDE_PATH="$PWD/data/keymaps/**"
ret=0
while read -r keymap; do
if ! "$BUILDDIR"/src/loadkeys -C "$TTY" "$keymap" >/tmp/out 2>&1; then
{
printf '### Failed check: %s\n' "$keymap"
cat /tmp/out
} >&2
ret=1
fi
done < "$workdir"/keymaps.list
rm -f -- "$workdir"/keymaps.list /tmp/out ||:
exit $ret