fonttools/run-tests.sh

29 lines
452 B
Bash
Raw Normal View History

2015-03-03 09:57:41 -08:00
#!/bin/sh
# exit if any subcommand return non-zero status
set -e
# Choose python version
if test "x$1" = x-3; then
PYTHON=python3
shift
elif test "x$1" = x-2; then
PYTHON=python2
shift
fi
test "x$PYTHON" = x && PYTHON=python
# Find tests
FILTERS=
2015-04-19 11:53:35 -07:00
for arg in "$@"; do
test "x$FILTERS" != x && FILTERS="$FILTERS or "
FILTERS="$FILTERS$arg"
done
# Run tests
if [ -z "$FILTERS" ]; then
$PYTHON -m pytest
2015-04-21 11:06:56 -07:00
else
$PYTHON -m pytest -k "$FILTERS"
fi