mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-27 12:04:25 +08:00
upgrade to use better framework
This commit is contained in:
parent
dc2f3bc5e4
commit
92d76e1e92
38
tests/rm/r-1
38
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 <<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'
|
||||
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
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user