From 4af32c62fa58570a97d705fc0340704e9faa1a1f Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Thu, 30 Aug 2012 14:13:13 +0200 Subject: tests: get rid of the 'shell-or-perl' auxiliary script It's now easier and faster to simply run the perl ans shell test scripts directly with the appropriate interpreter and options. * tests/shell-or-perl: Delete. * tests/Makefile.am (EXTRA_DIST): Remove it. (SH_LOG_COMPILER): Re-define to invoke the correct shell. (PL_LOG_COMPILER): Re-define to invoke the correct perl interpreter ... (TESTSUITE_PERL_OPTIONS): ... with the correct options. (XPL_LOG_COMPILER): Use those options instead of inlining their expansion. (LOG_COMPILER): Delete, no longer needed. --- tests/Makefile.am | 22 +++++------ tests/shell-or-perl | 109 ---------------------------------------------------- 2 files changed, 9 insertions(+), 122 deletions(-) delete mode 100644 tests/shell-or-perl (limited to 'tests') 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 <