summaryrefslogtreecommitdiff
path: root/tests/cp/same-file
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-09-06 17:34:49 +0200
committerJim Meyering <jim@meyering.net>2007-09-15 08:40:38 +0200
commitdf0beae1eb1318869d51a064aec8fdd401877cbf (patch)
tree94f2224056162eadbb3d6b640e32f56d3f405cbf /tests/cp/same-file
parentc840cd4334c086f5ce4d9144d9fac75643824a38 (diff)
downloadcoreutils-df0beae1eb1318869d51a064aec8fdd401877cbf.tar.xz
Adjust chgrp, chmod, chown, cp tests to use test-lib.sh.
* tests/check.mk: Also define abs_top_builddir.
Diffstat (limited to 'tests/cp/same-file')
-rwxr-xr-xtests/cp/same-file22
1 files changed, 3 insertions, 19 deletions
diff --git a/tests/cp/same-file b/tests/cp/same-file
index 9e4d0cca5..7bf6da853 100755
--- a/tests/cp/same-file
+++ b/tests/cp/same-file
@@ -2,7 +2,7 @@
# Test some of cp's options and how cp handles situations in
# which a naive implementation might overwrite the source file.
-# Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2006 Free Software
+# Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2006-2007 Free Software
# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
@@ -24,7 +24,7 @@ if test "$VERBOSE" = yes; then
fi
. $srcdir/../lang-default
-. $srcdir/../envvar-check
+. $srcdir/../test-lib.sh
# Unset CDPATH. Otherwise, output from the `cd dir' command
# can make this test fail.
@@ -32,20 +32,6 @@ fi
VERSION_CONTROL=numbered; export VERSION_CONTROL
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && exec 1>&2; rm -rf $t0 && exit $status' 0
-trap '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 'failure in testing framework'
- exit 1
-fi
-
actual=actual-$$
expected=expected-$$
@@ -210,8 +196,6 @@ EOF
fail=0;
-# Some folks don't have diff.
-cmp $expected $actual \
- || { diff -c $expected $actual 1>&2; fail=1; }
+compare $expected $actual || fail=1
(exit $fail); exit $fail