summaryrefslogtreecommitdiff
path: root/tests/mv/mv-special-1
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mv/mv-special-1')
-rwxr-xr-xtests/mv/mv-special-146
1 files changed, 15 insertions, 31 deletions
diff --git a/tests/mv/mv-special-1 b/tests/mv/mv-special-1
index cef419503..4d70e592b 100755
--- a/tests/mv/mv-special-1
+++ b/tests/mv/mv-special-1
@@ -1,7 +1,7 @@
#! /bin/sh
# Test "mv" with special files.
-# Copyright (C) 1998, 1999, 2000, 2002, 2004, 2005, 2006 Free Software
+# Copyright (C) 1998, 1999, 2000, 2002, 2004-2007 Free Software
# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
@@ -22,41 +22,25 @@ if test "$VERBOSE" = yes; then
mv --version
fi
-pwd=`pwd`
-tmp=mv-spec.$$
-trap 'status=$?; cd "$pwd" && exec 1>&2; rm -rf $tmp $other_partition_tmpdir && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
-
-. $srcdir/../other-fs-tmpdir
-. $srcdir/../envvar-check
-# Make sure we get English translations.
. $srcdir/../lang-default
-
-if test -z "$other_partition_tmpdir"; then
- (exit 77); exit 77
-fi
+. $srcdir/../test-lib.sh
+cleanup_() { rm -rf "$other_partition_tmpdir"; }
+. "$abs_top_srcdir/tests/other-fs-tmpdir"
null=mv-null
dir=mv-dir
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-rm -f $null || framework_failure=1
-mknod $null p || framework_failure=1
-test -p $null || framework_failure=1
-mkdir -p $dir/a/b/c $dir/d/e/f || framework_failure=1
-touch $dir/a/b/c/file1 $dir/d/e/f/file2 || framework_failure=1
+rm -f $null || framework_failure
+mknod $null p || framework_failure
+test -p $null || framework_failure
+mkdir -p $dir/a/b/c $dir/d/e/f || framework_failure
+touch $dir/a/b/c/file1 $dir/d/e/f/file2 || framework_failure
-if test $framework_failure = 1; then
- echo '********************************************'
- echo 'NOTICE: unable to create test prerequisites'
- echo '********************************************'
- # exit 77 here to indicate that we couldn't run the test.
- # At least running on SunOS 4.1.4, using a directory NFS mounted
- # from an OpenBSD system, the above mknod fails.
- (exit 77); exit 77
-fi
+# We used to...
+# exit 77 here to indicate that we couldn't run the test.
+# At least running on SunOS 4.1.4, using a directory NFS mounted
+# from an OpenBSD system, the above mknod fails.
+# It's not worth making an exception any more.
fail=0
mv --verbose $null $dir $other_partition_tmpdir > out || fail=1
@@ -87,7 +71,7 @@ cat <<EOF | sort > exp
\`$dir/d/e/f/file2' -> \`XXX/$dir/d/e/f/file2'
EOF
-cmp out2 exp || fail=1
+compare out2 exp || fail=1
# cd $other_partition_tmpdir
# ls -l -A -R $other_partition_tmpdir