forked from django-cms/django-filer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.sh
executable file
·59 lines (52 loc) · 1.39 KB
/
runtests.sh
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
#!/bin/bash
extra=""
django="13"
args=("$@")
num_args=${#args[@]}
index=0
while [ "$index" -lt "$num_args" ]
do
case "${args[$index]}" in
"-d"|"--django")
let "index = $index + 1"
django="${args[$index]}"
;;
"-h"|"--help")
echo ""
echo "usage:"
echo " runtests.sh"
echo " or runtests.sh [-d <version>|--django <version>] [test arguments]"
echo ""
echo "flags:"
echo " -d, --django <version> - run tests against a django version, options: 13 or 14"
echo ""
echo "test arguments:"
echo " any other argument is passed to setup.py test command for further evaluation"
exit 1
;;
*)
extra="$extra ${args[$index]}"
esac
let "index = $index + 1"
done
read -r -p "This will install dependencies and run the testsuite. Please make sure you are in a virtualenv! Continue? [Y/n]" response
case $response in
[yY]|[eE]|[sS]|[yY])
;;
*)
echo "cancelled"
exit
;;
esac
find . -name '*.pyc' -delete
if [ $django == "13" ]; then
export DJANGO="django>=1.3,<1.4"
fi
if [ $django == "14" ]; then
export DJANGO="django>=1.4,<1.5"
fi
if [ $django == "dev" ]; then
export DJANGO="-e git+git://github.com/django/django.git#egg=Django"
fi
./.travis_setup
python setup.py test $extra