xfstests: use value of FSTYP if defined externally
[xfstests-dev.git] / check
diff --git a/check b/check
index d18d640cade58fa9d5e79d37337de58e2ccea64f..268417c258eca9f1ce15dc8f11f70bf4eef21dde 100755 (executable)
--- a/check
+++ b/check
@@ -33,7 +33,6 @@ showme=false
 have_test_arg=false
 randomize=false
 here=`pwd`
-FSTYP=xfs
 xfile=""
 
 # start the initialisation work now
@@ -57,10 +56,12 @@ then
     exit 1
 fi
 
-# Autodetect fs type based on what's on $TEST_DEV
-if [ "$HOSTOS" == "Linux" ]; then
+# Autodetect fs type based on what's on $TEST_DEV unless it's been set
+# externally
+if [ -z "$FSTYP" -a "$HOSTOS" == "Linux" ]; then
     FSTYP=`blkid -c /dev/null -s TYPE -o value $TEST_DEV`
 fi
+FSTYP=${FSTYP:=xfs}
 export FSTYP
 
 SUPPORTED_TESTS="[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]"
@@ -73,6 +74,7 @@ usage()
 
 check options
     -nfs                test NFS
+    -tmpfs              test TMPFS
     -l                 line mode diff
     -udiff             show unified diff (default)
     -n                 show me, do not run tests
@@ -207,6 +209,7 @@ while [ $# -gt 0 ]; do
        -\? | -h | --help) usage ;;
 
        -nfs)   FSTYP=nfs ;;
+       -tmpfs) FSTYP=tmpfs ;;
 
        -g)     group=$2 ; shift ;
                GROUP_LIST="$GROUP_LIST $group"
@@ -260,12 +263,13 @@ if $have_test_arg; then
                        exit $status
                        ;;
                *)      test_dir=`dirname $1`
+                       test_dir=${test_dir#$SRC_DIR/*}
                        test_name=`basename $1`
                        group_file=$SRC_DIR/$test_dir/group
 
                        if egrep "^$test_name" $group_file >/dev/null ; then
                                # in group file ... OK
-                               echo $SRC_DIR/$1 >>$tmp.arglist
+                               echo $SRC_DIR/$test_dir/$test_name >>$tmp.arglist
                        else
                                # oops
                                echo "$1 - unknown test, ignored"
@@ -485,6 +489,10 @@ do
                echo " - no qualified output"
                err=true
            else
+
+               # coreutils 8.16+ changed quote formats in error messages from
+               # `foo' to 'foo'. Filter old versions to match the new version.
+               sed -i "s/\`/\'/g" $tmp.out
                if diff $seq.out $tmp.out >/dev/null 2>&1
                then
                    if $err
@@ -503,11 +511,11 @@ do
                                cat
                        else
                                head -n "$DIFF_LENGTH"
+                               echo "..."
+                               echo "(Run '$diff $seq.out $seqres.out.bad'" \
+                                       " to see the entire diff)"
                        fi; } | \
                        sed -e 's/^\(.\)/    \1/'
-                   echo "     ..."
-                   echo "     (Run '$diff $seq.out $seqres.out.bad' to see the" \
-                        "entire diff)"
                    err=true
                fi
            fi