summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-04-19 22:41:59 +0000
committerJim Meyering <jim@meyering.net>2002-04-19 22:41:59 +0000
commit0129239343f6dd4daa3fae1ebf5be071f6317e86 (patch)
tree49c9979723b1325e847170d5fce166809fff4611
parent92d76e1e92f98b2aadacdd668ebd9ce932fe7d82 (diff)
downloadcoreutils-0129239343f6dd4daa3fae1ebf5be071f6317e86.tar.xz
upgrade to use better framework
-rwxr-xr-xtests/cp/no-deref-link117
-rwxr-xr-xtests/cp/no-deref-link217
-rwxr-xr-xtests/cp/no-deref-link317
3 files changed, 42 insertions, 9 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
diff --git a/tests/cp/no-deref-link2 b/tests/cp/no-deref-link2
index 6af843d00..766318364 100755
--- a/tests/cp/no-deref-link2
+++ b/tests/cp/no-deref-link2
@@ -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 b
msg=bar
echo $msg > a
@@ -26,6 +39,4 @@ test $? = 1 || fail=1
test "`cat a`" = $msg || fail=1
-rm -rf a b
-
(exit $fail); exit
diff --git a/tests/cp/no-deref-link3 b/tests/cp/no-deref-link3
index 9ad685f7a..370803f7b 100755
--- a/tests/cp/no-deref-link3
+++ b/tests/cp/no-deref-link3
@@ -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
+
msg=bar
echo $msg > a
ln -s a b
@@ -23,6 +36,4 @@ test $? = 1 || fail=1
test "`cat a`" = $msg || fail=1
-rm -f a b
-
(exit $fail); exit