diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/rm/sunos-1 | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/tests/rm/sunos-1 b/tests/rm/sunos-1 index e00a61baa..366578096 100755 --- a/tests/rm/sunos-1 +++ b/tests/rm/sunos-1 @@ -4,35 +4,26 @@ # actually remove files with names of entries in the current directory # but relative to `/' rather than relative to the current directory. -: ${RM=rm} -test=sunos-1 - if test "$VERBOSE" = yes; then set -x - $RM --version + rm --version fi -tmp=t-rm.$$ - -# We're going to run RM from a subdir. -# Prepend ../ if $RM is a relative file name. -case $RM in - /*) ;; - */*) RM=../$RM -esac +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 -test_failure=0 -mkdir $tmp || test_failure=1 +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 -if test $test_failure = 1; then - echo 'failure in testing framework' - exit 1 +if test $framework_failure = 1; then + echo '$0: failure in testing framework' 1>&2 + (exit 1); exit fi fail=0 -cd $tmp -$RM -r '' > /dev/null 2>&1 && fail=1 -cd .. -rm -rf $tmp +rm -r '' > /dev/null 2>&1 && fail=1 (exit $fail); exit |