diff --git a/tests/wl-smoke-test.sh b/tests/wl-smoke-test.sh index f32fa52..a5c62b3 100755 --- a/tests/wl-smoke-test.sh +++ b/tests/wl-smoke-test.sh @@ -34,6 +34,8 @@ # wManageWindow; wWindowFocus/Unfocus guarded on frame!=NULL # 16. (Phase 50) client_get_pid returns real PID via wl_client_get_credentials; # logged as pid= in wManageWindow succeeded line +# 17. (Phase 51) two simultaneous clients both managed and unmanaged cleanly; +# compositor survives multi-client scenario # # This test grows as wl_backend vtable slots are implemented. # @@ -196,6 +198,26 @@ if command -v weston-simple-shm >/dev/null 2>&1; then [ -n "$PID" ] && [ "$PID" -gt 0 ] 2>/dev/null \ || die "compositor did not log a valid pid= for managed toplevel" echo " pid check: client PID=$PID retrieved via wl_client_get_credentials" + + # -- 15. Phase 51: two simultaneous clients both managed -------------- + # + # Launch two weston-simple-shm processes in parallel (2s and 3s). + # Both should be managed and focused; both should unmap cleanly. + (WAYLAND_DISPLAY="$WL_SOCK" timeout 2s weston-simple-shm 2>/dev/null) & + C1=$! + (WAYLAND_DISPLAY="$WL_SOCK" timeout 3s weston-simple-shm 2>/dev/null) & + C2=$! + wait "$C1" || true + wait "$C2" || true + sleep 0.5 # let compositor log unmap events + + kill -0 "$WM_PID" 2>/dev/null \ + || die "compositor crashed during two-client test" + + MANAGED_COUNT=$(grep -c 'wManageWindow succeeded' /tmp/wl-smoke-stderr || true) + [ "$MANAGED_COUNT" -ge 3 ] \ + || die "expected >=3 wManageWindow succeeded entries (1+2 clients), got $MANAGED_COUNT" + echo " multi-client check: $MANAGED_COUNT toplevels managed across both sessions" else echo " client check: skipped (weston-simple-shm not installed)" fi