AtlatestRepositorysigil-wm
1
#!/usr/bin/env bash2
set -euo pipefail3
cd -P "$(dirname "$0")/.."4
make -j2 all build/input-queue-gate.so5
test_runtime=$(mktemp -d /tmp/wm-input-queue.XXXXXX)6
trap 'rm -rf "$test_runtime"' EXIT7
chmod 700 "$test_runtime"8
export XDG_RUNTIME_DIR=$test_runtime WLR_BACKENDS=headless WLR_RENDERER=pixman WLR_HEADLESS_OUTPUTS=19
unset WAYLAND_DISPLAY DISPLAY10
export SIGIL_WM_LIBRARY=$PWD/build/input-queue-gate.so11
mkdir -p build/receipts/input-reply-queue12
for kind in 30 31 32; do13
log=build/receipts/input-reply-queue/kind-$kind.log14
WM_INPUT_MODE=overflow WM_INPUT_KIND=$kind timeout --foreground 15 "${SIGIL:-sigil}" -L src eval -f test/input-reply-queue.sgl > "$log" 2>&1 || { cat "$log"; exit 1; }15
cat "$log"16
grep -q "^INPUT_REPLY_QUEUE=PASS kind=$kind " "$log"17
! grep -q 'event handler failed' "$log"18
[[ $(grep -c '^INPUT_REPLY case=queue-full action=wait depth=1024 ' "$log") == 1 ]]19
done20
for kind in 30 31 32; do21
log=build/receipts/input-reply-queue/starting-$kind.log22
WM_INPUT_MODE=starting WM_INPUT_KIND=$kind timeout --foreground 15 "${SIGIL:-sigil}" -L src eval -f test/input-reply-queue.sgl > "$log" 2>&1 || { cat "$log"; exit 1; }23
cat "$log"24
grep -q "^INPUT_STARTING=PASS kind=$kind " "$log"25
! grep -q 'event handler failed' "$log"26
[[ $(grep -c '^INPUT_REPLY case=receiver-starting action=wait depth=0 ' "$log") == 1 ]]27
done28
for kind in 30 31 32; do29
log=build/receipts/input-reply-queue/shutdown-$kind.log30
WM_INPUT_MODE=shutdown WM_INPUT_KIND=$kind timeout --foreground 15 "${SIGIL:-sigil}" -L src eval -f test/input-reply-queue.sgl > "$log" 2>&1 || { cat "$log"; exit 1; }31
cat "$log"32
grep -q "^INPUT_SHUTDOWN=PASS kind=$kind" "$log"33
! grep -q 'event handler failed' "$log"34
[[ $(grep -c '^INPUT_REPLY case=receiver-stopped action=drop depth=0 ' "$log") == 1 ]]35
done