tests: call skip_test_ in place of echo+exit 77
authorJim Meyering <meyering@redhat.com>
Thu, 29 Nov 2007 08:21:22 +0000 (09:21 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 9 Feb 2008 09:30:33 +0000 (10:30 +0100)
* tests/mv/no-target-dir: Likewise.
* tests/other-fs-tmpdir: Likewise.
* tests/rm/empty-name: Likewise.
* tests/rm/fail-eperm: Likewise.
* tests/rm/inaccessible: Likewise.
* tests/rm/isatty: Likewise.
* tests/rm/unreadable: Likewise.
* tests/setgid-check: Likewise.
* tests/sparse-file: Likewise.
* tests/strace: Likewise.
* tests/tail-2/append-only: Likewise.
* tests/tail-2/big-4gb: Likewise.
* tests/tail-2/tail-n0f: Likewise.
* tests/touch/dangling-symlink: Likewise.
* tests/touch/fifo: Likewise.
* tests/touch/not-owner: Likewise.
* tests/mv/i-3: Likewise.
* tests/umask-check: Likewise.
* tests/mv/acl: Likewise.
* tests/cp/acl: Likewise.
* tests/chgrp/deref: Likewise.
* tests/chmod/setgid: Likewise.
* tests/cp/existing-perm-race: Likewise.
* tests/cp/file-perm-race: Likewise.
* tests/cp/parent-perm-race: Likewise.
* tests/du/2g: Likewise.
* tests/du/8gb: Likewise.
* tests/du/long-from-unreadable: Likewise.
* tests/du/long-sloop: Likewise.
* tests/du/slink: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/ls/stat-dtype: Likewise.
* tests/misc/cat-proc: Likewise.
* tests/misc/md5sum-newline: Likewise.
* tests/misc/nice: Likewise.
* tests/misc/od-x8: Likewise.
* tests/misc/pwd-unreadable-parent: Likewise.
* tests/misc/selinux: Likewise.
* tests/misc/stty-row-col: Likewise.
* tests/misc/tac-continue: Likewise.
* tests/misc/arch: Likewise, and source $srcdir/../test-lib.sh *before*
the use of skip_test_.

41 files changed:
tests/chgrp/deref
tests/chmod/setgid
tests/cp/acl
tests/cp/existing-perm-race
tests/cp/file-perm-race
tests/cp/parent-perm-race
tests/du/2g
tests/du/8gb
tests/du/long-from-unreadable
tests/du/long-sloop
tests/du/slink
tests/ls/nameless-uid
tests/ls/stat-dtype
tests/misc/arch
tests/misc/cat-proc
tests/misc/md5sum-newline
tests/misc/nice
tests/misc/od-x8
tests/misc/pwd-unreadable-parent
tests/misc/selinux
tests/misc/stty-row-col
tests/misc/tac-continue
tests/mv/acl
tests/mv/i-3
tests/mv/no-target-dir
tests/other-fs-tmpdir
tests/rm/empty-name
tests/rm/fail-eperm
tests/rm/inaccessible
tests/rm/isatty
tests/rm/unreadable
tests/setgid-check
tests/sparse-file
tests/strace
tests/tail-2/append-only
tests/tail-2/big-4gb
tests/tail-2/tail-n0f
tests/touch/dangling-symlink
tests/touch/fifo
tests/touch/not-owner
tests/umask-check

index 5dd61e1..ebf92e4 100755 (executable)
@@ -34,13 +34,9 @@ ln -s f symlink
 chgrp -h $g2 symlink 2> /dev/null
 set _ `ls -ln symlink`
 g=$5
-test "$g" = $g2 || {
-  cat <<EOF 1>&2
-$0: skipping this test; your system doesn't support changing
-the owner or group of a symbolic link.
-EOF
-  (exit 77); exit 77
-}
+test "$g" = $g2 ||
+  skip_test_ "your system doesn't support changing the owner or group" \
+      "of a symbolic link."
 
 fail=0
 
index a91c6a5..d5d35f9 100755 (executable)
@@ -44,11 +44,8 @@ chmod g+s d 2> /dev/null && "$test" -g d ||
   }
 
 # "chmod g+s d" does nothing on some NFS file systems.
-"$test" -g d || {
-  echo 1>&2 "$0: cannot create setgid directories," \
-    "so can't run this test"
-  exit 77
-}
+"$test" -g d ||
+  skip_test_ 'cannot create setgid directories'
 
 fail=0
 
index 42f7c34..fd6e86d 100755 (executable)
 . $srcdir/../lang-default
 
 # Skip this test if cp was built without ACL support:
-grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null && \
-  {
-    echo 1>&2 "$0: insufficient ACL support, so skipping this test"
-    (exit 77); exit 77
-  }
+grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null &&
+  skip_test_ "insufficient ACL support"
 
 if test "$VERBOSE" = yes; then
   set -x
@@ -47,11 +44,7 @@ acl1=`cd a && getfacl file | grep -v ':bin:' | grep -v 'mask::'` \
   || skip=yes
 
 test $skip = yes &&
-  {
-    echo "$0: '.' is not on a suitable file system for this test" 1>&2
-    echo "$0: skipping this test" 1>&2
-    (exit 77); exit 77
-  }
+  skip_test_ "'.' is not on a suitable file system for this test"
 
 # copy a file without preserving permissions
 cp a/file b/ || fail=1
index 11f38d2..0ab10e9 100755 (executable)
@@ -31,10 +31,8 @@ g2=$2
 fail=0
 
 umask 077
-mkfifo fifo || {
-  echo "$0: fifos not supported; skipping this test." 1>&2
-  (exit 77); exit 77
-}
+mkfifo fifo ||
+  skip_test_ "fifos not supported"
 
 touch fifo-copy &&
 chgrp $g1 fifo &&
index 94e402d..3e38597 100755 (executable)
@@ -24,10 +24,8 @@ fi
 . $srcdir/../test-lib.sh
 
 umask 022
-mkfifo fifo || {
-  echo "$0: fifos not supported; skipping this test." 1>&2
-  (exit 77); exit 77
-}
+mkfifo fifo ||
+  skip_test_ "fifos not supported"
 
 # Copy a fifo's contents.  That way, we can examine the
 # destination permissions before they're finalized.
index b09f8bc..8afa0c0 100755 (executable)
@@ -31,10 +31,8 @@ fail=0
 
 for attr in mode ownership
 do
-  mkfifo $attr/fifo || {
-    echo "$0: fifos not supported; skipping this test." 1>&2
-    (exit 77); exit 77
-  }
+  mkfifo $attr/fifo ||
+    skip_test_ "fifos not supported"
 
   # Copy a fifo's contents.  That way, we can examine d/$attr's
   # state while cp is running.
index a19b8ab..fa20ce9 100755 (executable)
@@ -38,17 +38,14 @@ fail=0
 free_kb=`df -kP .|tail -1|sed 's/ [0-9][0-9]*%.*//;s/ *$//;s/.* //'`
 case "$free_kb" in
   [0-9]*) ;;
-  *) echo "invalid size from df: $free_kb" 1>&2; (exit 77); exit 77;;
+  *) skip_test_ "invalid size from df: $free_kb";;
 esac
 
 # Require about 3GB free.
 min_kb=3000000
 test $min_kb -lt $free_kb ||
 {
-  echo "$0: skipping this test:"
-  echo "too little free space on current partition: $free_kb (need $min_kb KB)" \
-    1>&2;
-  (exit 77); exit 77
+  skip_test_ "too little free space on current partition: $free_kb (need $min_kb KB)"
 }
 
 big=big
index 29d48c2..ab6dedd 100755 (executable)
@@ -27,9 +27,8 @@ fi
 
 dd bs=1 seek=8G of=big < /dev/null 2> /dev/null
 if test $? != 0; then
-  echo "$0: cannot create a file large enough for this test; possibly" 1>&2
-  echo "$0: because file offsets are only 32 bits on this file system" 1>&2
-  (exit 77); exit 77
+  skip_test_ 'cannot create a file large enough for this test; possibly
+because file offsets are only 32 bits on this file system'
 fi
 
 # FIXME: this should be a test of dd.
@@ -40,10 +39,9 @@ fi
 set x `ls -gG big`
 size=$4
 if test "$size" = 0; then
-  echo "$0: cannot create a file large enough for this test;" 1>&2
-  echo "$0: possibly because this system's NFS support is buggy;" 1>&2
-  echo "$0: Consider rerunning this test on a different file system." 1>&2
-  (exit 77); exit 77
+  skip_test_ "cannot create a file large enough for this test
+possibly because this system's NFS support is buggy
+Consider rerunning this test on a different file system."
 fi
 
 fail=0
index 64c35b9..cdc81dc 100755 (executable)
@@ -37,11 +37,7 @@ fi
 
 proc_file=/proc/self/fd
 if test ! -d $proc_file; then
-  cat <<EOF >&2
-$0: Skipping this test.
-It would fail, since your system lacks /proc support.
-EOF
-  (exit 77); exit 77
+  skip_test_ 'This test would fail, since your system lacks /proc support.'
 fi
 
 dir=`printf '%200s\n' ' '|tr ' ' x`
index f6adf72..603f1f0 100755 (executable)
@@ -58,14 +58,9 @@ echo foo > $i
 # renders it as `Number of symbolic links encountered during path
 # name traversal exceeds MAXSYMLINKS'.
 
-cat $file > /dev/null 2> err && \
-  {
-    cat <<EOF >&2
-$0: Your system appears to be able to handle more than $n symlinks
-in file name resolution, so skipping this test.
-EOF
-    (exit 77); exit 77
-  }
+cat $file > /dev/null 2> err &&
+    skip_test_ 'Your system appears to be able to handle more than $n symlinks
+in file name resolution'
 too_many=`sed 's/.*: //' err`
 
 fail=0
index e9f7bbd..be5a63d 100755 (executable)
@@ -30,22 +30,19 @@ fi
 if df --local . >/dev/null 2>&1; then
   : # Ok.
 else
-  echo "$0: skipping this test, since \`.' is on a non-local file system" 1>&2
-  (exit 77); exit 77
+  skip_test_ "\`.' is on a non-local file system"
 fi
 
 if df --type=xfs . >/dev/null 2>&1; then
   # At least on Irix-6.5.19, when using an xfs file system,
   # each created symlink (name lengths up to 255) would have a size of `0'.
-  echo "$0: skipping this test, since \`.' is on an XFS file system" 1>&2
-  (exit 77); exit 77
+  skip_test_ "\`.' is on an XFS file system"
 fi
 
 if df --type=nfsv3 . >/dev/null 2>&1; then
   # At least on OSF/1 4.0d, when using an nfsv3 file system,
   # each created symlink can end up having a size of 0.
-  echo "$0: skipping this test, since \`.' is on an NFS file system" 1>&2
-  (exit 77); exit 77
+  skip_test_ "\`.' is on an NFS file system"
 fi
 
 fail=0
index 7512c18..a78846c 100755 (executable)
@@ -34,8 +34,7 @@ $PERL -e 1 > /dev/null 2>&1 || {
 nameless_uid=`$PERL -e 'foreach my $i (1000..16*1024) { getpwuid $i or (print "$i\n"), exit }'`
 
 if test x$nameless_uid = x; then
-  echo "$0: couldn't find a nameless UID" 1>&2
-  (exit 77); exit 77
+  skip_test_ "couldn't find a nameless UID"
 fi
 
 touch f || framework_failure
index c5ea4f5..5e1776e 100755 (executable)
@@ -34,9 +34,7 @@ fi
 mkdir -p c/d || framework_failure
 chmod a-x c || framework_failure
 if test "X`ls -p c 2>&1`" != Xd/; then
-  echo "$0: '.' is not on a suitable file system for this test" 1>&2
-  echo "$0: skipping this test" 1>&2
-  (exit 77); exit 77
+  skip_test_ "'.' is not on a suitable file system for this test"
 fi
 
 mkdir d || framework_failure
index 942fa93..c568b48 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+. $srcdir/../test-lib.sh
+
 # skip this test if arch isn't being built.
 case " $built_programs " in
   *" arch "*) ;;
-  *) (exit 77); exit 77 ;;
+  *) skip_test_ 'not building arch';;
 esac
 
 if test "$VERBOSE" = yes; then
@@ -27,9 +29,6 @@ if test "$VERBOSE" = yes; then
   arch --version
 fi
 
-. $srcdir/../test-lib.sh
-
-
 fail=0
 
 arch > out || fail=1
index 84265e1..02bb26a 100755 (executable)
@@ -2,7 +2,7 @@
 # Ensure that cat -E produces same output as cat, module `$'s,
 # even when applied to a file in /proc.
 
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -27,10 +27,7 @@ fi
 
 f=/proc/cpuinfo
 test -f $f \
-  || {
-       echo "$0: no $f skipping this test" 1>&2
-       (exit 77); exit 77
-     }
+  || skip_test_ "no $f"
 
 fail=0
 
index e20f0be..df3254e 100755 (executable)
@@ -36,9 +36,7 @@ rm -f 'a
 b'
 
 if test $filename_may_contain_newline = no; then
-  echo 1>&2 "$0: can't create newline-containing file name," \
-    "so can't run this test"
-  exit 77
+  skip_test_ "failed to create newline-containing file name"
 fi
 
 me=`echo $0|sed 's,.*/,,'`
index 6b063da..2e9d3c1 100755 (executable)
@@ -58,8 +58,7 @@ niceness=`nice`
 if test "$niceness" = 0; then
     : ok
 else
-  echo "$0: this test must be run at nice level 0" 1>&2
-  exit 77
+  skip_test_ "this test must be run at nice level 0"
 fi
 
 fail=0
index dc1ec00..852ddf4 100755 (executable)
@@ -24,10 +24,8 @@ fi
 
 . $srcdir/../test-lib.sh
 
-od -t x8 /dev/null >/dev/null || {
-  echo >&2 "$0: 8-byte test skipped"
-  exit 77
-}
+od -t x8 /dev/null >/dev/null ||
+  skip_test_ "od lacks support for 8-byte quantities"
 
 echo abcdefgh |tr -d '\n' > in || framework_failure
 
index f3ff874..c7cde75 100755 (executable)
@@ -27,18 +27,12 @@ fi
 . $srcdir/../test-lib.sh
 
 test $host_os != linux-gnu &&
-  {
-    echo 1>&2 "$0: vendor getcwd may be inadequate; skipping this test"
-    (exit 77); exit 77
-  }
+  skip_test_ 'vendor getcwd may be inadequate'
 
 # Linux ia64 has the gl_FUNC_GETCWD_ABORT_BUG, so we can't use
 # the system getcwd.
 test $REPLACE_GETCWD = 1 &&
-  {
-    echo 1>&2 "$0: can't use buggy system getcwd; skipping this test"
-    (exit 77); exit 77
-  }
+  skip_test_ "can't use buggy system getcwd; skipping this test"
 
 mkdir -p a/b || framework_failure
 cd a/b || framework_failure
index 542d6e7..87d1a8d 100755 (executable)
@@ -25,10 +25,8 @@ fail=0
 ctx=root:object_r:tmp_t
 # FIXME, what if $ctx is no different from the default.  Not likely.
 # give each a different context, via chcon
-chcon $ctx f d p 2>/dev/null || {
-  echo 1>&2 'skipping this test: "chcon '$ctx' ..." failed'
-  (exit 77); exit 77
-}
+chcon $ctx f d p 2>/dev/null ||
+  skip_test_ '"chcon '$ctx' ..." failed'
 
 # inspect that context with both ls -Z and stat.
 for i in d f p; do
index 3fb3871..eb84499 100755 (executable)
@@ -58,8 +58,7 @@ NA LAST NA
 set $tests
 
 saved_size=`stty size` && test -n "$saved_size" \
-  || { echo "$0: skipping this test: can't get window size" 1>&2;
-       exit 77; exit; }
+  || skip_test_ "can't get window size"
 
 fail=0
 while :; do
index 0c13194..efc87f0 100755 (executable)
@@ -28,8 +28,7 @@ fi
 
 # See if the envvar is defined.
 if test x = "x$FULL_PARTITION_TMPDIR"; then
-  echo "$0: FULL_PARTITION_TMPDIR not defined; skipping this test" 1>&2
-  (exit 77); exit 77
+  skip_test_ "FULL_PARTITION_TMPDIR not defined"
 fi
 
 if ! test -d "$FULL_PARTITION_TMPDIR"; then
index f60f680..14be686 100755 (executable)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Skip this test if cp was built without ACL support:
-grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null && \
-  {
-    echo 1>&2 "$0: insufficient ACL support, so skipping this test"
-    (exit 77); exit 77
-  }
+grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null &&
+  skip_test_ "insufficient ACL support"
 
 if test "$VERBOSE" = yes; then
   set -x
@@ -50,11 +47,7 @@ setfacl -m user:bin:rw $t1 || skip_partition=$other_partition_tmpdir
 acl1=`getfacl file` || skip_partition=.
 
 test $skip_partition != none &&
-  {
-    echo "$0: '$skip' is not on a suitable file system for this test" 1>&2
-    echo "$0: skipping this test" 1>&2
-    (exit 77); exit 77
-  }
+  skip_test_ "'$skip' is not on a suitable file system for this test"
 
 # move the access acl of a file
 mv file $other_partition_tmpdir || fail=1
index 15f25ce..efac633 100755 (executable)
@@ -33,7 +33,7 @@ chmod 0 g i || framework_failure
 fail=0
 
 ls /dev/stdin >/dev/null 2>&1 \
-  || { (exit 77); exit; }
+  || skip_test_ 'there is no /dev/stdin file'
 
 mv f g < /dev/stdin > out 2>&1 & pid=$!
 sleep 1
index 7f3a926..6fbdc8b 100755 (executable)
@@ -30,10 +30,8 @@ touch f || framework_failure
 # Skip this test if there's an underlying kernel bug.
 mkdir a b b/a || framework_failure
 
-mv a b || {
-  echo "$0: skipping this test: your kernel's rename syscall is buggy" 1>&2
-  (exit 77); exit 77
-}
+mv a b ||
+  skip_test_ "your kernel's rename syscall is buggy"
 
 fail=0
 
index baee6d5..a4f7779 100755 (executable)
@@ -44,16 +44,14 @@ for d in $CANDIDATE_TMP_DIRS; do
 done
 
 if test -z "$other_partition_tmpdir"; then
-  cat <<EOF 1>&2
-**************************************
+  skip_test_ \
+"**************************************
 This test requires a writable directory on a different
 disk partition, and I couldn't find one.  I tried these:
   $CANDIDATE_TMP_DIRS
 Set your environment variable CANDIDATE_TMP_DIRS to make
 this test use a different list.
-**************************************
-EOF
-  (exit 77); exit 77
+**************************************"
 fi
 
 test "$VERBOSE" = yes && set -x
index a2af5be..1384a2f 100755 (executable)
 : ${PERL=perl}
 : ${srcdir=.}
 
-$PERL -e 'use warnings;' > /dev/null 2>&1 || {
-  echo 1>&2 "$0: configure didn't find a usable version of Perl," \
-    "so can't run this test"
-  exit 77
-}
+$PERL -e 'use warnings;' > /dev/null 2>&1 ||
+  skip_test_ "configure didn't find a usable version of Perl"
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
index 40b719b..c619574 100755 (executable)
@@ -32,11 +32,8 @@ PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
 : ${PERL=perl}
 : ${srcdir=.}
 
-$PERL -e 1 > /dev/null 2>&1 || {
-  echo 1>&2 "$0: configure didn't find a usable version of Perl," \
-    "so can't run this test"
-  (exit 77); exit 77
-}
+$PERL -e 1 > /dev/null 2>&1 ||
+  skip_test_ "configure didn't find a usable version of Perl"
 
 ARGV_0=$0
 export ARGV_0
index 8d05b3e..ca82a2c 100755 (executable)
@@ -30,8 +30,7 @@ skip=yes
 grep '^#define HAVE_OPENAT' $CONFIG_HEADER > /dev/null && skip=no
 test -d /proc/self/fd && skip=no
 if test $skip = yes; then
-  echo 1>&2 "$0: no openat support, so skipping this test"
-  (exit 77); exit 77
+  skip_test_ 'this system lacks openat support'
 fi
 
 . $srcdir/../test-lib.sh
index cb3f0fd..040d975 100755 (executable)
@@ -29,7 +29,7 @@ fail=0
 
 # Skip this test if there is no /dev/stdin file.
 ls /dev/stdin >/dev/null 2>&1 \
-  || { (exit 77); exit; }
+  || skip_test_ 'there is no /dev/stdin file'
 
 touch f
 chmod 0 f
index 16c4c92..05024c2 100755 (executable)
 : ${PERL=perl}
 : ${srcdir=.}
 
-$PERL -e 'use warnings;' > /dev/null 2>&1 || {
-  echo 1>&2 "$0: configure didn't find a usable version of Perl," \
-    "so can't run this test"
-  exit 77
-}
+$PERL -e 'use warnings;' > /dev/null 2>&1 ||
+  skip_test_ "configure didn't find a usable version of Perl"
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
index 20eba30..9fca2b7 100644 (file)
@@ -2,7 +2,7 @@
 # Disable the current test if the working directory seems to have
 # the setgid bit set.
 
-# Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002, 2004, 2005, 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
@@ -33,9 +33,5 @@ case $p in
   *) cwd_is_setgid=yes;;
 esac
 if test $cwd_is_setgid = yes; then
-  cat <<EOF >&2
-$0: Since it looks like you're running this test in a directory with
-the setgid bit set, we're skipping this test.
-EOF
-  (exit 77); exit 77
+  skip_test_ 'this directory has the setgid bit set'
 fi
index 733d9cd..4f98bfb 100644 (file)
@@ -1,7 +1,7 @@
 # -*- sh -*-
 # Does the current (working-dir.) file system support sparse files?
 
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -25,7 +25,5 @@ set x `du -sk $t`
 kb_size=$2
 rm -f $t
 if test $kb_size -ge 128; then
-  echo "$0: skipping this test, since this file system doesn't support" \
-    sparse files 1>&2
-  (exit 77); exit 77
+  skip_test_ 'this file system does not support sparse files'
 fi
index aee28a0..bc04fb3 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 strace -V < /dev/null > /dev/null 2>&1 ||
-{
-  echo "$0: no strace program, so skipping this test" 1>&2
-  (exit 77); exit 77
-}
+  skip_test_ 'no strace program'
 
 strace -qe unlink echo > /dev/null 2>&1 ||
-{
-  echo "$0: strace doesn't work, so skipping this test" 1>&2
-  (exit 77); exit 77
-}
+  skip_test_ 'strace does not work'
index 94adba5..606ed33 100755 (executable)
@@ -32,8 +32,7 @@ chattr +a f 2>/dev/null || chattr_a_works=0
 echo x >> f || chattr_a_works=0
 
 if test $chattr_a_works = 0; then
-  echo "$0: chattr +a doesn't work on this file system; skipping this test " 1>&2
-  (exit 77); exit 77
+  skip_test_ "chattr +a doesn't work on this file system"
 fi
 
 fail=0
index 5494e3d..27319f9 100755 (executable)
@@ -35,10 +35,10 @@ echo 87654321 | tr -d '\n' > tmp || framework_failure
 dd bs=1 seek=4294967288 if=tmp of=big 2> err || dd_failed=1
 if test "$dd_failed" = 1; then
   cat err 1>&2
-  echo "$0: cannot create a file large enough for this test," 1>&2
-  echo "$0: possibly because this system doesn't support large files;" 1>&2
-  echo "$0: Consider rerunning this test on a different file system." 1>&2
-  (exit 77); exit 77
+  skip_test_ \
+'cannot create a file large enough for this test,
+possibly because this system does not support large files;
+Consider rerunning this test on a different file system.'
 fi
 
 fail=0
index de5786e..3e3bc1c 100755 (executable)
@@ -31,11 +31,8 @@ fi
 sleep 2 &
 pid=$!
 sleep .5
-grep '^State:[  ]*[S]' /proc/$pid/status > /dev/null 2>&1 || \
-  {
-    echo "$0:/proc/$pid/status: missing or 'different': skipping this test" 1>&2
-    (exit 77); exit 77
-  }
+grep '^State:[  ]*[S]' /proc/$pid/status > /dev/null 2>&1 ||
+  skip_test_ "/proc/$pid/status: missing or 'different'"
 kill $pid
 
 touch empty || framework_failure
index 908f30a..3c5cbdc 100755 (executable)
@@ -39,14 +39,12 @@ if test $fail = 1; then
     *linux-gnu*)
       case "`uname -r`" in
         2.3.9[0-9]*)
-         cat 1>&2 <<EOF
-====================================================
-$0: WARNING!!!
+         skip_test_ \
+'****************************************************
+WARNING!!!
 This version of the Linux kernel causes touch to fail
 when operating on dangling symlinks.
-====================================================
-EOF
-         exit 77
+****************************************************'
          ;;
       esac
       ;;
index 796d330..400c922 100755 (executable)
@@ -28,10 +28,7 @@ if ! mkfifo fifo; then
   # failure as a test failure.  However, in this case, when running on a SunOS
   # system using a disk NFS mounted from OpenBSD, the above fails like this:
   # mkfifo: cannot make fifo `fifo-10558': Not owner
-  echo '********************************************'
-  echo 'NOTICE: unable to create test prerequisites'
-  echo '********************************************'
-  exit 77
+  skip_test_ 'NOTICE: unable to create test prerequisites'
 fi
 
 fail=0
index 9abb36b..4024e03 100755 (executable)
@@ -26,13 +26,11 @@ fi
 
 test=../../src/test
 if $test -w /; then
-  echo Skipping because you have write access to /.
-  (exit 77); exit 77
+  skip_test_ you have write access to /.
 fi
 
 if $test -O / || $test -G /; then
-  echo Skipping because you own /.
-  (exit 77); exit 77
+  skip_test_ "you own /."
 fi
 
 . $srcdir/../test-lib.sh
index bb0fa38..238d658 100644 (file)
@@ -1,7 +1,7 @@
 # -*- sh -*-
 # Disable the current test if umask doesn't work as usual.
 
-# Copyright (C) 2005 Free Software Foundation, Inc.
+# Copyright (C) 2005, 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
@@ -27,10 +27,5 @@ rm -f file1 file2
 
 case $perms in
 *'
-'*)
-  cat <<EOF >&2
-$0: Since it looks like you're running this test in a directory with
-something other than the usual umask semantics, we're skipping this test.
-EOF
-  (exit 77); exit 77
+'*) skip_test_ 'your build directory has unusual umask semantics'
 esac