Revert ab340f7f - it no longer makes sense given the excellent CI setup
[dbsrgits/DBIx-Class.git] / maint / Makefile.PL.inc / 11_authortests.pl
CommitLineData
20884f55 1require File::Spec;
2require File::Find;
3
c26b30de 4my $xt_dist_dirs;
20884f55 5File::Find::find(sub {
c26b30de 6 return if $xt_dist_dirs->{$File::Find::dir};
7 $xt_dist_dirs->{$File::Find::dir} = 1 if (
20884f55 8 $_ =~ /\.t$/ and -f $_
9 );
c26b30de 10}, 'xt/dist');
20884f55 11
c26b30de 12my @xt_dist_tests = map { File::Spec->catfile($_, '*.t') } sort keys %$xt_dist_dirs;
20884f55 13
e2633789 14# inject an explicit xt test run, mainly to check the contents of
15# lib and the generated POD's *before* anything is copied around
ffce4b65 16#
a2bd3796 17# at the end rerun the whitespace and footer tests in the distdir
18# to make sure everything is pristine
20884f55 19postamble <<"EOP";
20
e2633789 21dbic_clonedir_copy_generated_pod : test_xt
20884f55 22
3ba58fe4 23test_xt : pm_to_blib
24@{[
25 # When xt tests are explicitly requested, we want to run with RELEASE_TESTING=1
26 # so that all optdeps are turned into a hard failure
27 # However portably modifying ENV for a single command is surprisingly hard
28 # So instead we (ab)use perl's ability to stack -e options, and simply modify
29 # the ENV from within perl itself
30 $mm_proto->test_via_harness(
31 # perl cmd
32 join( ' ',
33 '$(ABSPERLRUN)',
7b87b77c 34 map { $mm_proto->quote_literal($_) } qw(-e $ENV{RELEASE_TESTING}=1;$ENV{HARNESS_OPTIONS}=j4;)
3ba58fe4 35 ),
36 # test list
37 join( ' ',
c26b30de 38 map { $mm_proto->quote_literal($_) } @xt_dist_tests
3ba58fe4 39 ),
40 )
41]}
20884f55 42
a2bd3796 43create_distdir : dbic_distdir_retest_ws_and_footers
ffce4b65 44
a2bd3796 45dbic_distdir_retest_ws_and_footers :
ffce4b65 46\t@{[
47 $mm_proto->cd (
48 '$(DISTVNAME)',
49 $mm_proto->test_via_harness(
50 # perl cmd
51 join( ' ',
52 '$(ABSPERLRUN)',
7b87b77c 53 map { $mm_proto->quote_literal($_) } qw(-Ilib -e $ENV{RELEASE_TESTING}=1;$ENV{HARNESS_OPTIONS}=j4;)
ffce4b65 54 ),
c26b30de 55 'xt/dist/postdistdir/*.t',
ffce4b65 56 )
57 )
58]}
59
20884f55 60EOP
61
fc4b0448 62# keep the Makefile.PL eval happy
631;