Skip Menu |

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

Report information
The Basics
Id: 3182
Status: new
Priority: 0/
Queue: Test-Distribution

People
Owner: Nobody in particular
Requestors: trevor.schellhorn-perl [...] marketingtips.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.05
Fixed in: (no value)



Subject: Module fails when different options are selected
When using this module to test some of our packages, I ran across an error that would report that my module didn't report a version when it actually did. I had selected that it not run the prereq tests. When running the test in verbose mode, I noticed that it was checking the version before loading the module. After looking at the code, I noticed that the list of tests to run were pulled out of a hash and from programming with perl, knew that there was no guarantee of the order that the tests would come out. I created the patch to fix that problem. Trevor
--- lib/Test/Distribution.pm 2003-08-07 15:59:59.000000000 -0700 +++ lib/Test/Distribution.pm.new 2003-08-07 16:00:35.000000000 -0700 @@ -96,7 +96,7 @@ plan tests => $tests; - for my $type (keys %perform) { + for my $type (grep exists $perform{$_}, @types) { $testers{$type}->run_tests; } }
Thanks for taking the time to raise this bug report. I've just taken over Test::Distribution .. this was the bug that was stopping me use it for my modules too. It should be fixed as of Test::Distribution 1.06 which i released yesterday.
From: trevor.schellhorn-perl [...] marketingtips.com
[SRSHAH - Fri Dec 26 18:18:24 2003]: Show quoted text
> Thanks for taking the time to raise this bug report. I've just taken > over Test::Distribution .. this was the bug that was stopping me use it > for my modules too. > > It should be fixed as of Test::Distribution 1.06 which i released
yesterday. Show quoted text
>
I am using Test::Distribution version 1.17 and the patch is not applied to this. Is it possible that the patch could be re-implemented? Thanks, Trevor
From: trevor.schellhorn-perl [...] marketingtips.com
[guest - Thu Feb 10 13:34:19 2005]: Show quoted text
> [SRSHAH - Fri Dec 26 18:18:24 2003]: >
> > Thanks for taking the time to raise this bug report. I've just taken > > over Test::Distribution .. this was the bug that was stopping me use it > > for my modules too. > > > > It should be fixed as of Test::Distribution 1.06 which i released
> yesterday.
> >
> > > I am using Test::Distribution version 1.17 and the patch is not applied > to this. Is it possible that the patch could be re-implemented? > > Thanks, > > Trevor
The patch that I am using is attached to bug # 3194. I am re-attaching it to this one. This patch solves both this bug and bug #3194. Trevor
--- lib/Test/Distribution.pm.orig 2003-08-07 15:59:59.000000000 -0700 +++ lib/Test/Distribution.pm 2003-08-08 16:20:12.000000000 -0700 @@ -248,10 +248,19 @@ open my $fh, 'Makefile.PL' or die "can't open Makefile.PL: $!\n"; my $make = do { local $/; <$fh> }; close $fh or die "can't close Makefile.PL: $!\n"; - $make =~ s/use \s+ ExtUtils::MakeMaker \s* ;/no strict;/gx; + $make =~ s/use \s+ ExtUtils::MakeMaker \s* [^;]* ;/no strict;/gx; - $make .= 'sub WriteMakefile { - my %h = @_; our @prereq = keys %{ $h{PREREQ_PM} || {} } }'; + # Check to see if an '__END__' tag is used. If so, insert the + # modified WriteMakefile there + if( $make =~ m/__(END|DATA)__/ ) { + my $new_sub = 'sub WriteMakefile { + my %h = @_; our @prereq = keys %{ $h{PREREQ_PM} || {} } }'; + $make =~ s/(__(?:END|DATA)__)/$new_sub\n$1/; + } + else { + $make .= 'sub WriteMakefile { + my %h = @_; our @prereq = keys %{ $h{PREREQ_PM} || {} } }'; + } eval $make; die $@ if $@;