#!/bin/sh
set -eu

# do not run in the source tree, as we want to check the system-installed
# apport
TESTDIR=${AUTOPKGTEST_TMP:-/tmp}
mkdir -p "$TESTDIR"
cp -r pyproject.toml tests "$TESTDIR"
cd "$TESTDIR"

# clean up old crash reports
rm -rf /var/crash/*

# xvfb-run needed for dbus, dbus needed by test_python_crashes
xvfb-run dbus-launch python3 -m pytest -ra -v -m "not requires_internet" -k "not test_ui_gtk and not test_ui_kde" tests/system/
