#!/bin/sh
# autopkgtest check: Run "make check" test programs using cups-browsed
# installed on the system.
# (C) 2012 Canonical Ltd.
# (C) 2023 Till Kamppeter
# Authors: Martin Pitt, Till Kamppeter

set -eux

package=cups-browsed
WORKDIR="$(mktemp -d)"
export HOME="$WORKDIR"
export XDG_RUNTIME_DIR="$WORKDIR"
trap 'cd /; rm -rf "$WORKDIR"' 0 INT QUIT ABRT PIPE TERM

cd "$WORKDIR"

# Copy test image files into right place
cp /usr/share/cups-browsed-tests/* .

# Run the test script
/usr/bin/run-tests.sh 3 no
echo "run test program 'run-tests.sh' on system's $package: OK"
