1997-08-02 15:25:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
test=r-1
|
|
|
|
|
|
|
|
|
|
if test "$VERBOSE" = yes; then
|
|
|
|
|
set -x
|
2000-06-12 08:34:00 +00:00
|
|
|
rm --version
|
1997-08-02 15:25:25 +00:00
|
|
|
fi
|
|
|
|
|
|
2002-04-19 22:39:05 +00:00
|
|
|
. $srcdir/../lang-default
|
|
|
|
|
|
2000-06-12 08:42:08 +00:00
|
|
|
pwd=`pwd`
|
2002-04-19 21:59:57 +00:00
|
|
|
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
|
|
|
|
|
trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
|
2002-04-19 19:51:29 +00:00
|
|
|
trap '(exit $?); exit' 1 2 13 15
|
1997-08-02 15:25:25 +00:00
|
|
|
|
2000-06-14 16:53:36 +00:00
|
|
|
framework_failure=0
|
2002-04-19 21:59:57 +00:00
|
|
|
mkdir -p $tmp || framework_failure=1
|
2002-04-19 22:39:05 +00:00
|
|
|
cd $tmp || framework_failure=1
|
|
|
|
|
|
|
|
|
|
mkdir a a/a || framework_failure=1
|
|
|
|
|
> b || framework_failure=1
|
|
|
|
|
|
2002-06-02 20:36:19 +00:00
|
|
|
cat <<\EOF > $test.E || framework_failure=1
|
|
|
|
|
removed directory: `a/a'
|
|
|
|
|
removed directory: `a'
|
|
|
|
|
removed `b'
|
1998-01-22 08:33:02 +00:00
|
|
|
EOF
|
|
|
|
|
|
2000-06-12 08:42:08 +00:00
|
|
|
if test $framework_failure = 1; then
|
2002-10-08 09:21:08 +00:00
|
|
|
echo "$0: failure in testing framework" 1>&2
|
2002-04-19 22:39:05 +00:00
|
|
|
(exit 1); exit
|
1998-01-22 08:33:02 +00:00
|
|
|
fi
|
1997-08-02 15:25:25 +00:00
|
|
|
|
|
|
|
|
fail=0
|
2002-04-19 22:39:05 +00:00
|
|
|
rm --verbose -r a b > $test.O || fail=1
|
1997-08-02 15:25:25 +00:00
|
|
|
|
|
|
|
|
for d in $dirs; do
|
|
|
|
|
if test -d $d; then
|
|
|
|
|
fail=1
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
1997-08-02 16:51:37 +00:00
|
|
|
# Compare expected and actual output.
|
2002-04-19 22:39:05 +00:00
|
|
|
cmp $test.E $test.O || fail=1
|
|
|
|
|
test $fail = 1 && diff $test.E $test.O 2> /dev/null
|
1997-08-02 15:25:25 +00:00
|
|
|
|
2002-04-19 22:39:05 +00:00
|
|
|
(exit $fail); exit
|