summaryrefslogtreecommitdiff
path: root/tests/shell-or-perl
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-08-30 14:13:11 +0200
committerJim Meyering <meyering@redhat.com>2012-08-30 18:55:59 +0200
commit00f5ba15dd91a3d9780fe1fbd06a4df436ae6714 (patch)
tree34daa7c97bf72787c86d0c94fca9944ad805486b /tests/shell-or-perl
parente44178c59028e3c085a5c89014d44a4f647f3deb (diff)
downloadcoreutils-00f5ba15dd91a3d9780fe1fbd06a4df436ae6714.tar.xz
tests: detect missing perl at configure runtime
* configure.ac (AM_CONDITIONAL): Set the conditional 'HAVE_PERL' to true if the configure-time checks (as run by gl_PERL) have been able to find a working perl. * tests/no-perl: New script, report a diagnostic about "missing perl" and exit with status 77. * tests/Makefile.am (EXTRA_DIST): Distribute it. (TESTSUITE_PERL): New, define to '$(PERL)' if a perl interpreter has been found at configure time (i.e., if the 'HAVE_PERL' automake conditional is true), and to '$(srcdir)/no-perl' otherwise. (LOG_COMPILER): Use $(TESTSUITE_PERL) instead of $(PERL). (XPL_LOG_COMPILER): Likewise. * tests/shell-or-perl: Simplify: no need to actually check whether perl is working.
Diffstat (limited to 'tests/shell-or-perl')
-rw-r--r--tests/shell-or-perl11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/shell-or-perl b/tests/shell-or-perl
index cb80edf67..409db0ee7 100644
--- a/tests/shell-or-perl
+++ b/tests/shell-or-perl
@@ -94,15 +94,8 @@ read shebang_line < "$test_script" \
case $shebang_line in
'#!/usr/bin/perl'*)
# The test is a perl script.
- if $cu_PERL -e 'use warnings' > /dev/null 2>&1; then
- exec $cu_PERL -w -I"$srcdir" -MCoreutils -MCuSkip \
- -M"CuTmpdir qw($test_name)" \
- -- "$test_script" ${1+"$@"}
- else
- # Perl is not available, skip the test.
- echo "$test_name: skip: no usable version of Perl found"
- exit 77
- fi
+ exec $cu_PERL -w -I"$srcdir" -MCoreutils -MCuSkip \
+ -M"CuTmpdir qw($test_name)" -- "$test_script" ${1+"$@"}
;;
*)
# Assume the test is a shell script.