3 # Test script for e2fsck
11 export USE_VALGRIND="valgrind -q --weird-hacks=lax-ioctls"
15 if test "$1"x = x ; then
16 TESTS=`ls -d $SRCDIR/[a-zA-Z]_* | $EGREP -v "\.failed|\.new"`
22 *.failed|*.new) continue ;;
23 [a-zA-Z]) TESTS="$TESTS $SRCDIR/${i}_*" ;;
24 *) TESTS="$TESTS $SRCDIR/$i" ;;
31 if test "$TEST_CONFIG"x = x; then
32 TEST_CONFIG=$SRCDIR/test_config
37 for test_dir in $TESTS
39 test_name=`echo $test_dir | sed -e 's;.*/;;'`
40 if [ -f $test_dir ] ; then
43 if [ ! -d $test_dir ] ; then
44 echo "The test '$test_name' does not exist."
47 if [ -z "`ls $test_dir`" ]; then
50 if [ -f $test_dir/name ]; then
51 test_description=`cat $test_dir/name`
52 printf "%s: %s: " "$test_name" "$test_description"
54 printf "%s: " "$test_name"
56 if [ -f $test_dir/script ]; then
59 test_base=`echo $test_name | sed -e 's/_.*//'`
60 default_script=$SRCDIR/defaults/${test_base}_script
61 if [ -f $default_script ]; then
62 . $SRCDIR/defaults/${test_base}_script
64 echo "Missing test script!"
69 num_ok=`ls *.ok 2>/dev/null | wc -l`
70 num_failed=`ls *.failed 2>/dev/null | wc -l`
72 echo "$num_ok tests succeeded $num_failed tests failed"
74 test "$num_failed" -eq 0 || exit 1