X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/463c96de11efb9662169e0bf06f1faf33464a4cf..d37662c0fabaaa893c0d695034fa83b9235c6872:/runtests.SH diff --git a/runtests.SH b/runtests.SH index 304b719..78c879b 100755 --- a/runtests.SH +++ b/runtests.SH @@ -16,21 +16,26 @@ 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 \$\$) +export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$) -case \$# in +case $# in 0) echo "runtests tty_flag ..." exit 1 ;; esac -case \$1 in +case $1 in tty) tty=Y ;; @@ -50,12 +55,25 @@ case \$1 in ;; esac -if test X"\$TESTFILE" = X; then +if test X"$TESTFILE" = X; then TESTFILE=TEST 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 <