summaryrefslogtreecommitdiff
path: root/tests/tail-2/tail-n0f
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-09-13 08:44:26 +0200
committerJim Meyering <jim@meyering.net>2007-09-15 08:40:39 +0200
commit53d36aaf9a856f523bd52de479a88f14338edda3 (patch)
treed43c74c6219ab7e0f8d294c131189034b15bea47 /tests/tail-2/tail-n0f
parent10d190b8b6289f8a4b4818bd03b8f3a5dc87fd14 (diff)
downloadcoreutils-53d36aaf9a856f523bd52de479a88f14338edda3.tar.xz
Adapt tests/tail-2/ to use test-lib.sh.
Diffstat (limited to 'tests/tail-2/tail-n0f')
-rwxr-xr-xtests/tail-2/tail-n0f22
1 files changed, 5 insertions, 17 deletions
diff --git a/tests/tail-2/tail-n0f b/tests/tail-2/tail-n0f
index 3a94bc5f3..de5786e91 100755
--- a/tests/tail-2/tail-n0f
+++ b/tests/tail-2/tail-n0f
@@ -2,7 +2,7 @@
# Make sure that `tail -n0 -f' and `tail -c0 -f' sleep
# rather than doing what amounted to a busy-wait.
-# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,7 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
# This bug was fixed for 5.0.91
# It skips the test if your system lacks a /proc/$pid/status
# file, or if its contents don't look right.
@@ -27,6 +26,8 @@ if test "$VERBOSE" = yes; then
tail --version
fi
+. $srcdir/../test-lib.sh
+
sleep 2 &
pid=$!
sleep .5
@@ -37,21 +38,8 @@ grep '^State:[ ]*[S]' /proc/$pid/status > /dev/null 2>&1 || \
}
kill $pid
-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
-echo anything > nonempty || 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
+echo anything > nonempty || framework_failure
fail=0