summaryrefslogtreecommitdiff
path: root/tests/misc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc')
-rwxr-xr-xtests/misc/base6412
-rwxr-xr-xtests/misc/basename12
-rwxr-xr-xtests/misc/cut8
-rwxr-xr-xtests/misc/date8
-rwxr-xr-xtests/misc/dircolors8
-rwxr-xr-xtests/misc/dirname12
-rwxr-xr-xtests/misc/expand12
-rwxr-xr-xtests/misc/expr8
-rwxr-xr-xtests/misc/factor8
-rwxr-xr-xtests/misc/fmt8
-rwxr-xr-xtests/misc/fold12
-rwxr-xr-xtests/misc/head-elide-tail10
-rwxr-xr-xtests/misc/ls-misc8
-rwxr-xr-xtests/misc/md5sum8
-rwxr-xr-xtests/misc/md5sum-newline8
-rwxr-xr-xtests/misc/mktemp8
-rwxr-xr-xtests/misc/od12
-rwxr-xr-xtests/misc/paste-no-nl10
-rwxr-xr-xtests/misc/pr9
-rwxr-xr-xtests/misc/pwd-long9
-rwxr-xr-xtests/misc/seq8
-rwxr-xr-xtests/misc/sha1sum8
-rwxr-xr-xtests/misc/sha1sum-vec8
-rwxr-xr-xtests/misc/sha224sum12
-rwxr-xr-xtests/misc/sha256sum12
-rwxr-xr-xtests/misc/sha384sum12
-rwxr-xr-xtests/misc/sha512sum12
-rwxr-xr-xtests/misc/sort-merge10
-rwxr-xr-xtests/misc/stat-printf10
-rwxr-xr-xtests/misc/sum8
-rwxr-xr-xtests/misc/sum-sysv7
-rwxr-xr-xtests/misc/test-diag8
-rwxr-xr-xtests/misc/tsort8
-rwxr-xr-xtests/misc/tty-eof9
-rwxr-xr-xtests/misc/unexpand8
-rwxr-xr-xtests/misc/wc-files0-from13
-rwxr-xr-xtests/misc/xstrtol8
37 files changed, 55 insertions, 296 deletions
diff --git a/tests/misc/base64 b/tests/misc/base64
index 3276635e8..0428c04c5 100755
--- a/tests/misc/base64
+++ b/tests/misc/base64
@@ -17,16 +17,8 @@
# 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
diff --git a/tests/misc/basename b/tests/misc/basename
index e492b9e0d..4302e0b82 100755
--- a/tests/misc/basename
+++ b/tests/misc/basename
@@ -16,16 +16,8 @@
# 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 =
(
diff --git a/tests/misc/cut b/tests/misc/cut
index 2fc4bed05..3bf52163d 100755
--- a/tests/misc/cut
+++ b/tests/misc/cut
@@ -16,14 +16,8 @@
# 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/misc/date b/tests/misc/date
index 4a87e648a..ff18b4c0f 100755
--- a/tests/misc/date
+++ b/tests/misc/date
@@ -16,14 +16,8 @@
# 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/misc/dircolors b/tests/misc/dircolors
index 01f221128..31614f9da 100755
--- a/tests/misc/dircolors
+++ b/tests/misc/dircolors
@@ -16,14 +16,8 @@
# 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/misc/dirname b/tests/misc/dirname
index 0530175bf..6b9a8d7b7 100755
--- a/tests/misc/dirname
+++ b/tests/misc/dirname
@@ -17,16 +17,8 @@
# 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 =
(
diff --git a/tests/misc/expand b/tests/misc/expand
index b58ff2970..6a568be80 100755
--- a/tests/misc/expand
+++ b/tests/misc/expand
@@ -17,16 +17,8 @@
# 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
diff --git a/tests/misc/expr b/tests/misc/expr
index 360d90583..6d2cbbd1f 100755
--- a/tests/misc/expr
+++ b/tests/misc/expr
@@ -17,14 +17,8 @@
# 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/misc/factor b/tests/misc/factor
index ebe0d6434..a350ca9e3 100755
--- a/tests/misc/factor
+++ b/tests/misc/factor
@@ -18,14 +18,8 @@
# 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/misc/fmt b/tests/misc/fmt
index 0cc9ba251..49067ad9b 100755
--- a/tests/misc/fmt
+++ b/tests/misc/fmt
@@ -18,14 +18,8 @@
# 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
diff --git a/tests/misc/fold b/tests/misc/fold
index a43ebf12f..960d6893d 100755
--- a/tests/misc/fold
+++ b/tests/misc/fold
@@ -17,16 +17,8 @@
# 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
diff --git a/tests/misc/head-elide-tail b/tests/misc/head-elide-tail
index 4bdcf535b..4de108d4a 100755
--- a/tests/misc/head-elide-tail
+++ b/tests/misc/head-elide-tail
@@ -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
@@ -17,14 +17,8 @@
# 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/misc/ls-misc b/tests/misc/ls-misc
index 9e0706577..9290eb4d7 100755
--- a/tests/misc/ls-misc
+++ b/tests/misc/ls-misc
@@ -16,14 +16,8 @@
# 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/misc/md5sum b/tests/misc/md5sum
index 1b12e83ad..ca23d9432 100755
--- a/tests/misc/md5sum
+++ b/tests/misc/md5sum
@@ -16,14 +16,8 @@
# 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/misc/md5sum-newline b/tests/misc/md5sum-newline
index df3254e71..41139816a 100755
--- a/tests/misc/md5sum-newline
+++ b/tests/misc/md5sum-newline
@@ -16,14 +16,8 @@
# 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
diff --git a/tests/misc/mktemp b/tests/misc/mktemp
index ed4b3c2bf..affb0d17c 100755
--- a/tests/misc/mktemp
+++ b/tests/misc/mktemp
@@ -18,14 +18,8 @@
# 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
diff --git a/tests/misc/od b/tests/misc/od
index bf41c3846..498e57a85 100755
--- a/tests/misc/od
+++ b/tests/misc/od
@@ -17,16 +17,8 @@
# 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
diff --git a/tests/misc/paste-no-nl b/tests/misc/paste-no-nl
index aa5049c7a..ec2399182 100755
--- a/tests/misc/paste-no-nl
+++ b/tests/misc/paste-no-nl
@@ -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
@@ -17,14 +17,8 @@
# 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/misc/pr b/tests/misc/pr
index 0b7e0a210..550c6d6f2 100755
--- a/tests/misc/pr
+++ b/tests/misc/pr
@@ -17,15 +17,8 @@
# 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/misc/pwd-long b/tests/misc/pwd-long
index 5e5b5ad5d..6ab218810 100755
--- a/tests/misc/pwd-long
+++ b/tests/misc/pwd-long
@@ -16,13 +16,8 @@
# 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
diff --git a/tests/misc/seq b/tests/misc/seq
index 3365d9521..9c1e48f01 100755
--- a/tests/misc/seq
+++ b/tests/misc/seq
@@ -17,14 +17,8 @@
# 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/misc/sha1sum b/tests/misc/sha1sum
index 62de889d7..b7d288fa2 100755
--- a/tests/misc/sha1sum
+++ b/tests/misc/sha1sum
@@ -16,14 +16,8 @@
# 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/misc/sha1sum-vec b/tests/misc/sha1sum-vec
index 2dd666c39..b00ece284 100755
--- a/tests/misc/sha1sum-vec
+++ b/tests/misc/sha1sum-vec
@@ -16,14 +16,8 @@
# 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/misc/sha224sum b/tests/misc/sha224sum
index 1fdfd3d50..022379cad 100755
--- a/tests/misc/sha224sum
+++ b/tests/misc/sha224sum
@@ -16,16 +16,8 @@
# 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
diff --git a/tests/misc/sha256sum b/tests/misc/sha256sum
index f4f25d863..f28ef8ff1 100755
--- a/tests/misc/sha256sum
+++ b/tests/misc/sha256sum
@@ -16,16 +16,8 @@
# 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
diff --git a/tests/misc/sha384sum b/tests/misc/sha384sum
index bfb9ed092..0eb55872f 100755
--- a/tests/misc/sha384sum
+++ b/tests/misc/sha384sum
@@ -16,16 +16,8 @@
# 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
diff --git a/tests/misc/sha512sum b/tests/misc/sha512sum
index 55798fc70..5977915fc 100755
--- a/tests/misc/sha512sum
+++ b/tests/misc/sha512sum
@@ -16,16 +16,8 @@
# 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
diff --git a/tests/misc/sort-merge b/tests/misc/sort-merge
index 2795b60f5..7ac9f8440 100755
--- a/tests/misc/sort-merge
+++ b/tests/misc/sort-merge
@@ -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
@@ -16,14 +16,8 @@
# 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/misc/stat-printf b/tests/misc/stat-printf
index 60d7b6ffa..f175ba1f0 100755
--- a/tests/misc/stat-printf
+++ b/tests/misc/stat-printf
@@ -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
@@ -16,14 +16,8 @@
# 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/misc/sum b/tests/misc/sum
index d87bdd03f..14871ec2d 100755
--- a/tests/misc/sum
+++ b/tests/misc/sum
@@ -16,14 +16,8 @@
# 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/misc/sum-sysv b/tests/misc/sum-sysv
index 5181cff0a..d960f9818 100755
--- a/tests/misc/sum-sysv
+++ b/tests/misc/sum-sysv
@@ -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
diff --git a/tests/misc/test-diag b/tests/misc/test-diag
index 9f0c7cd70..b7d899b63 100755
--- a/tests/misc/test-diag
+++ b/tests/misc/test-diag
@@ -16,14 +16,8 @@
# 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/misc/tsort b/tests/misc/tsort
index 9a078aec4..440c60e2d 100755
--- a/tests/misc/tsort
+++ b/tests/misc/tsort
@@ -17,14 +17,8 @@
# 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/misc/tty-eof b/tests/misc/tty-eof
index 086f19cd6..1de1d1f82 100755
--- a/tests/misc/tty-eof
+++ b/tests/misc/tty-eof
@@ -17,13 +17,8 @@
# 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
diff --git a/tests/misc/unexpand b/tests/misc/unexpand
index e35434403..d2762f12a 100755
--- a/tests/misc/unexpand
+++ b/tests/misc/unexpand
@@ -16,14 +16,8 @@
# 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/misc/wc-files0-from b/tests/misc/wc-files0-from
index 6d0bb8c99..61340d66a 100755
--- a/tests/misc/wc-files0-from
+++ b/tests/misc/wc-files0-from
@@ -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
@@ -18,17 +18,8 @@
# 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
diff --git a/tests/misc/xstrtol b/tests/misc/xstrtol
index 7fdc4da56..874b4a502 100755
--- a/tests/misc/xstrtol
+++ b/tests/misc/xstrtol
@@ -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