# autopkgtest: run the upstream test suite against the INSTALLED binaries.
#
# The scenarios live upstream in tests/ (shipped in the source tree, which
# autopkgtest unpacks for the test).  The pyte tests honour $WPE_BIN and the
# X11 GUI tests honour $XWPE_BIN, so the same scenarios that run in-tree run
# here against /usr/bin/wpe and /usr/bin/xwpe.  Tests whose helper tool is
# absent (a given compiler, the ASan build) skip themselves via shutil.which,
# so the Test-Depends below stay modest.
#
# allow-stderr: the curses/Xft TUI writes escape sequences and diagnostics to
# stderr during a normal run.

# -- Console front-end (wpe), driven through a pyte VT100 --------------------
# locales-all: the pyte harness forces LC_ALL=en_US.UTF-8, so ncurses draws
# UTF-8 box/scrollbar glyphs (without it they fall back to the ASCII lqk ACS).
Test-Command: WPE_BIN=/usr/bin/wpe python3 -m pytest -q tests --ignore=tests/x11
Depends: @,
 python3-pyte,
 python3-pytest,
 locales-all,
 gcc,
 libc6-dev,
 g++,
 gfortran,
 fp-compiler,
 gdb,
 perl
Restrictions: allow-stderr

# -- X11 front-end (xwpe), driven headless under Xvfb + matchbox -------------
# Covers the Xft/Cairo rendering and the X11 key/mouse path that pyte cannot
# reach (e.g. the overlapping-window scrollbar-clip regression).  The suite
# starts its own Xvfb + matchbox; matchbox is REQUIRED (without a window
# manager xwpe's X11 size handling oscillates under bare Xvfb).  It skips
# cleanly if any X tool is missing, so it is safe on text-only CI.
# No core-font package is needed: xwpe falls back to Xft when the legacy
# "8x13" core font is absent (WeXterm.c), so it starts on a bare X server.
# locales-all: keep UTF-8 input/rendering deterministic in the GUI suite too.
Test-Command: XWPE_BIN=/usr/bin/xwpe python3 -m pytest -q tests/x11
Depends: @,
 python3-pytest,
 python3-pil,
 locales-all,
 gcc,
 libc6-dev,
 xvfb,
 matchbox-window-manager,
 xdotool,
 x11-apps,
 x11-xserver-utils,
 imagemagick
Restrictions: allow-stderr
