-
Notifications
You must be signed in to change notification settings - Fork 119
/
run-tests.sh
executable file
·50 lines (42 loc) · 749 Bytes
/
run-tests.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
#!/bin/sh
OPTS='--all-modules --with-doctest '
die() {
echo Error: "$@"
exit 1
}
COVER_OPTS="--with-coverage --cover-package=svtplay_dl"
NOSETESTS=
while [ "$#" -gt 0 ]; do
case $1 in
-2)
NOSETESTS="$NOSETESTS nosetests"
;;
-3)
NOSETESTS="$NOSETESTS nosetests3"
;;
-c|--coverage)
OPTS="$OPTS $COVER_OPTS"
;;
-C|--coverage-html)
OPTS="$OPTS $COVER_OPTS --cover-html"
;;
-v|--verbose)
OPTS="$OPTS --verbose"
;;
-*)
die "Unknown option: '$1'"
;;
*)
die "Unknown argument: '$1'"
;;
esac
shift
done
# Default to only run for python2
NOSETESTS=${NOSETESTS:-nosetests}
tests_ok=y
for nose in $NOSETESTS; do
PYTHONPATH=lib $nose $OPTS
[ $? -eq 0 ] || tests_ok=
done
[ "$tests_ok" = y ]