mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git
synced 2026-01-26 14:13:24 +00:00
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>
36 lines
684 B
Bash
Executable File
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
|