#!/bin/sh
# Run python3-tpot tests using all requested Python 3 versions. Assumes
# $AUTOPKGTEST_TMP is set, see /usr/share/doc/autopkgtest/README.package-tests.rst.gz
set -efu

SOURCE_BASE="$PWD"
for interpreter in `py3versions -r 2>/dev/null`
do
	echo "=== Testing with $interpreter ==="
	# We just copy the entire test suite to the $AUTOPKGTEST_TMP directory and
	# run the tests from within there.
	cd "$SOURCE_BASE"
	mkdir "$AUTOPKGTEST_TMP"/$interpreter
	cp -r tests "$AUTOPKGTEST_TMP"/$interpreter/
	cd "$AUTOPKGTEST_TMP"/$interpreter
	sed -i -e "s/python -m/$interpreter -m/" tests/driver_tests.py
	$interpreter -m nose -v \
		--ignore-files nn_tests.py \
		--exclude test_log_file_verbose_3 \
		--exclude test_sample_weight_func
done
