windowmaker-wl/tests/wl-smoke-test.sh

42 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
# tests/wl-smoke-test.sh
#
# Wayland backend smoke test for Window Maker.
# Uses the wlroots headless compositor (no display hardware needed).
#
# Currently verifies:
# 1. wmaker was built with Wayland backend support (symbol present)
# 2. wmaker links against wlroots
#
# This test grows as wl_backend vtable slots are implemented.
# When the compositor can open a headless display, tests for window
# management, EWMH properties, etc. will be added here in the same
# style as tests/x11-smoke-test.sh.
#
# Exit 0 = PASS, non-zero = FAIL.
set -e
# Use the real ELF binary (src/wmaker is a libtool wrapper script)
WMAKER=src/.libs/wmaker
[ -x "$WMAKER" ] || WMAKER=src/wmaker
die() {
echo "FAIL: $*" >&2
exit 1
}
# -- 1. Build check: wl_backend symbol must be present --------------------
[ -x "$WMAKER" ] || die "wmaker binary not found (tried src/.libs/wmaker and src/wmaker)"
nm "$WMAKER" 2>/dev/null | grep -q 'wl_backend' \
|| die "wl_backend symbol not found in $WMAKER (built without --enable-wayland-backend?)"
# -- 2. Link check: wlroots library must be linked in ---------------------
ldd "$WMAKER" 2>/dev/null | grep -qi 'wlroots\|libwlr' \
|| die "wmaker does not link against wlroots"
# -- Done (headless compositor tests to be added as vtable is implemented) --
echo "PASS (wl_backend symbol + wlroots link verified; full headless tests pending)"
exit 0