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