X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=maint%2FMakefile.PL.inc%2F11_authortests.pl;h=f9f78ee9f8943ade9633b294a06228f51dba8c3a;hb=7606fd627a07514ca932e47d643ca65404842adf;hp=3b9c1748b1dc5420c804ceb7ee07d6f360213a05;hpb=20884f55ed03738633c1cf2a1f8d43af743b650e;p=dbsrgits%2FDBIx-Class.git diff --git a/maint/Makefile.PL.inc/11_authortests.pl b/maint/Makefile.PL.inc/11_authortests.pl index 3b9c174..f9f78ee 100644 --- a/maint/Makefile.PL.inc/11_authortests.pl +++ b/maint/Makefile.PL.inc/11_authortests.pl @@ -9,23 +9,58 @@ File::Find::find(sub { ); }, 'xt'); -my $xt_tests = join (' ', map { File::Spec->catfile($_, '*.t') } sort keys %$xt_dirs ); +my @xt_tests = map { File::Spec->catfile($_, '*.t') } sort keys %$xt_dirs; # this will add the xt tests to the `make test` target among other things -Meta->tests(join (' ', map { $_ || () } Meta->tests, $xt_tests ) ); +Meta->tests(join (' ', map { $_ || () } Meta->tests, @xt_tests ) ); -# inject an explicit xt test run for making a tarball (distdir is exempt) +# inject an explicit xt test run, mainly to check the contents of +# lib and the generated POD's *before* anything is copied around +# +# at the end rerun the whitespace test in the distdir, to make sure everything +# is pristine postamble <<"EOP"; -.PHONY: test_xt +dbic_clonedir_copy_generated_pod : test_xt -dist : test_xt +test_xt : pm_to_blib +@{[ + # When xt tests are explicitly requested, we want to run with RELEASE_TESTING=1 + # so that all optdeps are turned into a hard failure + # However portably modifying ENV for a single command is surprisingly hard + # So instead we (ab)use perl's ability to stack -e options, and simply modify + # the ENV from within perl itself + $mm_proto->test_via_harness( + # perl cmd + join( ' ', + '$(ABSPERLRUN)', + map { $mm_proto->quote_literal($_) } qw(-e $ENV{RELEASE_TESTING}=1;$ENV{DBICTEST_NO_MAKEFILE_VERIFICATION}=1;) + ), + # test list + join( ' ', + map { $mm_proto->quote_literal($_) } @xt_tests + ), + ) +]} -test_xt : -\tPERL_DL_NONLAZY=1 RELEASE_TESTING=1 \$(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness(\$(TEST_VERBOSE), 'inc', '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $xt_tests +create_distdir : dbic_distdir_retest_whitespace -EOP +dbic_distdir_retest_whitespace : +\t@{[ + $mm_proto->cd ( + '$(DISTVNAME)', + $mm_proto->test_via_harness( + # perl cmd + join( ' ', + '$(ABSPERLRUN)', + map { $mm_proto->quote_literal($_) } qw(-Ilib -e $ENV{RELEASE_TESTING}=1;$ENV{DBICTEST_NO_MAKEFILE_VERIFICATION}=1;) + ), + 'xt/whitespace.t' + ) + ) +]} +EOP # keep the Makefile.PL eval happy 1;