fonttools/run-tests.sh

21 lines
476 B
Bash
Raw Normal View History

2015-03-03 09:57:41 -08:00
#!/bin/sh
2015-04-07 18:26:13 -07:00
cd Lib
PYTHONPATH=".:$PYTHONPATH"
export PYTHONPATH
test "x$PYTHON" = x && PYTHON=python
FILTER=$1
test "x$FILTER" = x && FILTER=.
TESTS=`grep -r --include='*.py' -l -e doctest -e unittest * | grep "$FILTER"`
ret=0
for test in $TESTS; do
echo "Running tests in $test"
2015-04-07 18:26:13 -07:00
test=`echo "$test" | sed 's@[/\\]@.@g;s@[.]py$@@'`
if ! $PYTHON -m $test -v; then
ret=$((ret+1))
fi
done
if test $ret != 0; then
echo "$ret source file(s) had tests failing" >&2
fi
exit $ret