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 | |
1fb834df |
13 | my $parallel_jobs = ( $^O eq 'MSWin32' ) |
14 | ? 1 # FIXME for some reason windows hangs on parallel jobs at `make dist` |
15 | : 4 |
16 | ; |
17 | |
e2633789 |
18 | # inject an explicit xt test run, mainly to check the contents of |
19 | # lib and the generated POD's *before* anything is copied around |
ffce4b65 |
20 | # |
a2bd3796 |
21 | # at the end rerun the whitespace and footer tests in the distdir |
22 | # to make sure everything is pristine |
20884f55 |
23 | postamble <<"EOP"; |
24 | |
e2633789 |
25 | dbic_clonedir_copy_generated_pod : test_xt |
20884f55 |
26 | |
3ba58fe4 |
27 | test_xt : pm_to_blib |
28 | @{[ |
29 | # When xt tests are explicitly requested, we want to run with RELEASE_TESTING=1 |
30 | # so that all optdeps are turned into a hard failure |
31 | # However portably modifying ENV for a single command is surprisingly hard |
32 | # So instead we (ab)use perl's ability to stack -e options, and simply modify |
33 | # the ENV from within perl itself |
34 | $mm_proto->test_via_harness( |
35 | # perl cmd |
36 | join( ' ', |
37 | '$(ABSPERLRUN)', |
1fb834df |
38 | map { $mm_proto->quote_literal($_) } ( |
39 | '-e', |
40 | "\$ENV{RELEASE_TESTING}=1;\$ENV{HARNESS_OPTIONS}=j$parallel_jobs;" |
41 | ), |
3ba58fe4 |
42 | ), |
43 | # test list |
44 | join( ' ', |
c26b30de |
45 | map { $mm_proto->quote_literal($_) } @xt_dist_tests |
3ba58fe4 |
46 | ), |
47 | ) |
48 | ]} |
20884f55 |
49 | |
a2bd3796 |
50 | create_distdir : dbic_distdir_retest_ws_and_footers |
ffce4b65 |
51 | |
a2bd3796 |
52 | dbic_distdir_retest_ws_and_footers : |
ffce4b65 |
53 | \t@{[ |
54 | $mm_proto->cd ( |
55 | '$(DISTVNAME)', |
56 | $mm_proto->test_via_harness( |
57 | # perl cmd |
58 | join( ' ', |
59 | '$(ABSPERLRUN)', |
1fb834df |
60 | map { $mm_proto->quote_literal($_) } ( |
61 | '-Ilib', |
62 | '-e', |
63 | "\$ENV{RELEASE_TESTING}=1;\$ENV{HARNESS_OPTIONS}=j$parallel_jobs;" |
64 | ), |
ffce4b65 |
65 | ), |
c26b30de |
66 | 'xt/dist/postdistdir/*.t', |
ffce4b65 |
67 | ) |
68 | ) |
69 | ]} |
70 | |
20884f55 |
71 | EOP |
72 | |
fc4b0448 |
73 | # keep the Makefile.PL eval happy |
74 | 1; |