2013-03-02 00:03:48 +01:00
|
|
|
#!/bin/sh
|
2013-03-12 19:47:19 +01:00
|
|
|
|
2014-01-06 22:12:56 +01:00
|
|
|
OPTS='--all-modules --with-doctest '
|
2013-03-12 19:47:19 +01:00
|
|
|
|
|
|
|
die() {
|
|
|
|
echo Error: "$@"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2013-04-21 10:44:50 +02:00
|
|
|
COVER_OPTS="--with-coverage --cover-package=svtplay_dl"
|
|
|
|
|
2014-03-19 23:16:00 +01:00
|
|
|
NOSETESTS=
|
2014-01-05 19:12:08 +01:00
|
|
|
|
2013-03-12 19:47:19 +01:00
|
|
|
while [ "$#" -gt 0 ]; do
|
|
|
|
case $1 in
|
2014-03-19 23:16:00 +01:00
|
|
|
-2)
|
|
|
|
NOSETESTS="$NOSETESTS nosetests"
|
|
|
|
;;
|
2014-01-05 19:12:08 +01:00
|
|
|
-3)
|
2014-03-19 23:16:00 +01:00
|
|
|
NOSETESTS="$NOSETESTS nosetests3"
|
2014-01-05 19:12:08 +01:00
|
|
|
;;
|
2013-03-12 19:47:19 +01:00
|
|
|
-c|--coverage)
|
2013-04-21 10:44:50 +02:00
|
|
|
OPTS="$OPTS $COVER_OPTS"
|
2013-03-12 19:47:19 +01:00
|
|
|
;;
|
2013-04-21 10:45:12 +02:00
|
|
|
-C|--coverage-html)
|
|
|
|
OPTS="$OPTS $COVER_OPTS --cover-html"
|
|
|
|
;;
|
2013-03-12 20:31:42 +01:00
|
|
|
-v|--verbose)
|
|
|
|
OPTS="$OPTS --verbose"
|
|
|
|
;;
|
2013-03-12 19:47:19 +01:00
|
|
|
-*)
|
|
|
|
die "Unknown option: '$1'"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
die "Unknown argument: '$1'"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2014-03-19 23:16:00 +01:00
|
|
|
# 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 ]
|