Oh, sorry. I forgot to attach the patch.
--
Goro Fuji (gfx) GFUJI at CPAN.org
Index: t/13_author_tests.t
===================================================================
--- t/13_author_tests.t (revision 12383)
+++ t/13_author_tests.t (working copy)
@@ -21,6 +21,7 @@
license 'perl';
perl_version '5.005';
requires_from 'lib/Foo.pm';
+tests_recursive;
WriteAll;
END_DSL
@@ -44,6 +45,7 @@
license 'perl';
perl_version '5.005';
requires_from 'lib/Foo.pm';
+tests_recursive;
WriteAll;
END_DSL
Index: lib/Module/Install/Makefile.pm
===================================================================
--- lib/Module/Install/Makefile.pm (revision 12383)
+++ lib/Module/Install/Makefile.pm (working copy)
@@ -183,18 +183,34 @@
}
sub tests_recursive {
- my $self = shift;
- my $dir = shift || 't';
- unless ( -d $dir ) {
- die "tests_recursive dir '$dir' does not exist";
- }
- my %tests = map { $_ => 1 } split / /, ($self->tests || '');
- require File::Find;
- File::Find::find(
+ my($self, @dirs) = @_;
+
+ @dirs = ('t') if !@dirs && -d 't';
+
+ if ( !$Module::Install::ExtraTests::use_extratests ) {
+ # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness.
+ # So, just ignore our xt tests here.
+ if ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) {
+ push @dirs, 'xt';
+ }
+ }
+
+ foreach my $dir(@dirs) {
+ unless ( -d $dir ) {
+ die "tests_recursive dir '$dir' does not exist";
+ }
+ }
+
+ return unless @dirs;
+
+ my %tests = map { $_ => 1 } split / /, ($self->tests || '');
+
+ require File::Find;
+ File::Find::find(
sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 },
- $dir
+ @dirs
);
- $self->tests( join ' ', sort keys %tests );
+ $self->tests( join ' ', sort keys %tests );
}
sub write {
@@ -246,13 +262,6 @@
$args->{test} = {
TESTS => (join ' ', grep {!$seen{$_}++} @tests),
};
- } elsif ( $Module::Install::ExtraTests::use_extratests ) {
- # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness.
- # So, just ignore our xt tests here.
- } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) {
- $args->{test} = {
- TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ),
- };
}
if ( $] >= 5.005 ) {
$args->{ABSTRACT} = $self->abstract;