AtlatestRepositorysigil-wm
1
#!/usr/bin/env bash2
set -euo pipefail3
cd "$(dirname "$0")/.."4
if [[ ${1:-} != --inside ]]; then5
exec guix time-machine -C channels.scm -- shell -m draw-manifest.scm -- bash scripts/test-nested --inside6
fi7
make -j2 all build/pixel-client build/readback8
parent_runtime=$(mktemp -d /tmp/sigil-wm-parent.XXXXXX)9
chmod 700 "$parent_runtime"10
mkdir -p build/receipts11
parent_pid=12
cleanup() {13
[[ -z $parent_pid ]] || kill "$parent_pid" 2>/dev/null || true14
[[ -z $parent_pid ]] || wait "$parent_pid" 2>/dev/null || true15
rm -rf "$parent_runtime"16
}17
trap cleanup EXIT18
XDG_RUNTIME_DIR=$parent_runtime WLR_BACKENDS=headless WLR_RENDERER=pixman WLR_HEADLESS_OUTPUTS=1 SIGIL_WM_REPL="$parent_runtime/repl" \19
timeout 300 bash scripts/run-sigil -L src -L examples -L .deps eval -f examples/tiling.sgl > build/receipts/parent.log 2>&1 &20
parent_pid=$!21
for ((attempt=0; attempt<200; attempt++)); do22
grep -q '^WAYLAND_SOCKET=' build/receipts/parent.log && break23
sleep 0.0524
done25
grep -q '^WAYLAND_SOCKET=' build/receipts/parent.log26
export SIGIL_WM_TEST_PARENT_DISPLAY="$parent_runtime/$(sed -n 's/^WAYLAND_SOCKET=//p' build/receipts/parent.log | head -1)"27
export SIGIL_WM_TEST_PARENT_REPL="$parent_runtime/repl"28
export SIGIL_WM_TEST_BACKEND=wayland29
bash scripts/test-examples --inside30
bash scripts/msg "$SIGIL_WM_TEST_PARENT_REPL" '(stop-host! host)'31
wait "$parent_pid"32
parent_pid=33
echo 'NESTED=PASS'