mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
Merge pull request #79 from olof/topic/make_test_py3
Default to always run unit tests for both py2 and 3
This commit is contained in:
commit
d970f9b05c
6
Makefile
6
Makefile
@ -25,6 +25,10 @@ export PYTHONPATH=lib
|
|||||||
# Disable convention, refactor, and TODO warnings
|
# Disable convention, refactor, and TODO warnings
|
||||||
PYLINT_OPTS = -d I -d C -d R -d W0511
|
PYLINT_OPTS = -d I -d C -d R -d W0511
|
||||||
|
|
||||||
|
# If you don't have a python3 environment (e.g. mock for py3 and
|
||||||
|
# nosetests3), you can remove the -3 flag.
|
||||||
|
TEST_OPTS = -2 -3
|
||||||
|
|
||||||
install: svtplay-dl $(MANFILE)
|
install: svtplay-dl $(MANFILE)
|
||||||
install -d $(DESTDIR)$(BINDIR)
|
install -d $(DESTDIR)$(BINDIR)
|
||||||
install -d $(DESTDIR)$(MANDIR)
|
install -d $(DESTDIR)$(MANDIR)
|
||||||
@ -44,7 +48,7 @@ svtplay-dl.1.gz: svtplay-dl.1
|
|||||||
gzip -9 svtplay-dl.1
|
gzip -9 svtplay-dl.1
|
||||||
|
|
||||||
test:
|
test:
|
||||||
sh run-tests.sh
|
sh run-tests.sh $(TEST_OPTS)
|
||||||
|
|
||||||
cover:
|
cover:
|
||||||
sh run-tests.sh -C
|
sh run-tests.sh -C
|
||||||
|
18
run-tests.sh
18
run-tests.sh
@ -9,12 +9,15 @@ die() {
|
|||||||
|
|
||||||
COVER_OPTS="--with-coverage --cover-package=svtplay_dl"
|
COVER_OPTS="--with-coverage --cover-package=svtplay_dl"
|
||||||
|
|
||||||
NOSETESTS=nosetests
|
NOSETESTS=
|
||||||
|
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
-2)
|
||||||
|
NOSETESTS="$NOSETESTS nosetests"
|
||||||
|
;;
|
||||||
-3)
|
-3)
|
||||||
NOSETESTS=nosetests3
|
NOSETESTS="$NOSETESTS nosetests3"
|
||||||
;;
|
;;
|
||||||
-c|--coverage)
|
-c|--coverage)
|
||||||
OPTS="$OPTS $COVER_OPTS"
|
OPTS="$OPTS $COVER_OPTS"
|
||||||
@ -35,4 +38,13 @@ while [ "$#" -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
PYTHONPATH=lib $NOSETESTS $OPTS
|
# 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 ]
|
||||||
|
Loading…
Reference in New Issue
Block a user