summaryrefslogtreecommitdiff
path: root/tests/mv/mv-special-1
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-09-06 23:05:16 +0200
committerJim Meyering <jim@meyering.net>2007-09-15 08:40:38 +0200
commit33173e867aa45b7f88551551da51e36875582813 (patch)
tree8bbe0a98f0b3cbd0977e35b2b0d4f4cc432dc288 /tests/mv/mv-special-1
parentdf0beae1eb1318869d51a064aec8fdd401877cbf (diff)
downloadcoreutils-33173e867aa45b7f88551551da51e36875582813.tar.xz
Convert tests/mv, too.
* tests/other-fs-tmpdir: Before, all callers would exit 77 upon failure to find the required dir. Now, exit 77 in this script so callers don't have to. Adjust callers.
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