diff --git a/tests/Makefile.am b/tests/Makefile.am
index a547b1181..bc3d30892 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -53,22 +53,19 @@ else
TESTSUITE_PERL = $(SHELL) $(srcdir)/no-perl
endif
+# Options passed to the perl invocations running the perl test scripts.
+TESTSUITE_PERL_OPTIONS = -w -I$(srcdir) -MCoreutils -MCuSkip
# '$f' is set by the Automake-generated test harness to the path of the
# current test script stripped of VPATH components, and is used by the
-# shell-or-perl script to determine the name of the temporary files to be
-# used. Note that $f is a shell variable, not a make macro, so the use of
-# '$$f' below is correct, and not a typo.
-LOG_COMPILER = \
- $(SHELL) $(srcdir)/shell-or-perl \
- --test-name "$$f" --srcdir '$(srcdir)' \
- --shell '$(SHELL)' --perl '$(TESTSUITE_PERL)' --
-
-PL_LOG_COMPILER = $(LOG_COMPILER)
-SH_LOG_COMPILER = $(LOG_COMPILER)
+# CuTmpdir module to determine the name of the temporary files to be
+# used. Note that $f is a shell variable, not a make macro, so the use
+# of '$$f' below is correct, and not a typo.
+TESTSUITE_PERL_OPTIONS += -M"CuTmpdir qw($$f)"
+SH_LOG_COMPILER = $(SHELL)
+PL_LOG_COMPILER = $(TESTSUITE_PERL) $(TESTSUITE_PERL_OPTIONS)
# Perl scripts that must be run in tainted mode.
-XPL_LOG_COMPILER = \
- $(TESTSUITE_PERL) -wT -I$(srcdir) -MCoreutils -MCuSkip -M"CuTmpdir qw($$f)"
+XPL_LOG_COMPILER = $(TESTSUITE_PERL) -T $(TESTSUITE_PERL_OPTIONS)
# Note that the first lines are statements. They ensure that environment
# variables that can perturb tests are unset or set to expected values.
@@ -130,7 +127,6 @@ EXTRA_DIST = \
no-perl \
other-fs-tmpdir \
sample-test \
- shell-or-perl \
$(pr_data)
root_tests = \
diff --git a/tests/shell-or-perl b/tests/shell-or-perl
deleted file mode 100644
index 409db0ee7..000000000
--- a/tests/shell-or-perl
+++ /dev/null
@@ -1,109 +0,0 @@
-#! /bin/sh
-# Run a test script of the coreutils test scripts, picking up the right
-# interpreter (i.e., perl or the shell) and the right flags for it.
-#
-# Copyright (C) 2011-2012 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-
-# ---------------------------------- #
-# Readonly variables and functions #
-# ---------------------------------- #
-
-# Help to avoid typo-related bugs.
-set -u
-
-me=shell-or-perl
-
-fatal_ ()
-{
- echo "$me: $*" >&2
- # Exit with status '99' to inform the testsuite harness that an
- # hard error occurred.
- exit 99
-}
-
-print_help_ ()
-{
- cat <