Skip Menu |

This queue is for tickets about the rpm-build-perl CPAN distribution.

Report information
The Basics
Id: 39054
Status: new
Priority: 0/
Queue: rpm-build-perl

Owner: Nobody in particular
Requestors: dagolden [...]
Cc: ANDK [...]

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

CC: andk [...]
Subject: tests should localize PERL5OPT
Download (untitled) / with headers
text/plain 186b
Tests will fail if user has set PERL5OPT to load any modules. Localizing $ENV{PERL5OPT} in the spawn() function in your tests will avoid these failures. Patch file attached. -- David
Subject: protect-perl5opt.patch
diff --git a/t/01-B-PerlReq.t b/t/01-B-PerlReq.t index 3973cad..6c4be31 100644 --- a/t/01-B-PerlReq.t +++ b/t/01-B-PerlReq.t @@ -7,6 +7,7 @@ use Fcntl qw(F_SETFD); sub spawn ($) { my $code = shift; + local $ENV{PERL5OPT}; open my $pipe, "-|", $^X, qw(-Mblib -MO=PerlReq -e) => $code or return (undef, undef); my $output = join '' => <$pipe>; diff --git a/t/02-perlreq.t b/t/02-perlreq.t index 26c6aa0..412d416 100644 --- a/t/02-perlreq.t +++ b/t/02-perlreq.t @@ -6,6 +6,7 @@ use Fcntl qw(F_SETFD); sub spawn ($) { my $file = shift; use 5.007_001; # the list form of open() for pipes + local $ENV{PERL5OPT}; open my $pipe, "-|", $^X, qw(-Mblib perl.req) => $file or return (undef, undef); my $output = join '' => <$pipe>;

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to