#!/bin/sh

set -e -u

# copy tests, test data and cert fixtures
cp --verbose --archive tests/ certs/ "$AUTOPKGTEST_TMP"
cd "$AUTOPKGTEST_TMP"

# create src/gnomint-cli symlink for tests that hardcode ../src/gnomint-cli
mkdir -p src
ln -s /usr/bin/gnomint-cli src/gnomint-cli

# set up writable HOME
export HOME="$AUTOPKGTEST_TMP/home"
mkdir -p "$HOME"

# run GUI test via upstream's headless Wayland helper
GNOMINT_BIN=/usr/bin/gnomint srcdir=tests tests/run-gui-test.sh python3 tests/check_gui_full.py
