debuggers.hg

annotate tools/tests/run_tests.sh @ 22848:6341fe0f4e5a

Added tag 4.1.0-rc2 for changeset 9dca60d88c63
author Keir Fraser <keir@xen.org>
date Tue Jan 25 14:06:55 2011 +0000 (2011-01-25)
parents 4fc6ff1e1141
children
rev   line source
keir@20155 1 #!/bin/bash
keir@20155 2 #
keir@20155 3 # This runs the available unit-tests with all different supported
keir@20155 4 # python versions.
keir@20155 5 #
keir@20155 6 # To run this this must be 'cd'ed to the tests directory.
keir@20155 7 #
keir@20155 8
keir@20155 9 ENABLE_UNSUPPORTED=0
keir@20155 10
keir@20155 11 function usage()
keir@20155 12 {
keir@20155 13 printf "Usage: %s: [-u]\n" $0
keir@20155 14 printf " -u: run test with unsupported python versions also\n"
keir@20155 15 }
keir@20155 16
keir@20155 17 function run_one_test()
keir@20155 18 {
keir@20155 19 PYTHON=$1
keir@20155 20 PYTHON_EXECUTABLE=`echo $PYTHON | tr -d "-"`
keir@20155 21 echo "+++ Running tests with $PYTHON"
keir@20155 22 export LD_LIBRARY_PATH=./regression/installed/$PYTHON/lib
keir@20155 23 ./regression/installed/$PYTHON/bin/$PYTHON_EXECUTABLE \
keir@20155 24 utests/run_all_tests.py
keir@20155 25 echo "--- Finished tests with $PYTHON"
keir@20155 26 }
keir@20155 27
keir@20155 28 function run_all_tests()
keir@20155 29 {
keir@20155 30 for PYTHON in $@;
keir@20155 31 do
keir@20155 32 run_one_test $PYTHON
keir@20155 33 done
keir@20155 34 }
keir@20155 35
keir@20155 36 while getopts u name
keir@20155 37 do
keir@20155 38 case $name in
keir@20155 39 h) usage; exit 0;;
keir@20155 40 u) ENABLE_UNSUPPORTED=1;;
keir@20155 41 ?) usage; exit 2;;
keir@20155 42 esac
keir@20155 43 done
keir@20155 44
keir@20155 45 # Build the different python versions
keir@20155 46 (cd regression && make -j4 runtime-environment)
keir@20155 47
keir@20155 48 # Supported: when an unit test fails this should be seen as an error
keir@20155 49 PYTHON_SUPPORTED="python-2.4 python-2.5 python-2.6"
keir@20155 50 # Unsupported: failure should be seen as a hint
keir@20155 51 PYTHON_UNSUPPORTED="python-3.1"
keir@20155 52
keir@20155 53 export PYTHONPATH=`echo $PWD/../python/build/lib.*`:$PWD
keir@20155 54
keir@20155 55 set -e
keir@20155 56 run_all_tests $PYTHON_SUPPORTED
keir@20155 57
keir@20155 58 if test $ENABLE_UNSUPPORTED -eq 1
keir@20155 59 then
keir@20155 60 run_all_tests $PYTHON_UNSUPPORTED
keir@20155 61 fi