summaryrefslogtreecommitdiff
path: root/tests/cp/no-deref-link1
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cp/no-deref-link1')
-rwxr-xr-xtests/cp/no-deref-link117
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/cp/no-deref-link1 b/tests/cp/no-deref-link1
index 0d9d462fc..24246b6f8 100755
--- a/tests/cp/no-deref-link1
+++ b/tests/cp/no-deref-link1
@@ -7,7 +7,20 @@ if test "$VERBOSE" = yes; then
cp --version
fi
-rm -rf a b
+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
+
+framework_failure=0
+mkdir -p $tmp || framework_failure=1
+cd $tmp || framework_failure=1
+
+if test $framework_failure = 1; then
+ echo '$0: failure in testing framework' 1>&2
+ (exit 1); exit
+fi
+
mkdir a b
msg=bar
echo $msg > a/foo
@@ -26,6 +39,4 @@ test $? = 1 || fail=1
test "`cat a/foo`" = $msg || fail=1
-rm -rf a b
-
(exit $fail); exit