runtests.sh 614 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. #
  3. # This script runs all the t_*.py tests in the current directory,
  4. # preparing PYTHONPATH to use the most recent local build
  5. #
  6. # Run with -v option for verbose
  7. #
  8. set -e
  9. : ${PYTHON:="python"}
  10. plat_specifier=`$PYTHON -c 'import sys,distutils.util; \
  11. print(distutils.util.get_platform()+"-"+sys.version[0:3])'`
  12. failed=
  13. for test in t_*.py; do
  14. echo "$test:"
  15. PYTHONPATH="../build/lib.$plat_specifier" $PYTHON "$test" "$@" ||
  16. failed="$failed $test"
  17. done
  18. if test -n "$failed"; then
  19. echo "Tests that failed:$failed" >&2
  20. exit 1
  21. else
  22. echo "All tests passed. Yay."
  23. exit 0
  24. fi