Skip to content
Newer
Older
100755 48 lines (42 sloc) 864 Bytes
e169744 Added runtests.sh to make test running easier
Jonas Obrist authored May 12, 2011
1 #!/bin/bash
2 find . -name '*.pyc' -delete
3
4 args=("$@")
5 num_args=${#args[@]}
6 index=0
7
8 with_coverage=false
29dab0c @KristianOellegaard pyzen for testing, automatically detects and adds it to INSTALLED_APPS
authored Sep 21, 2011
9 zen=false
bb7a2c8 Fixed small documentation markup bug (thanks to @Tribaal for pointing…
Jonas Obrist authored May 19, 2011
10 extra=""
e169744 Added runtests.sh to make test running easier
Jonas Obrist authored May 12, 2011
11
12 while [ "$index" -lt "$num_args" ]
13 do
14 case "${args[$index]}" in
15 "-c"|"--coverage")
16 with_coverage=true
17 ;;
bb7a2c8 Fixed small documentation markup bug (thanks to @Tribaal for pointing…
Jonas Obrist authored May 19, 2011
18 "-f"|"--failfast")
19 extra="$extra --failfast"
20 ;;
29dab0c @KristianOellegaard pyzen for testing, automatically detects and adds it to INSTALLED_APPS
authored Sep 21, 2011
21 "-z"|"--zen")
22 zen=true
23 ;;
e169744 Added runtests.sh to make test running easier
Jonas Obrist authored May 12, 2011
24 esac
25 let "index = $index + 1"
26 done
27
28 cd testproject
29
30 if [ $with_coverage == true ]; then
bb7a2c8 Fixed small documentation markup bug (thanks to @Tribaal for pointing…
Jonas Obrist authored May 19, 2011
31 coverage run manage.py test nani $extra
e169744 Added runtests.sh to make test running easier
Jonas Obrist authored May 12, 2011
32 statuscode=$?
33 coverage html
34 if which x-www-browser &> /dev/null; then
35 x-www-browser htmlcov/index.html
36 else
37 open htmlcov/index.html
38 fi
29dab0c @KristianOellegaard pyzen for testing, automatically detects and adds it to INSTALLED_APPS
authored Sep 21, 2011
39 elif [ $zen == true ]; then
40 python manage.py zen nani $extra
41 statuscode=$?
e169744 Added runtests.sh to make test running easier
Jonas Obrist authored May 12, 2011
42 else
bb7a2c8 Fixed small documentation markup bug (thanks to @Tribaal for pointing…
Jonas Obrist authored May 19, 2011
43 python manage.py test nani $extra
e169744 Added runtests.sh to make test running easier
Jonas Obrist authored May 12, 2011
44 statuscode=$?
45 fi
46 cd ..
bb7a2c8 Fixed small documentation markup bug (thanks to @Tribaal for pointing…
Jonas Obrist authored May 19, 2011
47 exit $statuscode
Something went wrong with that request. Please try again.