summaryrefslogtreecommitdiff
path: root/tests/rm/r-1
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rm/r-1')
-rwxr-xr-xtests/rm/r-125
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/rm/r-1 b/tests/rm/r-1
index afd21e2f8..cc58feb5c 100755
--- a/tests/rm/r-1
+++ b/tests/rm/r-1
@@ -13,10 +13,23 @@ if test "$VERBOSE" = yes; then
fi
tmp=$TMPDIR/t-rm.$$
-mkdir $tmp
-mkdir $tmp/a $tmp/a/a
-touch $tmp/b
+test_failure=0
+
+mkdir $tmp || test_failure=1
+mkdir $tmp/a $tmp/a/a || test_failure=1
+> $tmp/b || test_failure=1
+
+cat <<EOF > $tmp/$test.E || test_failure=1
+$tmp/a
+$tmp/a/a
+$tmp/b
+EOF
+
+if test $test_failure = 1; then
+ echo 'failure in testing framework'
+ exit 1
+fi
fail=0
$RM --verbose -r $tmp/a $tmp/b > $tmp/$test.O || fail=1
@@ -27,12 +40,6 @@ for d in $dirs; do
fi
done
-cat <<EOF > $tmp/$test.E
-$tmp/a
-$tmp/a/a
-$tmp/b
-EOF
-
# Compare expected and actual output.
cmp $tmp/$test.E $tmp/$test.O || fail=1