[Moose-commits] r7381 - Class-MOP/trunk
rafl at code2.0beta.co.uk
rafl at code2.0beta.co.uk
Fri Jan 23 10:42:25 GMT 2009
Author: rafl
Date: 2009-01-23 02:42:25 -0800 (Fri, 23 Jan 2009)
New Revision: 7381
Modified:
Class-MOP/trunk/Makefile.PL
Log:
Make the pure-perl test generation compatible with bsd make implementations.
Courtesy of Stoned Elipot.
Modified: Class-MOP/trunk/Makefile.PL
===================================================================
--- Class-MOP/trunk/Makefile.PL 2009-01-23 07:38:32 UTC (rev 7380)
+++ Class-MOP/trunk/Makefile.PL 2009-01-23 10:42:25 UTC (rev 7381)
@@ -130,9 +130,7 @@
sub get_pp_tests {
opendir my $dh, 't' or die "Cannot read t: $!";
- return map {
- File::Spec->catfile('t', "pp_${_}")
- } grep { $_ !~ /^99/ } grep {/^\d.+\.t$/} readdir $dh;
+ return grep { $_ !~ /^99/ } grep {/^\d.+\.t$/} readdir $dh;
}
# This is EUMM voodoo
@@ -149,9 +147,17 @@
package MY;
sub postamble {
- my $pp_tests = join q{ }, ::get_pp_tests();
- my $test_dep = $::has_compiler && (::is_maintainer() || $ENV{AUTOMATED_TESTING});
- ? 'pure_all :: pp_tests'
+ my @test_files = ::get_pp_tests();
+ my $pp_tests = join q{ }, map { File::Spec->catfile('t', "pp_${_}") } @test_files;
+ my @pp_test_targets = join qq{\n}, map {
+ my $source = File::Spec->catfile('t', ${_});
+ File::Spec->catfile('t', "pp_${_}") . q{: }
+ . qq{$source t/header_pp.inc\n\t}
+ . q{$(NOECHO) $(ABSPERLRUN) "-MExtUtils::Command" -e cat t/header_pp.inc }
+ . $source . q{ > $@} . qq{\n}
+ } @test_files;
+ my $test_dep = $::has_compiler && (::is_maintainer() || $ENV{AUTOMATED_TESTING})
+ ? qq{pure_all :: pp_tests\n} . join qq{\n}, @pp_test_targets
: '';
return <<"EOM"
@@ -159,7 +165,5 @@
${test_dep}
-t/pp_%: t/% t/header_pp.inc
-\t\$(NOECHO) \$(ABSPERLRUN) "-MExtUtils::Command" -e cat t/header_pp.inc \$< > \$@
EOM
}
More information about the Moose-commits
mailing list