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
|
#!/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}
# favour nosetests3 if available
nose=nosetests
if which nosetests3 >/dev/null 2>&1; then
nose=nosetests3
fi
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 && $nose -vs --processes=16 --process-timeout=300 $lim $args --cover-package=anki)
|