Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 102743
Status: resolved
Priority: 0/
Queue: Test-Script

People
Owner: Nobody in particular
Requestors: JIRA [...] cpan.org
Cc: jiri [...] pavlovsky.eu
PLICEASE [...] cpan.org
AdminCc:

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



CC: jiri [...] pavlovsky.eu
Subject: It should work even when blib doesn't exist
Test::Script won't work without blib directory.
This should not be required as there are scenarious when one want to use it outside of typical CPAN distribution.
On Fri Mar 13 07:01:33 2015, JIRA wrote: Show quoted text
> Test::Script won't work without blib directory. > This should not be required as there are scenarious when one want to use it > outside of typical CPAN distribution.
I propose the attached patch as a solution. Instead of using -Mblib it uses -I for each directory in @INC. The downside to this approach is that some of the @INC directories in the child process will be repeated, but at least they should be in the right order. I'm filtering out any references as you won't be able to pass sub ref hooks to the child in this way. Might be worth mentioning as a CAVEAT.
Subject: patch.txt
diff --git a/lib/Test/Script.pm b/lib/Test/Script.pm index 734afec..3634c90 100755 --- a/lib/Test/Script.pm +++ b/lib/Test/Script.pm @@ -113,7 +113,8 @@ sub script_compiles { my $args = _script(shift); my $unix = shift @$args; my $path = path( $unix ); - my $cmd = [ perl, '-Mblib', '-c', $path, @$args ]; + my @libs = map { "-I$_" } grep {!ref($_)} @INC; + my $cmd = [ perl, @libs, '-c', $path, @$args ]; my $stdin = ''; my $stdout = ''; my $stderr = ''; @@ -153,7 +154,8 @@ sub script_runs { my $args = _script(shift); my $unix = shift @$args; my $path = path( $unix ); - my $cmd = [ perl, '-Mblib', $path, @$args ]; + my @libs = map { "-I$_" } grep {!ref($_)} @INC; + my $cmd = [ perl, @libs, $path, @$args ]; my $stdin = ''; my $stdout = ''; my $stderr = '';
This is fixed in 1.08