#!/bin/sh

set -e -u

py="$(py3versions -r 2>/dev/null)"

# Keep the test dir rather than copy to the root of $AUTOPKGTEST_TMP.
# Upstream scripts add the parent dir to the python path; this way
# one can be sure it will only find an (otherwise) empty dir there.
cp -va test "$AUTOPKGTEST_TMP"/
cd "$AUTOPKGTEST_TMP"/test

echo "Running testsuite with $py:"
for t in testlex.py testyacc.py testcpp.py; do
	echo "$t:"
	$py $t
done
# cleanup
/bin/sh cleanup.sh
