]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
update framework
authorJim Meyering <jim@meyering.net>
Fri, 19 Apr 2002 22:57:04 +0000 (22:57 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 19 Apr 2002 22:57:04 +0000 (22:57 +0000)
tests/rm/sunos-1

index e00a61baa8e8efd2554be5bd4ad7b9f03f4cdcf2..366578096b8131a4d2a175894e9a56523da8ed93 100755 (executable)
@@ -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