In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/7d18793f050900d85e6cdbba5505b99cea51fe26?hp=32dfa2a7022d23efefa78556ec78725b0d2d4373>
- Log ----------------------------------------------------------------- commit 7d18793f050900d85e6cdbba5505b99cea51fe26 Author: Andy Dougherty <[email protected]> Date: Thu Mar 13 16:16:22 2014 -0400 Make sure the PWD environment variable points to the t directory. runtests is typically run under /bin/sh. If the user uses a different interactive shell (such as /bin/ksh) that maintains the PWD environment variable, but /bin/sh does not, then the 'cd t' line in runtests ends up changing the working directory without updating $PWD. Several tests in t/io/fs.t rely on being able to change directories and then get back to the original. The tests assume that if $PWD is set at all, then it is set correctly. This fix changes runtests to ensure it is so. M runtests.SH commit f1397316ff9824d76d2953cfd3cef2bef5be92ee Author: Andy Dougherty <[email protected]> Date: Thu Mar 13 15:44:19 2014 -0400 Split file into parts with and without substitutions. At this point, there are no functional changes. This just prepares the way for future work. M runtests.SH ----------------------------------------------------------------------- Summary of changes: runtests.SH | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) 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 <<!GROK!THIS! $startsh -e # runtests.SH # +!GROK!THIS! + +## In the following, dollars and backticks do not need the extra backslash. +$spitshell >>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 <<!GROK!THIS! # The second branch is for testing without a tty or controlling terminal, # see t/op/stat.t if test \$tty = Y; then -- Perl5 Master Repository
