anki/tools/tests.sh
Damien Elmes 15b349e3a8 start port to python 3
unit tests pass and main screens of GUI load
2016-05-12 14:45:35 +10:00

27 lines
505 B
Bash
Executable File

#!/bin/bash
#
# Usage:
# tools/tests.sh # run all tests
# tools/tests.sh decks # test only test_decks.py
# coverage=1 tools/tests.sh # run with coverage test
BIN="$(cd "`dirname "$0"`"; pwd)"
export PYTHONPATH=${BIN}/..:${PYTHONPATH}
dir=.
if [ x$1 = x ]; then
lim="tests"
else
lim="tests.test_$1"
fi
if [ x$coverage != x ]; then
args="--with-coverage"
else
args=""
echo "Call with coverage=1 to run coverage tests"
fi
(cd $dir && nosetests3 -vs $lim $args --cover-package=anki)