From 73f2d110077745a8f4c297c26e3c8310f2251780 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 19 Apr 2002 22:57:04 +0000 Subject: update framework --- tests/rm/sunos-1 | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3-54-g00ecf