Whamcloud - gitweb
dupfs.c (ext2fs_dup_handle): Make sure the new filesystem handle
[tools/e2fsprogs.git] / tests / test_script.in
index 38a0f45..51cb099 100644 (file)
@@ -4,28 +4,42 @@
 #
 
 if test "$1"x = x ; then
-  TESTS=$SRCDIR/[a-zA-Z]_*
+  TESTS=`ls -d $SRCDIR/[a-zA-Z]_* | grep -E -v "\.failed|\.new"`
 else
   TESTS=
   for i 
   do
-    TESTS="$TESTS $SRCDIR/$i"
+    case $i in
+       *.failed|*.new) continue ;;
+       [a-zA-Z])       TESTS="$TESTS $SRCDIR/${i}_*" ;;
+       *)              TESTS="$TESTS $SRCDIR/$i" ;;
+    esac
   done
 fi
 
 cmd_dir=$SRCDIR
-TMPFILE=./test.img
 
-. $SRCDIR/test_config
+if test "$TEST_CONFIG"x = x; then
+       TEST_CONFIG=$SRCDIR/test_config
+fi
+
+. $TEST_CONFIG
 
 for test_dir in $TESTS
 do
        test_name=`echo $test_dir | sed -e 's;.*/;;'`
+       if [ -f $test_dir ] ; then
+           continue;
+       fi
+       if [ ! -d $test_dir ] ; then
+               echo "The test '$test_name' does not exist."
+               continue;
+       fi
        if [ -f $test_dir/name ]; then
                test_description=`cat $test_dir/name`
-               echo -n "$test_name: $test_description: "
+               printf "%s: %s: " "$test_name" "$test_description"
        else
-               echo -n "$test_name: "
+               printf "%s: " "$test_name"
        fi
        if [ -f $test_dir/script ]; then
                . $test_dir/script