#!/bin/sh
# Run python-pyevolve examples using the default Python version. Assumes
# $ADTTMP is set, see /usr/share/doc/autopkgtest/README.package-tests.rst.gz
#
# The following tests are skipped:
#   #12:    skipped because it takes ages to run
#   #21:    skipped because it needs python-visual
set -e

# Copy the examples to the $ADTTMP directory and run the tests from there.
cp -r examples/*.py "$ADTTMP"
cd "$ADTTMP"

for example in *.py
do
	echo "\n\n"
    echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
    echo "$example"
    echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"

    if [ "$example" = "pyevolve_ex12_tsp.py" ]
    then
        echo "Skipping test $example, takes too long"
        continue
	elif [ "$example" = "pyevolve_ex21_nqueens.py" ]
	then
		echo "Skipping test $example, requires python-visual"
		continue
    fi

    python $example
done
