summaryrefslogtreecommitdiff
path: root/tests/cp/same-file
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-08-21 09:45:52 +0000
committerJim Meyering <jim@meyering.net>2000-08-21 09:45:52 +0000
commit3ee1d2075c6eccd9efc48c252544d4cb793e1dce (patch)
tree501844906306919b70beeeda76d6544013cbef21 /tests/cp/same-file
parent4ff47b028e672664d79a24cd18d3a8f26aac9ac5 (diff)
downloadcoreutils-3ee1d2075c6eccd9efc48c252544d4cb793e1dce.tar.xz
Clean up traps. Create files in a subdir.
Diffstat (limited to 'tests/cp/same-file')
-rwxr-xr-xtests/cp/same-file16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/cp/same-file b/tests/cp/same-file
index 6220b4f31..534875eda 100755
--- a/tests/cp/same-file
+++ b/tests/cp/same-file
@@ -13,12 +13,22 @@ LANG=C; export LANG
VERSION_CONTROL=numbered; export VERSION_CONTROL
pwd=`pwd`
+tmp=same-f-$$
+trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'exit $?' 1 2 13 15
+
+framework_failure=0
+mkdir $tmp || framework_failure=1
+cd $tmp || framework_failure=1
+
+if test $framework_failure = 1; then
+ echo 'failure in testing framework'
+ exit 1
+fi
+
actual=actual-$$
expected=expected-$$
-trap 'status=$?; cd $pwd; rm -rf dir $actual $expected && exit $status' 0
-trap 'exit $?' 1 2 13 15
-
exec 1> $actual
# FIXME: This should be bigger: like more than 8k