summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-04-19 22:57:04 +0000
committerJim Meyering <jim@meyering.net>2002-04-19 22:57:04 +0000
commit73f2d110077745a8f4c297c26e3c8310f2251780 (patch)
treed53e15eb54e060e9278a95224c0b2d280f5a4645 /tests
parentf2bb69ebb0b227c1a8030ebc588460074c877b47 (diff)
downloadcoreutils-73f2d110077745a8f4c297c26e3c8310f2251780.tar.xz
update framework
Diffstat (limited to 'tests')
-rwxr-xr-xtests/rm/sunos-133
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