if [ -z "$SAGE_LOCAL" ]; then
    echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
    echo >&2 "Maybe run 'sage -sh'?"
    exit 1
fi

cd src/tests/

# Currently (as of version 2.9.0), there is one Python test file:
# - test_dot2tex.py

passed=true
for file in test_*.py; do
    echo "############################################################"
    echo "spkg-check: Running $file..."
    echo "############################################################"
    sage-python23 $file || passed=false
done
echo
if $passed; then
    echo "dot2tex's test suite passed successfully."
else
    echo >&2 "Error(s) running dot2tex's test suite."
    exit 1
fi
