~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/tests/run_tests.sh

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

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