Commit | Line | Data |
d45dd0ef |
1 | #!perl |
2 | use 5.010; |
3 | use utf8; |
4 | use strict; |
5 | use warnings FATAL => 'all'; |
6 | use Capture::Tiny qw(capture); |
7 | use File::Next qw(); |
8 | use File::Which qw(which); |
49046f7e |
9 | use Module::Build qw(); |
d45dd0ef |
10 | use Test::More; |
11 | |
12 | # Skip means sweep bugs under the rug. |
13 | # I want this test to be actually run. |
14 | BAIL_OUT 'xmllint (part of the libxml2 package) not installed.' |
15 | unless which 'xmllint'; |
16 | |
49046f7e |
17 | my $build; |
18 | eval { $build = Module::Build->current; 1; } |
19 | or BAIL_OUT 'We are not in a Module::Build session. Run Build.PL first.'; |
d45dd0ef |
20 | |
21 | my $iter = File::Next::files({ |
22 | file_filter => sub {/\.html \z/msx}, |
23 | sort_files => 1, |
24 | }, |
49046f7e |
25 | $build->destdir |
d45dd0ef |
26 | ); |
27 | |
28 | my $file_counter; |
29 | while (defined(my $html_file = $iter->())) { |
30 | $file_counter++; |
31 | my (undef, $stderr) = capture { |
32 | system qw(xmllint --noout), $html_file; |
33 | }; |
34 | ok !$stderr, "$html_file validates"; |
35 | diag $stderr if $stderr; |
36 | } |
37 | |
38 | done_testing($file_counter); |