PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/test_all_versions

https://bitbucket.org/bconstantin/django_polymorphic/
#! | 73 lines | 62 code | 11 blank | 0 comment | 0 complexity | 366ef370c38ba3e42f96d17c75402d3c MD5 | raw file
 1#!/bin/bash
 2
 3# this test script runs "./manage.py test" for
 4# all supported python versions (2.4, 2.5, 2.6)
 5# and all supported Django versions (1.1, 1.2, 1.3)
 6
 7# it needs symbolic links named "django1.1" and "django1.2" etc. in:
 8# libraries-local/django-versions
 9# which point to the respective django versions
10
11cd libraries-local
12rm -f django-orig
13if test -e django ; then mv django django-orig ; fi
14cd ..
15
16function restore_django {
17    echo "### restoring original libraries-local/django"
18    cd libraries-local
19    if test -e django-orig  ; then mv django-orig django ; fi
20    cd .
21}
22
23function test_python_version {
24    echo ; echo ; echo
25    echo "#########################################################################"
26    echo "### Testing Python $1, Django $2"
27    echo "#########################################################################"
28    echo
29
30    if which python$1 ; then
31        if ! python$1 manage.py test polymorphic; then
32            echo ERROR
33            restore_django
34            exit 10
35        fi
36        if ! ./test_dumpdata $1 ; then
37            echo ERROR
38            restore_django
39            exit 10
40        fi
41    else
42        echo
43        echo "### python $1 is not installed!"
44        echo
45    fi
46}
47
48function test_all_python_versions {
49    test_python_version 2.4 $1
50    test_python_version 2.5 $1
51    test_python_version 2.6 $1
52}
53
54function test_django_version {
55    if ! test -e libraries-local/django-versions/django$1 ; then
56        echo
57        echo "### django $1 is not installed!"
58        echo
59        return
60    fi
61    cd libraries-local
62    rm -f django
63    ln -s django-versions/django$1 django
64    cd ..
65    test_all_python_versions $1
66}
67
68test_django_version 1.1
69test_django_version 1.2
70test_django_version 1.3
71
72restore_django
73