On Mon, Mar 11, 2002 at 05:20:57PM -0600, Ken Williams wrote:
> Hi Schwern,
> 
> Here's a patch for Test::Harness that eliminates a problem I'd been 
> having with it forgetting which Perl executable was running.
> 
> This was causing a problem when I was trying to test some modules 
> (Module::Build in particular) under perl 5.7.3, but 5.7.3 wasn't the 
> default 'perl' executable on my system (naturally).
> 
> Without this fix, I'd probably have to local()-ize $^X or something 
> nasty like that.
> 
> ======================================================================
> --- lib/Test/Harness-old.pm   Mon Mar 11 17:10:09 2002
> +++ lib/Test/Harness.pm       Mon Mar 11 17:11:13 2002
> @@ -712,7 +712,7 @@
>      my $cmd = ($ENV{'HARNESS_COMPILE_TEST'})
>                  ? "./perl -I../lib ../utils/perlcc $test "
>                    . "-r 2>> ./compilelog |"
> -                : "$^X $s $test|";
> +                : "$Config{perlpath} $s $test|";
>      $cmd = "MCR $cmd" if $^O eq 'VMS';

Holy cow, that fixes so many problems!  Thanks!


>      if( open(PERL, $cmd) ) {
> @@ -1178,12 +1178,6 @@
>  Clean up how the summary is printed.  Get rid of those damned formats.
> 
>  =head1 BUGS
> -
> -Test::Harness uses $^X to determine the perl binary to run the tests
> -with. Test scripts running via the shebang (C<#!>) line may not be
> -portable because $^X is not consistent for shebang scripts across
> -platforms. This is no problem when Test::Harness is run with an
> -absolute path to the perl binary or when $^X can be found in the path.
> 
>  HARNESS_COMPILE_TEST currently assumes its run from the Perl source
>  directory.

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
Woah, like, did anybody see my watch?

Reply via email to