Index: t/compat.t
===================================================================
--- t/compat.t (revision 12867)
+++ t/compat.t (working copy)
@@ -270,6 +270,21 @@
ok ! -e 'Makefile.PL', "Makefile.PL cleaned up";
}
+{
+ $dist->add_file('t/deep/foo.t', q{});
+ $dist->regen;
+
+ my $mb;
+ stdout_of( sub {
+ $mb = Module::Build->new_from_context( recursive_test_files => 1 );
+ });
+
+ create_makefile_pl('traditional', $mb);
+ my $args = extract_writemakefile_args() || {};
+ is $args->{TESTS}, 't/*.t t/deep/*.t',
+ 'Makefile.PL has correct TESTS line for recursive test files';
+}
+
# cleanup
$dist->remove;
Index: lib/Module/Build/Compat.pm
===================================================================
--- lib/Module/Build/Compat.pm (revision 12867)
+++ lib/Module/Build/Compat.pm (working copy)
@@ -4,6 +4,7 @@
use vars qw($VERSION);
$VERSION = '0.33_03';
+use File::Basename ();
use File::Spec;
use IO::File;
use Config;
@@ -178,7 +179,7 @@
%prereq = ( %{$build->requires}, %{$build->build_requires} );
%prereq = map {$_, $prereq{$_}} sort keys %prereq;
- delete $prereq{perl};
+ delete $prereq{perl};
$MM_Args{PREREQ_PM} = \%prereq;
$MM_Args{INSTALLDIRS} = $build->installdirs eq 'core' ? 'perl' : $build->installdirs;
@@ -186,7 +187,11 @@
$MM_Args{EXE_FILES} = [ sort keys %{$build->script_files} ] if $build->script_files;
$MM_Args{PL_FILES} = $build->PL_files || {};
-
+
+ if ($build->recursive_test_files) {
+ $MM_Args{TESTS} = join q{ }, $package->_test_globs($build);
+ }
+
local $Data::Dumper::Terse = 1;
my $args = Data::Dumper::Dumper(\%MM_Args);
$args =~ s/\{(.*)\}/($1)/s;
@@ -199,7 +204,13 @@
}
}
+sub _test_globs {
+ my ($self, $build) = @_;
+ return map { File::Spec->catfile($_, '*.t') }
+ @{$build->rscan_dir('t', sub { -d $File::Find::name })};
+}
+
sub subclass_dir {
my ($self, $build) = @_;