From 92d76e1e92f98b2aadacdd668ebd9ce932fe7d82 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 19 Apr 2002 22:39:05 +0000 Subject: [PATCH] upgrade to use better framework --- tests/rm/r-1 | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 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 +cd $tmp || framework_failure=1 -cat < $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' +mkdir a a/a || framework_failure=1 +> b || framework_failure=1 + +cat < $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 +cmp $test.E $test.O || fail=1 +test $fail = 1 && diff $test.E $test.O 2> /dev/null - -rm -rf $tmp - -(exit $fail) -exit $fail +(exit $fail); exit