#!/bin/sh

set -xe

cp -r tests "$AUTOPKGTEST_TMP/tests"

xvfb-run --auto-servernum dunst &
dunst_pid="$!"

cleanup() {
	kill -9 "$dunst_pid"
}
trap cleanup EXIT

for py in $(py3versions -s 2>/dev/null)
do
	cd "$AUTOPKGTEST_TMP" 

	echo "Testing with $py:"

	export TEST_SKIP_INTERACTIVE=1
	xvfb-run --auto-servernum \
		"$py" \
		-m unittest discover \
		-p '*_tests.py'
done
