]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: factor out the perl-requiring code in many test scripts
authorJim Meyering <meyering@redhat.com>
Thu, 6 Dec 2007 13:21:51 +0000 (14:21 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 9 Feb 2008 09:30:33 +0000 (10:30 +0100)
* tests/require-perl: New file.
* tests/Makefile.am (EXTRA_DIST): Add require-perl.
* tests/dd/skip-seek: Use it, and remove manual tests.
* tests/du/files0-from: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/misc/base64: Likewise.
* tests/misc/basename: Likewise.
* tests/misc/cut: Likewise.
* tests/misc/date: Likewise.
* tests/misc/dircolors: Likewise.
* tests/misc/dirname: Likewise.
* tests/misc/expand: Likewise.
* tests/misc/expr: Likewise.
* tests/misc/factor: Likewise.
* tests/misc/fmt: Likewise.
* tests/misc/fold: Likewise.
* tests/misc/head-elide-tail: Likewise.
* tests/misc/ls-misc: Likewise.
* tests/misc/md5sum: Likewise.
* tests/misc/md5sum-newline: Likewise.
* tests/misc/mktemp: Likewise.
* tests/misc/od: Likewise.
* tests/misc/paste-no-nl: Likewise.
* tests/misc/pr: Likewise.
* tests/misc/pwd-long: Likewise.
* tests/misc/seq: Likewise.
* tests/misc/sha1sum: Likewise.
* tests/misc/sha1sum-vec: Likewise.
* tests/misc/sha224sum: Likewise.
* tests/misc/sha256sum: Likewise.
* tests/misc/sha384sum: Likewise.
* tests/misc/sha512sum: Likewise.
* tests/misc/sort-merge: Likewise.
* tests/misc/stat-printf: Likewise.
* tests/misc/sum: Likewise.
* tests/misc/sum-sysv: Likewise.
* tests/misc/test-diag: Likewise.
* tests/misc/tsort: Likewise.
* tests/misc/tty-eof: Likewise.
* tests/misc/unexpand: Likewise.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/xstrtol: Likewise.
* tests/mv/i-1: Likewise.
* tests/rm/empty-name: Likewise.
* tests/rm/fail-eperm: Likewise.
* tests/rm/unreadable: Likewise.

(EXTRA_DIST): *do* require require-perl as a stand-alone, 'source'able script.

46 files changed:
tests/Makefile.am
tests/dd/skip-seek
tests/du/files0-from
tests/ls/nameless-uid
tests/misc/base64
tests/misc/basename
tests/misc/cut
tests/misc/date
tests/misc/dircolors
tests/misc/dirname
tests/misc/expand
tests/misc/expr
tests/misc/factor
tests/misc/fmt
tests/misc/fold
tests/misc/head-elide-tail
tests/misc/ls-misc
tests/misc/md5sum
tests/misc/md5sum-newline
tests/misc/mktemp
tests/misc/od
tests/misc/paste-no-nl
tests/misc/pr
tests/misc/pwd-long
tests/misc/seq
tests/misc/sha1sum
tests/misc/sha1sum-vec
tests/misc/sha224sum
tests/misc/sha256sum
tests/misc/sha384sum
tests/misc/sha512sum
tests/misc/sort-merge
tests/misc/stat-printf
tests/misc/sum
tests/misc/sum-sysv
tests/misc/test-diag
tests/misc/tsort
tests/misc/tty-eof
tests/misc/unexpand
tests/misc/wc-files0-from
tests/misc/xstrtol
tests/mv/i-1
tests/require-perl [new file with mode: 0644]
tests/rm/empty-name
tests/rm/fail-eperm
tests/rm/unreadable

index ede6310652d98300c3504122913089b51ac6b4c3..d955dd74f4f14e788cf8580b6d1d949caa7a5470 100644 (file)
@@ -20,7 +20,7 @@ EXTRA_DIST =          \
   lang-default         \
   mk-script            \
   other-fs-tmpdir      \
-  priv-check           \
+  require-perl         \
   rwx-to-mode          \
   sample-test          \
   setgid-check         \
index f2c0393fe5c6b5935513a1f58f7373f2c22d0c17..ce0121c62b14316f938e70e87b0fea302c7901f4 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 SCRIPT_NAME=$0
 export SCRIPT_NAME
index 88f83aab929b5fd920e90a868f09af547a60cf6e..4d9b37cb329d01a72360dbd5570759eb3612c4bb 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- perl -*-
 # Exercise du's --files0-from option.
 
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index a78846ca40d94757bfbbea9ddfd86e7dca2fa048..a72438863d8b6c1e0831f6d5476128c32557212d 100755 (executable)
@@ -21,16 +21,13 @@ if test "$VERBOSE" = yes; then
   ls --version
 fi
 
+: ${srcdir=.}
+. $srcdir/../require-perl
+
 . $srcdir/../lang-default
 PRIV_CHECK_ARG=require-root . $srcdir/../priv-check
 . $srcdir/../test-lib.sh
 
-$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
-}
-
 nameless_uid=`$PERL -e 'foreach my $i (1000..16*1024) { getpwuid $i or (print "$i\n"), exit }'`
 
 if test x$nameless_uid = x; then
index 3276635e8c6a7c510e254d73b0327fac374ef56d..0428c04c52c0944ff2385d3d28134ea150897157 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
@@ -164,7 +156,7 @@ push @Tests, @new;
 my $save_temps = $ENV{DEBUG};
 my $verbose = $ENV{VERBOSE};
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'base64';
 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
 exit $fail;
 EOF
index e492b9e0ddf86c5f2f0e19d771cd0177f4c67cc6..4302e0b82c367498f242a65085138f52059f83ef 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
@@ -43,7 +35,7 @@ my $stat_double = stat('//');
 my $double_slash = ($stat_single->dev == $stat_double->dev
                    && $stat_single->ino == $stat_double->ino) ? '/' : '//';
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'basename';
 
 my @Tests =
     (
index 2fc4bed0537fb7047eb6d7bd63e83ab8b246bb59..3bf52163db079034c05cc5f63aef6822a2e2dce2 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 4a87e648ade5a0bd3bce503fad8ad0a75f96f7be..ff18b4c0f43c0e05424e9b4a8bb6bd23d6ada6d3 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 01f2211287b0ec4589d489519910320498c31dbe..31614f9dae64527cd82d93a40dd7315f78defc7b 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 0530175bf0f4f2519bfff2195db9fe4ffc283e79..6b9a8d7b75b3a1a2ff3fadf4a8a9d1d26a779231 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
@@ -44,7 +36,7 @@ my $stat_double = stat('//');
 my $double_slash = ($stat_single->dev == $stat_double->dev
                    && $stat_single->ino == $stat_double->ino) ? '/' : '//';
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'dirname';
 
 my @Tests =
     (
index b58ff2970c5e92e742f60dd35cb991d84bbe7f5e..6a568be8084a8fa57d3babc10698f85e21808b0a 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
@@ -49,7 +41,7 @@ my @Tests =
 my $save_temps = $ENV{DEBUG};
 my $verbose = $ENV{VERBOSE};
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'expand';
 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
 exit $fail;
 EOF
index 360d9058386b12c52962dea6c457f448142cc805..6d2cbbd1fe9ea1c7f8a062d5ee58420204c5b8a5 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
index ebe0d6434111b4eca836c62f73c0da68db610855..a350ca9e3601336f01cdd5feecf58765af12c5f9 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
index 0cc9ba25191706646241527034d69169f918e5f4..49067ad9be5a1fa5c8af1fdce2355ac785197aa9 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 # Export this to avoid hassles when run in a UTF-8 locale,
 # since we use 8-bit characters below, and those values are
index a43ebf12f89b5833c36be804fa3e2ff08436d8d6..960d6893d0b89bb6a1a8282e13c819b5482d899e 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 # Ensure that we don't run an older version of fold.
 # Prior to 5.0.91, some of the tests below would cause fold to infloop,
@@ -63,7 +55,7 @@ my @Tests =
 my $save_temps = $ENV{DEBUG};
 my $verbose = $ENV{VERBOSE};
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'fold';
 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
 exit $fail;
 EOF
index 4bdcf535bf783a2ec359a7f11baf67774782400c..4de108d4af04108fb46867615b373d481af54455 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- perl -*-
 # Exercise head's --bytes=-N option.
 
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 9e07065774e347c26721d19a7d9122fec199355b..9290eb4d750545e8184d6d63497368fb716eeaf2 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
index 1b12e83adaf291074532e54754e7f08a55c3e099..ca23d9432bcc142795ac327c6c0e4014793ad28d 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index df3254e715427ae5dc79f810d81a62ae83a803ad..41139816ac829186da1c4a12f4bf4ddef08351cd 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 # See if we can create a filename that contains a newline.
 # Be careful to do it in a subshell so that we can redirect the
index ed4b3c2bfcfbe0d41174d7c3440921e386860e64..affb0d17c3b5118411cd3241d79c75bb4326e09f 100755 (executable)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index bf41c3846561110506329750ef45f77fb5199f88..498e57a85dc26279c99b1b46c4832641e90dc0cb 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 me=`echo $0|sed 's,.*/,,'`
@@ -78,7 +70,7 @@ my @Tests =
 my $save_temps = $ENV{DEBUG};
 my $verbose = $ENV{VERBOSE};
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'od';
 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
 exit $fail;
 EOF
index aa5049c7a559a60a26ba534c08c76e189793d91e..ec23991826abc4fb0dd01991a306cfec52115d26 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- perl -*-
 # Ensure that paste properly handles files lacking a final newline.
 
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 0b7e0a210711b6c8bb287026096118b5b6724a05..550c6d6f20426dd535e5201954184f6fc1d99c11 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 5e5b5ad5d8b482d6b806e46af385e5718ff5ced4..6ab218810007a8ff80edee87703b571da28ce175 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/>.
 
-: ${PERL=perl}
-
-$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
-}
+: ${srcdir=.}
+. $srcdir/../require-perl
 
 . $srcdir/../test-lib.sh
 
index 3365d9521a1b3d5dc306b65ba8ff19b75ffc3121..9c1e48f01d2c3732d133f4116b2782c2fd0d055c 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
index 62de889d733bb31deb7073444677edde4f9dc972..b7d288fa24b052fa7237eef76599f3772539f8a6 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 2dd666c39cc55892c6a8ac5b9397ad460b1c40a7..b00ece284d8e4a8f8238a41baa3768629c35db06 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 1fdfd3d50b13158c7963ba722c708bbe275ced3d..022379cad0dcf40d85af754f6bfa4b554a70556a 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
@@ -58,7 +50,7 @@ foreach $t (@Tests)
 my $save_temps = $ENV{DEBUG};
 my $verbose = $ENV{VERBOSE};
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'sha224sum';
 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
 exit $fail;
 EOF
index f4f25d8631c6650d1e4336037757d32464178c6c..f28ef8ff19a5c3fed10b91fd90817a38918847c8 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
@@ -64,7 +56,7 @@ foreach $t (@Tests)
 my $save_temps = $ENV{DEBUG};
 my $verbose = $ENV{VERBOSE};
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'sha256sum';
 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
 exit $fail;
 EOF
index bfb9ed092150c2e230672b306247260611a0f43f..0eb55872f6e90993b00e831e8dea4d3f7db89cac 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
@@ -64,7 +56,7 @@ foreach $t (@Tests)
 my $save_temps = $ENV{DEBUG};
 my $verbose = $ENV{VERBOSE};
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'sha384sum';
 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
 exit $fail;
 EOF
index 55798fc7072bfa46064f971bddee8fd6330302fd..5977915fc8ee99fb2cf952449944bb25aa5dedbe 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
@@ -64,7 +56,7 @@ foreach $t (@Tests)
 my $save_temps = $ENV{DEBUG};
 my $verbose = $ENV{VERBOSE};
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'sha512sum';
 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
 exit $fail;
 EOF
index 2795b60f5ff912d1c45c555263bac1c84bfbc0f0..7ac9f8440252a7970d7fbb95242eb1e4000794ec 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Test "sort -m".
 
-# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 60d7b6ffa0dfcd9c686bd33a9dfe7f2c1c997e53..f175ba1f09146113330d8a865aa7c4532a125a76 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Test "stat --printf".
 
-# Copyright (C) 2005, 2006 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index d87bdd03febeb171286abf1de323ddc3e179faeb..14871ec2d56c32c7e2948d981ae9764861a03760 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 5181cff0a5f3b00a9ec636475bb76842222907cb..d960f9818e72291e62902ad2105146b2e8071a54 100755 (executable)
@@ -21,11 +21,8 @@ if test "$VERBOSE" = yes; then
   sum --version
 fi
 
-$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
-}
+: ${srcdir=.}
+. $srcdir/../require-perl
 
 # Avoid a problem when run in a UTF-8 locale.
 # Otherwise, Perl would try to (and fail to) interpret
index 9f0c7cd70c62d399b951ca26e084ae80b7877226..b7d899b6311d1e8a0846d9cc4126431796fa5677 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 9a078aec451435bd6aad98ca82ff5cd1b9c2d243..440c60e2dc0406a44a5f2e9527f1439d7e19ac0f 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 086f19cd67383306a57592f4691d31e5a1d3d71b..1de1d1f82b1df36f69185a2d35d4d1b0a5533320 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/>.
 
-: ${PERL=perl}
-
-$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
-}
+: ${srcdir=.}
+. $srcdir/../require-perl
 
 # Ensure that $TMPDIR is valid.
 TMPDIR=.; export TMPDIR
index e35434403a40d316a7ad6e21a75de5bd93a5040d..d2762f12a62930926c15b8db5b14899af00a262c 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 6d0bb8c9942ad09f9451f359df69f1d93d8907da..61340d66a164682b3c7bbdfbcabcda225f01e17c 100755 (executable)
@@ -3,7 +3,7 @@
 # Exercise wc's --files0-from option.
 # This file bears a striking resemblance to tests/du/files0-from.
 
-# 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-
-PROG=`echo $0|sed 's,.*/,,'`; export PROG
-
-$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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 7fdc4da56cca87a42296a2a11eb71f7565ef7314..874b4a502f71f9d3e4d748b9420154b263349772 100755 (executable)
@@ -21,14 +21,8 @@ if test "$VERBOSE" = yes; then
   pr --version
 fi
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
index 0fee59cb25698466a6473f99454af0dcc7ff4f1d..326d72e1a41df1e4e2aad3148d91982d30aa191f 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/>.
 
-: ${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
-}
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
diff --git a/tests/require-perl b/tests/require-perl
new file mode 100644 (file)
index 0000000..1f98edf
--- /dev/null
@@ -0,0 +1,6 @@
+: ${PERL=perl}
+$PERL -e 'use warnings' > /dev/null 2>&1 || {
+  echo 1>&2 "$0: configure did not find a usable version of Perl," \
+    "so skipping this test"
+  (exit 77); exit 77
+}
index 1384a2fd15aa9e85f5210d86bab1980648f53f68..a250985c9606cb7c135f0ad27fc888b768d1989a 100755 (executable)
 # actually remove files with names of entries in the current directory
 # but relative to `/' rather than relative to the current directory.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-$PERL -e 'use warnings;' > /dev/null 2>&1 ||
-  skip_test_ "configure didn't find a usable version of Perl"
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
index c619574ce8a20f187ba806ea67c52916206b42aa..4abc9dec6722b47af541ea4add902bf0a5a9a8d8 100755 (executable)
@@ -29,11 +29,8 @@ fi
 
 PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-$PERL -e 1 > /dev/null 2>&1 ||
-  skip_test_ "configure didn't find a usable version of Perl"
+. $srcdir/../require-perl
 
 ARGV_0=$0
 export ARGV_0
index 05024c2dc8fa389ce19939b3c595268d7898311c..4fb40235c3146b5687071ea38dc926bd6c8c0535 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/>.
 
-: ${PERL=perl}
 : ${srcdir=.}
-
-$PERL -e 'use warnings;' > /dev/null 2>&1 ||
-  skip_test_ "configure didn't find a usable version of Perl"
+. $srcdir/../require-perl
 
 me=`echo $0|sed 's,.*/,,'`
 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF