3 # Test script for e2fsck
11 export USE_VALGRIND="valgrind -q --sim-hints=lax-ioctls"
15 export USE_VALGRIND="valgrind --sim-hints=lax-ioctls --leak-check=full --show-reachable=yes --log-file=/tmp/valgrind-%p.log"
20 if test "$1"x = x ; then
21 TESTS=`ls -d $SRCDIR/[a-zA-Z]_* | $EGREP -v "\.failed|\.new"`
27 *.failed|*.new) continue ;;
28 [a-zA-Z]) TESTS="$TESTS $SRCDIR/${i}_*" ;;
29 *) TESTS="$TESTS $SRCDIR/$i" ;;
36 if test "$TEST_CONFIG"x = x; then
37 TEST_CONFIG=$SRCDIR/test_config
44 for test_dir in $TESTS
46 test_name=`echo $test_dir | sed -e 's;.*/;;'`
47 if [ -f $test_dir ] ; then
50 if [ ! -d $test_dir ] ; then
51 echo "The test '$test_name' does not exist."
54 if [ -z "`ls $test_dir`" ]; then
57 if [ -f $test_dir/name ]; then
58 test_description=`cat $test_dir/name`
59 printf "%s: %s: " "$test_name" "$test_description"
61 printf "%s: " "$test_name"
63 if [ -f $test_dir/script ]; then
66 test_base=`echo $test_name | sed -e 's/_.*//'`
67 default_script=$SRCDIR/defaults/${test_base}_script
68 if [ -f $default_script ]; then
69 . $SRCDIR/defaults/${test_base}_script
71 echo "Missing test script!"
76 num_ok=`ls *.ok 2>/dev/null | wc -l`
77 num_failed=`ls *.failed 2>/dev/null | wc -l`
79 echo "$num_ok tests succeeded $num_failed tests failed"
81 test "$num_failed" -eq 0 && exit 0
83 echo -n "Tests failed: "
84 for fname in $(ls *.failed); do
85 echo -n "${fname%%.failed} "