summaryrefslogtreecommitdiff
path: root/tests/touch
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-10-30 10:50:21 +0100
committerJim Meyering <meyering@redhat.com>2009-10-30 12:50:12 +0100
commit3c88587b2eadee11413f4207abbbf13af07c438d (patch)
tree79d45c03b5c6ba2520eeeb236170dbafef49fac7 /tests/touch
parent12a0a583f6fe3303bd9dfb30de4a5fe46e8e486f (diff)
downloadcoreutils-3c88587b2eadee11413f4207abbbf13af07c438d.tar.xz
tests: factor 350 fail=0 initializations into test-lib.sh
Run this command to remove the factored-out "fail=0" lines. perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$') * tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts. * tests/...: nearly all bourne shell scripts Suggested by Eric Blake.
Diffstat (limited to 'tests/touch')
-rwxr-xr-xtests/touch/60-seconds1
-rwxr-xr-xtests/touch/dangling-symlink1
-rwxr-xr-xtests/touch/dir-11
-rwxr-xr-xtests/touch/empty-file1
-rwxr-xr-xtests/touch/fail-diag1
-rwxr-xr-xtests/touch/fifo1
-rwxr-xr-xtests/touch/no-create-missing1
-rwxr-xr-xtests/touch/no-dereference1
-rwxr-xr-xtests/touch/no-rights1
-rwxr-xr-xtests/touch/not-owner1
-rwxr-xr-xtests/touch/now-owned-by-other1
-rwxr-xr-xtests/touch/obsolescent1
-rwxr-xr-xtests/touch/read-only1
-rwxr-xr-xtests/touch/relative1
-rwxr-xr-xtests/touch/trailing-slash1
15 files changed, 0 insertions, 15 deletions
diff --git a/tests/touch/60-seconds b/tests/touch/60-seconds
index b13ad06ff..0fbcaae06 100755
--- a/tests/touch/60-seconds
+++ b/tests/touch/60-seconds
@@ -25,7 +25,6 @@ fi
echo 60 > exp || framework_failure
-fail=0
# Before coreutils-7.7, this would fail, complaining of
# an `invalid date format'. Specifying 60 seconds *is* valid.
diff --git a/tests/touch/dangling-symlink b/tests/touch/dangling-symlink
index f3ea29a7f..a16e015ca 100755
--- a/tests/touch/dangling-symlink
+++ b/tests/touch/dangling-symlink
@@ -26,7 +26,6 @@ fi
rm -f touch-target t-symlink
ln -s touch-target t-symlink
-fail=0
# This used to infloop.
touch t-symlink || fail=1
diff --git a/tests/touch/dir-1 b/tests/touch/dir-1
index 1698ab1ca..ef1543e26 100755
--- a/tests/touch/dir-1
+++ b/tests/touch/dir-1
@@ -9,6 +9,5 @@ fi
. $srcdir/test-lib.sh
-fail=0
touch . || fail=1
Exit $fail
diff --git a/tests/touch/empty-file b/tests/touch/empty-file
index 05db80cfb..310ea3037 100755
--- a/tests/touch/empty-file
+++ b/tests/touch/empty-file
@@ -31,7 +31,6 @@ fi
DEFAULT_SLEEP_SECONDS=2
SLEEP_SECONDS=${SLEEP_SECONDS=$DEFAULT_SLEEP_SECONDS}
-fail=0
# FIXME: find writable directories on other partitions
# and run the test in those directories, too.
diff --git a/tests/touch/fail-diag b/tests/touch/fail-diag
index 070b7273a..57f5038ef 100755
--- a/tests/touch/fail-diag
+++ b/tests/touch/fail-diag
@@ -29,7 +29,6 @@ dir=/$d1/such-dir
# Ensure that $d1 doesn't already exist.
ls -d $d1 2> /dev/null && framework_failure
-fail=0
touch $dir > out 2>&1 && fail=1
cat <<EOF > exp
diff --git a/tests/touch/fifo b/tests/touch/fifo
index b8209a4fc..57bb5cf8f 100755
--- a/tests/touch/fifo
+++ b/tests/touch/fifo
@@ -25,7 +25,6 @@ fi
mkfifo_or_skip_ fifo
-fail=0
touch fifo || fail=1
diff --git a/tests/touch/no-create-missing b/tests/touch/no-create-missing
index 517ad7de6..3fc668194 100755
--- a/tests/touch/no-create-missing
+++ b/tests/touch/no-create-missing
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
touch -c no-file > /dev/null 2>&1 || fail=1
touch -cm no-file > /dev/null 2>&1 || fail=1
diff --git a/tests/touch/no-dereference b/tests/touch/no-dereference
index 28527e857..f10eca85e 100755
--- a/tests/touch/no-dereference
+++ b/tests/touch/no-dereference
@@ -27,7 +27,6 @@ ln -s nowhere dangling || framework_failure
touch file || framework_failure
ln -s file link || framework_failure
-fail=0
# These first tests should work on every platform.
# -h does not create files, but it warns. Use -c to silence warning.
diff --git a/tests/touch/no-rights b/tests/touch/no-rights
index 95470c0ac..3090bf025 100755
--- a/tests/touch/no-rights
+++ b/tests/touch/no-rights
@@ -31,7 +31,6 @@ touch -d '2000-01-02 00:00' t2 || framework_failure
set x `ls -t t1 t2`
test "$*" = "x t2 t1" || framework_failure
-fail=0
chmod 0 t1
touch -d '2000-01-03 00:00' -c t1 || fail=1
diff --git a/tests/touch/not-owner b/tests/touch/not-owner
index 92347bd30..3dd8a8086 100755
--- a/tests/touch/not-owner
+++ b/tests/touch/not-owner
@@ -34,7 +34,6 @@ fi
skip_if_root_
-fail=0
# Before fileutils-4.1, we'd get the following misleading
# diagnostic instead of `...: Permission denied'.
diff --git a/tests/touch/now-owned-by-other b/tests/touch/now-owned-by-other
index 4ce4ec6de..e124a2e4a 100755
--- a/tests/touch/now-owned-by-other
+++ b/tests/touch/now-owned-by-other
@@ -34,7 +34,6 @@ chmod g+w root-owned
# Ensure that the current directory is searchable by $NON_ROOT_USERNAME.
chmod g+x .
-fail=0
setuidgid $NON_ROOT_USERNAME env PATH="$PATH" touch -d now root-owned || fail=1
Exit $fail
diff --git a/tests/touch/obsolescent b/tests/touch/obsolescent
index 988ef04ab..88a442563 100755
--- a/tests/touch/obsolescent
+++ b/tests/touch/obsolescent
@@ -26,7 +26,6 @@ fi
_POSIX2_VERSION=199209; export _POSIX2_VERSION
POSIXLY_CORRECT=1; export POSIXLY_CORRECT
-fail=0
yearstart=01010000
diff --git a/tests/touch/read-only b/tests/touch/read-only
index 8d1853b46..9d21dbdef 100755
--- a/tests/touch/read-only
+++ b/tests/touch/read-only
@@ -27,7 +27,6 @@ skip_if_root_
: > read-only || framework_failure
chmod 444 read-only || framework_failure
-fail=0
touch read-only || fail=1
diff --git a/tests/touch/relative b/tests/touch/relative
index ad42c1a04..05704feea 100755
--- a/tests/touch/relative
+++ b/tests/touch/relative
@@ -26,7 +26,6 @@ fi
TZ=UTC0 touch --date='2004-01-16 12:00 +0000' f || framework_failure
-fail=0
# Set times back by 5 days.
touch --ref f --date='-5 days' f || fail=1
diff --git a/tests/touch/trailing-slash b/tests/touch/trailing-slash
index 85cf48877..05c2ac742 100755
--- a/tests/touch/trailing-slash
+++ b/tests/touch/trailing-slash
@@ -30,7 +30,6 @@ ln -s file link1 || framework_failure
mkdir dir || framework_failure
ln -s dir link2 || framework_failure
-fail=0
# Trailing slash can only appear on directory or symlink-to-directory.
# Up through coreutils 8.0, Solaris 9 failed these tests.