summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-04-19 22:39:05 +0000
committerJim Meyering <jim@meyering.net>2002-04-19 22:39:05 +0000
commit92d76e1e92f98b2aadacdd668ebd9ce932fe7d82 (patch)
tree44baff5b91b7157aa08d35f6935dc917776c195f /tests
parentdc2f3bc5e45e5a41763b1ad6a72e6788ab3eaf3a (diff)
downloadcoreutils-92d76e1e92f98b2aadacdd668ebd9ce932fe7d82.tar.xz
upgrade to use better framework
Diffstat (limited to 'tests')
-rwxr-xr-xtests/rm/r-140
1 files changed, 19 insertions, 21 deletions
diff --git a/tests/rm/r-1 b/tests/rm/r-1
index 53e3f4809..8f46b3c00 100755
--- a/tests/rm/r-1
+++ b/tests/rm/r-1
@@ -7,6 +7,8 @@ if test "$VERBOSE" = yes; then
rm --version
fi
+. $srcdir/../lang-default
+
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
@@ -14,26 +16,26 @@ trap '(exit $?); exit' 1 2 13 15
framework_failure=0
mkdir -p $tmp || framework_failure=1
-mkdir $tmp/a $tmp/a/a || framework_failure=1
-> $tmp/b || framework_failure=1
-
-cat <<EOF > $tmp/$test.E || framework_failure=1
-removing all entries of directory \`$tmp/a'
-removing all entries of directory \`$tmp/a/a'
-removing the directory itself: \`$tmp/a/a'
-removing the directory itself: \`$tmp/a'
-removing \`$tmp/b'
+cd $tmp || framework_failure=1
+
+mkdir a a/a || framework_failure=1
+> b || framework_failure=1
+
+cat <<EOF > $test.E || framework_failure=1
+removing all entries of directory \`a'
+removing all entries of directory \`a/a'
+removing the directory itself: \`a/a'
+removing the directory itself: \`a'
+removing \`b'
EOF
if test $framework_failure = 1; then
- echo 'failure in testing framework'
- exit 1
+ echo '$0: failure in testing framework' 1>&2
+ (exit 1); exit
fi
-. $srcdir/../lang-default
-
fail=0
-rm --verbose -r $tmp/a $tmp/b > $tmp/$test.O || fail=1
+rm --verbose -r a b > $test.O || fail=1
for d in $dirs; do
if test -d $d; then
@@ -42,11 +44,7 @@ for d in $dirs; do
done
# Compare expected and actual output.
-cmp $tmp/$test.E $tmp/$test.O || fail=1
-test $fail = 1 && diff -u $tmp/$test.E $tmp/$test.O 2> /dev/null
-
-
-rm -rf $tmp
+cmp $test.E $test.O || fail=1
+test $fail = 1 && diff $test.E $test.O 2> /dev/null
-(exit $fail)
-exit $fail
+(exit $fail); exit