summaryrefslogtreecommitdiffstats
path: root/make-test
blob: cfc1db6a8925a5d2a07f782a972cb1a5058cd6fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

# Script to run nosetests under multiple versions of Python

export IPA_UNIT_TEST_MODE="cli_test"
versions="python2.4 python2.5 python2.6"

for name in $versions
do
    executable="/usr/bin/$name"
    if [[ -f $executable ]]; then
        echo "[ $name: Starting tests... ]"
        ((runs += 1))
        if $executable /usr/bin/nosetests -v #--with-doctest
        then
            echo "[ $name: Tests OK ]"
        else
            echo "[ $name: Tests FAILED ]"
            ((failures += 1))
        fi
    else
        echo "[ $name: Not found ]"
    fi
    echo ""
done

if [ $failures ]; then
    echo "[ Ran under $runs version(s); FAILED under $failures version(s) ]"
    echo "FAIL!"
    exit $failures
else
    echo "[ Ran under $runs version(s); all OK ]"
fi