From: Florian Ragwitz Date: Fri, 23 Jan 2009 10:42:25 +0000 (+0000) Subject: Make the pure-perl test generation compatible with bsd make implementations. X-Git-Tag: 0.77~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=70bde8444620244c8a9279b03e6c4f3da42ce15e;p=gitmo%2FClass-MOP.git Make the pure-perl test generation compatible with bsd make implementations. Courtesy of Stoned Elipot. --- 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 }