summaryrefslogtreecommitdiff
path: root/tests/rm/r-2
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rm/r-2')
-rwxr-xr-xtests/rm/r-228
1 files changed, 7 insertions, 21 deletions
diff --git a/tests/rm/r-2 b/tests/rm/r-2
index d4ad64e34..0e381ad40 100755
--- a/tests/rm/r-2
+++ b/tests/rm/r-2
@@ -1,7 +1,7 @@
#!/bin/sh
# Test "rm -r --verbose".
-# Copyright (C) 1997, 1998, 2000, 2002, 2004, 2006 Free Software
+# Copyright (C) 1997, 1998, 2000, 2002, 2004, 2006, 2007 Free Software
# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
@@ -18,38 +18,25 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if test "$VERBOSE" = yes; then
- rm --version
set -x
+ rm --version
fi
. $srcdir/../lang-default
+. $srcdir/../test-lib.sh
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && rm -rf $t0 || exit $?; exit $status' 0
-trap 'exit $?' 1 2 13 15
-
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp
-
-mkdir t t/a t/a/b || framework_failure=1
-> t/a/f || framework_failure=1
-> t/a/b/g || framework_failure=1
+mkdir t t/a t/a/b || framework_failure
+> t/a/f || framework_failure
+> t/a/b/g || framework_failure
# FIXME: if this fails, it's a framework failure
-cat <<\EOF | sort > t/E || framework_failure=1
+cat <<\EOF | sort > t/E || framework_failure
removed directory: `t/a'
removed directory: `t/a/b'
removed `t/a/b/g'
removed `t/a/f'
EOF
-if test $framework_failure = 1; then
- echo 'failure in testing framework'
- exit 1
-fi
-
# Note that both the expected output (above) and the actual output lines
# are sorted, because directory entries may be processed in arbitrary order.
fail=0
@@ -61,6 +48,5 @@ fi
# Compare expected and actual output.
cmp t/E t/O || fail=1
-test $fail = 1 && diff t/E t/O 2> /dev/null
(exit $fail); exit $fail