Report failing modules

This commit is contained in:
Behdad Esfahbod 2015-04-21 11:06:56 -07:00
parent dfe0b85b9d
commit 801dcf21d6

View File

@ -26,14 +26,21 @@ test "x$FILTER" = "x" && FILTER=.
TESTS=`grep -r --include='*.py' -l -e doctest -e unittest * | grep -E "$FILTER"`
ret=0
FAILS=
for test in $TESTS; do
echo "Running tests in $test"
test=`echo "$test" | sed 's@[/\\]@.@g;s@[.]py$@@'`
if ! $PYTHON -m $test -v; then
ret=$((ret+1))
FAILS="$FAILS
$test"
fi
done
if test $ret != 0; then
echo "$ret source file(s) had tests failing" >&2
echo
echo "SUMMARY:"
if test $ret = 0; then
echo "All tests passed."
else
echo "$ret source file(s) had tests failing:$FAILS" >&2
fi
exit $ret