Commit | Line | Data |
20884f55 |
1 | require File::Spec; |
2 | require File::Find; |
3 | |
c26b30de |
4 | my $xt_dist_dirs; |
20884f55 |
5 | File::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 |
12 | my @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 |
19 | postamble <<"EOP"; |
20 | |
e2633789 |
21 | dbic_clonedir_copy_generated_pod : test_xt |
20884f55 |
22 | |
3ba58fe4 |
23 | test_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 |
43 | create_distdir : dbic_distdir_retest_ws_and_footers |
ffce4b65 |
44 | |
a2bd3796 |
45 | dbic_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 |
60 | EOP |
61 | |
fc4b0448 |
62 | # keep the Makefile.PL eval happy |
63 | 1; |