summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/cp/backup-16
-rwxr-xr-xtests/cp/backup-is-src13
-rwxr-xr-xtests/cp/no-deref-link16
-rwxr-xr-xtests/cp/no-deref-link26
-rwxr-xr-xtests/cp/no-deref-link36
-rwxr-xr-xtests/cp/same-file12
6 files changed, 16 insertions, 33 deletions
diff --git a/tests/cp/backup-1 b/tests/cp/backup-1
index 3557b57b2..20da79067 100755
--- a/tests/cp/backup-1
+++ b/tests/cp/backup-1
@@ -1,10 +1,8 @@
#!/bin/sh
-: ${CP=cp}
-
if test "$VERBOSE" = yes; then
set -x
- $CP --version
+ cp --version
fi
suffix=.b
@@ -18,7 +16,7 @@ echo test > $tmp || fail=1
# Specify both version control and suffix so the environment variables
# (possibly set by the user running these tests) aren't used.
-$CP --force --backup --version-control=simple --suffix=$suffix $tmp $tmp \
+cp --force --backup --version-control=simple --suffix=$suffix $tmp $tmp \
|| fail=1
test -f $tmp || fail=1
diff --git a/tests/cp/backup-is-src b/tests/cp/backup-is-src
index f2eaa090e..13ec99290 100755
--- a/tests/cp/backup-is-src
+++ b/tests/cp/backup-is-src
@@ -1,15 +1,12 @@
#!/bin/sh
-: ${CP=cp}
-: ${RM=rm}
-
if test "$VERBOSE" = yes; then
set -x
- $CP --version
+ cp --version
fi
framework_failure=0
-$RM -f a a~ || framework_failure=1
+rm -f a a~ || framework_failure=1
echo a > a || framework_failure=1
echo a-tilde > a~ || framework_failure=1
@@ -27,9 +24,9 @@ LANG=C
export LANG
# This cp command should exit nonzero.
-$CP -b -V simple a~ a > out 2>&1 && fail=1
+cp -b -V simple a~ a > out 2>&1 && fail=1
-sed "s,$CP:,XXX:," out > out2
+sed "s,cp:,XXX:," out > out2
cat > exp <<\EOF
XXX: backing up `a' would destroy source; `a~' not copied
@@ -37,6 +34,6 @@ EOF
cmp out2 exp || fail=1
-$RM -f out out2 exp a a~
+rm -f out out2 exp a a~
exit $fail
diff --git a/tests/cp/no-deref-link1 b/tests/cp/no-deref-link1
index a1a756c68..3a85c4994 100755
--- a/tests/cp/no-deref-link1
+++ b/tests/cp/no-deref-link1
@@ -2,11 +2,9 @@
# FIXME: This test requires ln -s.
# cp from 3.16 fails this test
-: ${CP=cp}
-
if test "$VERBOSE" = yes; then
set -x
- $CP --version
+ cp --version
fi
rm -rf a b
@@ -21,7 +19,7 @@ fail=0
# It should fail with a message something like this:
# ./cp: `a/foo' and `b/foo' are the same file
-$CP -d a/foo b 2>/dev/null
+cp -d a/foo b 2>/dev/null
# Fail this test if the exit status is not 1
test $? = 1 || fail=1
diff --git a/tests/cp/no-deref-link2 b/tests/cp/no-deref-link2
index 5c194a080..963e5af22 100755
--- a/tests/cp/no-deref-link2
+++ b/tests/cp/no-deref-link2
@@ -2,11 +2,9 @@
# FIXME: This test requires ln -s.
# cp from 3.16 fails this test
-: ${CP=cp}
-
if test "$VERBOSE" = yes; then
set -x
- $CP --version
+ cp --version
fi
rm -rf a b
@@ -21,7 +19,7 @@ fail=0
# It should fail with a message something like this:
# cp: `a' and `b/foo' are the same file
-$CP -d a b 2>/dev/null
+cp -d a b 2>/dev/null
# Fail this test if the exit status is not 1
test $? = 1 || fail=1
diff --git a/tests/cp/no-deref-link3 b/tests/cp/no-deref-link3
index 148694860..41910e1a3 100755
--- a/tests/cp/no-deref-link3
+++ b/tests/cp/no-deref-link3
@@ -2,11 +2,9 @@
# FIXME: This test requires ln -s.
# cp from 3.16 fails this test
-: ${CP=cp}
-
if test "$VERBOSE" = yes; then
set -x
- $CP --version
+ cp --version
fi
rm -rf a b
@@ -18,7 +16,7 @@ fail=0
# It should fail with a message something like this:
# cp: `a' and `b' are the same file
-$CP -d a b 2>/dev/null
+cp -d a b 2>/dev/null
# Fail this test if the exit status is not 1
test $? = 1 || fail=1
diff --git a/tests/cp/same-file b/tests/cp/same-file
index 8d93481db..e0b18696a 100755
--- a/tests/cp/same-file
+++ b/tests/cp/same-file
@@ -2,12 +2,9 @@
# Test some of cp's options and how cp handles situations in
# which a naive implementation might overwrite the source file.
-# FIXME: punt for now
-CP=cp
-
if test "$VERBOSE" = yes; then
set -x
- $CP --version
+ cp --version
fi
LANGUAGE=C; export LANGUAGE
@@ -15,9 +12,6 @@ LANG=C; export LANG
VERSION_CONTROL=numbered; export VERSION_CONTROL
-pwd=`pwd`
-PATH=$pwd/../../src:$PATH
-
actual=actual-$$
expected=expected-$$
trap "cd $pwd; rm -rf $actual $expected dir" 0 1 2 3 15
@@ -51,8 +45,8 @@ for args in 'foo symlink' 'symlink foo' 'foo foo' 'sl1 sl2' 'foo hardlink'; do
case "$args" in *sl2*) ln -s foo sl2;; esac
(
(
- # echo 1>&2 $CP $options $args
- $CP $options $args 2>.err
+ # echo 1>&2 cp $options $args
+ cp $options $args 2>.err
echo $? $options
# Normalize the program name in the error output,