summaryrefslogtreecommitdiff
path: root/tests/rm/ir-1
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rm/ir-1')
-rwxr-xr-xtests/rm/ir-134
1 files changed, 12 insertions, 22 deletions
diff --git a/tests/rm/ir-1 b/tests/rm/ir-1
index 6bd278d47..c3af0acc1 100755
--- a/tests/rm/ir-1
+++ b/tests/rm/ir-1
@@ -1,7 +1,7 @@
#!/bin/sh
# Test "rm -ir".
-# Copyright (C) 1997, 1998, 2002, 2004, 2006 Free Software Foundation,
+# Copyright (C) 1997, 1998, 2002, 2004, 2006, 2007 Free Software Foundation,
# Inc.
# This program is free software: you can redistribute it and/or modify
@@ -24,21 +24,13 @@ if test "$VERBOSE" = yes; then
rm --version
fi
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
+. $srcdir/../test-lib.sh
-test_failure=0
-mkdir -p $tmp $tmp/a $tmp/b $tmp/c || test_failure=1
-> $tmp/a/a || test_failure=1
-> $tmp/b/bb || test_failure=1
-> $tmp/c/cc || test_failure=1
-
-if test $test_failure = 1; then
- echo 'failure in testing framework'
- exit 1
-fi
+t=t
+mkdir -p $t $t/a $t/b $t/c || framework_failure
+> $t/a/a || framework_failure
+> $t/b/bb || framework_failure
+> $t/c/cc || framework_failure
cat <<EOF > $test.I
y
@@ -58,17 +50,15 @@ EOF
# determine which one was removed based on order of dir entries.
# This is a good argument for switching to a dejagnu-style test suite.
fail=0
-rm --verbose -i -r $tmp < $test.I > /dev/null 2>&1 || fail=1
+rm --verbose -i -r $t < $test.I > /dev/null 2>&1 || fail=1
-# $tmp should not have been removed.
-test -d $tmp || fail=1
+# $t should not have been removed.
+test -d $t || fail=1
# There should be only one directory left.
-case `echo $tmp/*` in
- $tmp/[abc]) ;;
+case `echo $t/*` in
+ $t/[abc]) ;;
*) fail=1 ;;
esac
-rm -rf $tmp $test.I
-
(exit $fail); exit $fail