X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/6fa4daccf8676188291b42c143f34f4ab72ff066..29e6e3b9ec4c49efe5983d0e681f1e4bbffa8f98:/runtests.SH?ds=inline diff --git a/runtests.SH b/runtests.SH old mode 100644 new mode 100755 index bab27e9..71f41d1 --- a/runtests.SH +++ b/runtests.SH @@ -1,3 +1,5 @@ +#!/bin/sh + case $PERL_CONFIG_SH in '') if test ! -f config.sh; then @@ -14,21 +16,41 @@ case "$0" in esac echo "Extracting runtests (with variable substitutions)" rm -f runtests + $spitshell >runtests <>runtests <<'!NO!SUBS!' + +export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$) + +# Avoid "warning: jobserver unavailable: using -j1." warnings under GNU make. +# When gmake -j N spawns a child, it passes +# MAKEFLAGS=" --jobserver-fds=3,4 -j". +# in the environment. Also, if make recognises that the child is another +# make (e.g. it's invoked as $(MAKE) or +command), it keeps open fd's 3 +# and 4 to allow the child process to access the job server. Otherwise, +# those fd's aren't kept open. +# In the case where one does 'make -j 16 test_harness', this script is +# called with MAKEFLAGS set, but fd's 3 and 4 closed. Later when +# descendents of this script run cpan/ExtUtils-Constant/t/Constant.t +# which itelf invokes make, the warnings ensue. -export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) +unset MAKEFLAGS -case \$# in + +case $# in 0) echo "runtests tty_flag ..." exit 1 ;; esac -case \$1 in +case $1 in tty) tty=Y ;; @@ -48,23 +70,31 @@ case \$1 in ;; esac -if test X"\$TESTFILE" = X; then +if test X"$TESTFILE" = X; then TESTFILE=TEST fi -if test X"\$PERL" = X; then - PERL=./perl$_exe - export PERL -fi - cd t +# If this is run under an old shell that doesn't automatically +# update PWD, then we must update it. Otherwise, t/io/fs.t gets +# mixed up about what directory we are in. +case "$PWD" in + '') ;; # Do nothing if it isn't set at all. + */t) ;; # Leave it alone if it's properly updated. + *) PWD=${PWD}/t; export PWD ;; # Otherwise, fix it. +esac + +!NO!SUBS! + +## In the following, dollars and backticks do need the extra backslash. +$spitshell >>runtests < rantests