forked from awesto/django-shop
-
Notifications
You must be signed in to change notification settings - Fork 1
/
runtests.sh
executable file
·60 lines (52 loc) · 852 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
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
args=("$@")
num_args=${#args[@]}
index=0
suite='shop addressmodel'
coverage=false
documentation=false
ci=false
while [ "$index" -lt "$num_args" ]
do
case "${args[$index]}" in
"--with-docs")
documentation=true
;;
"--with-coverage")
coverage=true
;;
"--ci")
ci=true
;;
*)
suite="shop.${args[$index]}"
esac
let "index = $index + 1"
done
if [ $ci == true ]; then
pushd .
cd tests/testapp
coverage run manage.py test $suite
coverage xml
popd
elif [ $coverage == true ]; then
pushd .
cd tests/testapp
coverage run manage.py test $suite
coverage html
#x-www-browser htmlcov/index.html
popd
else
# the default case...
pushd .
cd tests/testapp
python manage.py test $suite
popd
fi
if [ $documentation == true ]; then
pushd .
cd docs/
make html
x-www-browser _build/html/index.html
popd
fi