tests: teach test_script the --failed option

Teach test_script the --failed option, which asks it to rerun the
tests that had previously failed.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debian
Theodore Ts'o 2016-06-07 10:47:20 -04:00
parent 3166e2e540
commit ded919125a
1 changed files with 30 additions and 10 deletions

View File

@ -5,24 +5,44 @@
case "$1" in
--valgrind)
export USE_VALGRIND="valgrind -q --sim-hints=lax-ioctls"
shift;
shift
;;
--valgrind-leakcheck)
export USE_VALGRIND="valgrind --sim-hints=lax-ioctls --leak-check=full --show-reachable=yes --log-file=/tmp/valgrind-%p.log"
shift;
shift
;;
--failed)
DO_FAILED=yes
shift
;;
esac
if test "$1"x = x ; then
TESTS=`ls -d $SRCDIR/[a-zA-Z]_*`
else
TESTS=
for i; do
case $i in
TESTS=
if test -n "$DO_FAILED"; then
FAILED=$(find . -maxdepth 1 -name \*.failed)
if test -z "$FAILED" ; then
echo " "
echo "No (more) failed tests!"
echo " "
fi
for fname in $FAILED ; do
TESTS="$TESTS $SRCDIR/${fname%%.failed}"
done
fi
for i; do
case $i in
[a-zA-Z]) TESTS="$TESTS $SRCDIR/${i}_*" ;;
*) TESTS="$TESTS $SRCDIR/$i" ;;
esac
done
esac
done
if test "$TESTS"x = x ; then
if test -n "DO_FAILED"; then
exit 0
fi
TESTS=`ls -d $SRCDIR/[a-zA-Z]_*`
fi
for test_dir in $TESTS; do