Skip Menu |

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 30736
Status: rejected
Priority: 0/
Queue: Test-Harness

People
Owner: andy [...] hexten.net
Requestors: wilburlo [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 3.01
Fixed in: (no value)



Subject: Empty quotes cause TAP::Harness->new( { exec => [ ... ] } ) to behave wierdly.
Hi! When invoking TAP::Harness->new( { exec => ... } ) and placing empty quotes in the exec reference, TAP::Harness will hang after a test. I attempted to look into this, but I couldn't figure out why. As a wishlist item, it would be nice to remove empty strings from the exec ref. This problem was found when this code was attempted my $tap = TAP::Harness->new( { exec => ['perl',$extralibs,'...'] } ); and $extralibs was set to ''; The old Test::Harness code did this... fyi... local $ENV{HARNESS_PERL} = "$EXECUTABLE_NAME $extra_libs ..."; and thus wans't a problem. FYI! Thank you, -daniel #### test.pl #!/usr/bin/env perl use strict; use warnings; use English; # $EXECUTABLE_NAME ( aka $^X ) use TAP::Harness; my $args = { exec => [ $EXECUTABLE_NAME, '' ] }; my $test = TAP::Harness->new( $args ); my $aggregator = $test->runtests( '01-test.pl' ); print $aggregator->failed(), "\n"; #### 01-test.pl use Test::More qw | no_plan |; ok ( 1, 'basic test');
On Wed Nov 14 14:31:02 2007, DLO wrote: [snip] Show quoted text
> my $tap = TAP::Harness->new( { exec => ['perl',$extralibs,'...'] } ); > and $extralibs was set to '';
Thanks Daniel - I'll investigate.
On Wed Nov 14 14:34:11 2007, ANDYA wrote: Show quoted text
> On Wed Nov 14 14:31:02 2007, DLO wrote: > [snip]
> > my $tap = TAP::Harness->new( { exec => ['perl',$extralibs,'...'] } ); > > and $extralibs was set to '';
> > Thanks Daniel - I'll investigate.
Hmm. It seems that $ perl '' t/sample-tests/simple will hang in the same way - actually waiting for input. That's what's happening in this case. We could certainly fix it but I wonder if there's any case where someone would want to pass an empty string? Remember that the exec switch isn't just for Perl - it's plausible that some other interpreter would need to be invoked with an empty arg for some reason. If you need to supply extra libraries you can do that via the 'lib' option and if you need to supply custom switches then use 'switches'. I'm going to reject the ticket for now - although I'm grateful that you took the time to raise it. If you think that's a mistake please let me know :)