Subject: | [Inc. PATCH] Recursive tests in Makefile.PL not created correctly |
Hi.
The generated Makefile.PL does not have a correct 'test' entry.
It should be: test => { TESTS => '' } but instead it is: TESTS => ''.
I've included two patches:
- One to correct the generation of Makefile.PL in Compat.pm
- One to correct the testing of this in compat.t
Feel free to change anything.
Subject: | 02_fix_recusive_tests_testcases.patch |
--- Module-Build-0.35/t/compat.t 2009-08-27 16:19:29.000000000 +0300
+++ Module-Build-0.35.patched/t/compat.t 2009-08-30 12:07:28.000000000 +0300
@@ -299,12 +299,18 @@
create_makefile_pl('traditional', $mb);
my $args = extract_writemakefile_args() || {};
- is $args->{TESTS},
- join( q{ },
- File::Spec->catfile(qw(t *.t)),
- File::Spec->catfile(qw(t deep *.t))
- ),
- 'Makefile.PL has correct TESTS line for recursive test files';
+
+ if ( exists $args->{test}->{TESTS} ) {
+ is $args->{test}->{TESTS},
+ join( q{ },
+ File::Spec->catfile(qw(t *.t)),
+ File::Spec->catfile(qw(t deep *.t))
+ ),
+ 'Makefile.PL has correct TESTS line for recursive test files';
+ } else {
+ ok( ! exists $args->{TESTS}, 'Not using incorrect recursive tests key' );
+ }
+
}
# cleanup
Subject: | 01_fix_recursive_tests.patch |
--- Module-Build-0.35/lib/Module/Build/Compat.pm 2009-08-27 16:19:29.000000000 +0300
+++ Module-Build-0.35.patched/lib/Module/Build/Compat.pm 2009-08-30 11:36:46.000000000 +0300
@@ -189,7 +189,7 @@
$MM_Args{PL_FILES} = $build->PL_files || {};
if ($build->recursive_test_files) {
- $MM_Args{TESTS} = join q{ }, $package->_test_globs($build);
+ $MM_Args{test} = { TESTS => join q{ }, $package->_test_globs($build) };
}
local $Data::Dumper::Terse = 1;