forked from bconstantin/django_polymorphic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_all_versions
executable file
·73 lines (62 loc) · 1.74 KB
/
test_all_versions
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# this test script runs "./manage.py test" for
# all supported python versions (2.4, 2.5, 2.6)
# and all supported Django versions (1.1, 1.2, 1.3)
# it needs symbolic links named "django1.1" and "django1.2" etc. in:
# libraries-local/django-versions
# which point to the respective django versions
cd libraries-local
rm -f django-orig
if test -e django ; then mv django django-orig ; fi
cd ..
function restore_django {
echo "### restoring original libraries-local/django"
cd libraries-local
if test -e django-orig ; then mv django-orig django ; fi
cd .
}
function test_python_version {
echo ; echo ; echo
echo "#########################################################################"
echo "### Testing Python $1, Django $2"
echo "#########################################################################"
echo
if which python$1 ; then
if ! python$1 manage.py test polymorphic; then
echo ERROR
restore_django
exit 10
fi
if ! ./test_dumpdata $1 ; then
echo ERROR
restore_django
exit 10
fi
else
echo
echo "### python $1 is not installed!"
echo
fi
}
function test_all_python_versions {
test_python_version 2.4 $1
test_python_version 2.5 $1
test_python_version 2.6 $1
}
function test_django_version {
if ! test -e libraries-local/django-versions/django$1 ; then
echo
echo "### django $1 is not installed!"
echo
return
fi
cd libraries-local
rm -f django
ln -s django-versions/django$1 django
cd ..
test_all_python_versions $1
}
test_django_version 1.1
test_django_version 1.2
test_django_version 1.3
restore_django