X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=7cfceca0f69f1ab15a78b37ae15a57febffefeab;hb=0caae1168cadec2adbb25e63058557b7b9857a61;hp=d46d24f60fa028e95f787eeba01e68c67f4554ed;hpb=f582060a147cfc4208f446d5b53bb4d944912116;p=gitmo%2FClass-MOP.git diff --git a/Makefile.PL b/Makefile.PL index d46d24f..7cfceca 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -130,9 +130,7 @@ sub is_maintainer { 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 @@ sub init { 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 @@ pp_tests: ${pp_tests} ${test_dep} -t/pp_%: t/% t/header_pp.inc -\t\$(NOECHO) \$(ABSPERLRUN) "-MExtUtils::Command" -e cat t/header_pp.inc \$< > \$@ EOM }