diff options
Diffstat (limited to 'tests/rm/dir-nonrecur')
-rwxr-xr-x | tests/rm/dir-nonrecur | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/tests/rm/dir-nonrecur b/tests/rm/dir-nonrecur index 92ab1d495..b912e6362 100755 --- a/tests/rm/dir-nonrecur +++ b/tests/rm/dir-nonrecur @@ -2,7 +2,7 @@ # Ensure that `rm dir' (i.e., without --recursive) gives a reasonable # diagnostic when failing. -# Copyright (C) 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,21 +23,9 @@ if test "$VERBOSE" = yes; then fi . $srcdir/../lang-default +. $srcdir/../test-lib.sh -pwd=`pwd` -t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ -trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 -trap '(exit $?); exit $?' 1 2 13 15 - -framework_failure=0 -mkdir -p $tmp || framework_failure=1 -cd $tmp || framework_failure=1 -mkdir d || framework_failure=1 - -if test $framework_failure = 1; then - echo "$0: failure in testing framework" 1>&2 - (exit 1); exit 1 -fi +mkdir d || framework_failure fail=0 @@ -47,7 +35,6 @@ rm: cannot remove `d': Is a directory EOF # Before coreutils-5.93 this test would fail on Solaris 9 and newer. -cmp out exp || fail=1 -test $fail = 1 && diff out exp 2> /dev/null +compare out exp || fail=1 (exit $fail); exit $fail |