forked from KristianOellegaard/django-hvad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntests.sh
executable file
·47 lines (42 loc) · 864 Bytes
/
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
#!/bin/bash
find . -name '*.pyc' -delete
args=("$@")
num_args=${#args[@]}
index=0
with_coverage=false
zen=false
extra=""
while [ "$index" -lt "$num_args" ]
do
case "${args[$index]}" in
"-c"|"--coverage")
with_coverage=true
;;
"-f"|"--failfast")
extra="$extra --failfast"
;;
"-z"|"--zen")
zen=true
;;
esac
let "index = $index + 1"
done
cd testproject
if [ $with_coverage == true ]; then
coverage run manage.py test nani $extra
statuscode=$?
coverage html
if which x-www-browser &> /dev/null; then
x-www-browser htmlcov/index.html
else
open htmlcov/index.html
fi
elif [ $zen == true ]; then
python manage.py zen nani $extra
statuscode=$?
else
python manage.py test nani $extra
statuscode=$?
fi
cd ..
exit $statuscode