#!/bin/sh

set -e

if [ -z "$AUTOPKGTEST_TMP" -o ! -d "$AUTOPKGTEST_TMP" ]; then
   echo '$AUTOPKGTEST_TMP not set or not pointing to a directory' 1>&2
   exit 1
fi

cp -pv test "$AUTOPKGTEST_TMP"
cd "$AUTOPKGTEST_TMP"
sed -e 's:./xrootconsole:/usr/bin/xrootconsole:' -i test
xvfb-run ./test
