2012-12-21 08:51:59 +01:00
|
|
|
#!/bin/bash
|
2012-12-21 12:17:31 +01:00
|
|
|
#
|
|
|
|
# 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
|
2012-12-21 08:51:59 +01:00
|
|
|
|
2019-12-16 12:04:32 +01:00
|
|
|
set -e
|
|
|
|
|
2015-12-02 08:02:42 +01:00
|
|
|
BIN="$(cd "`dirname "$0"`"; pwd)"
|
|
|
|
export PYTHONPATH=${BIN}/..:${PYTHONPATH}
|
|
|
|
|
2019-12-24 10:16:09 +01:00
|
|
|
nose="python -m nose2 --plugin=nose2.plugins.mp -N 16"
|
2018-10-04 09:56:50 +02:00
|
|
|
|
2012-12-21 12:17:31 +01:00
|
|
|
dir=.
|
|
|
|
|
|
|
|
if [ x$1 = x ]; then
|
|
|
|
lim="tests"
|
2012-12-21 08:51:59 +01:00
|
|
|
else
|
2012-12-21 12:17:31 +01:00
|
|
|
lim="tests.test_$1"
|
2012-12-21 08:51:59 +01:00
|
|
|
fi
|
|
|
|
|
2019-12-24 10:16:09 +01:00
|
|
|
(cd $dir && $nose $lim $args)
|