summaryrefslogtreecommitdiff
path: root/tests/cp/proc-zero-len
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cp/proc-zero-len')
-rwxr-xr-xtests/cp/proc-zero-len20
1 files changed, 3 insertions, 17 deletions
diff --git a/tests/cp/proc-zero-len b/tests/cp/proc-zero-len
index cd6f94c83..8330bfd28 100755
--- a/tests/cp/proc-zero-len
+++ b/tests/cp/proc-zero-len
@@ -21,22 +21,9 @@ if test "$VERBOSE" = yes; then
cp --version
fi
-. $srcdir/../envvar-check
+. $srcdir/../test-lib.sh
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && 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
-touch empty || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+touch empty || framework_failure
f=/proc/cpuinfo
test -r $f || f=empty
@@ -53,7 +40,6 @@ cp $f exp || fail=1
test -s out && { rm -f out; echo nonempty > out; }
test -s exp && { rm -f exp; echo nonempty > exp; }
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail