Debian Codegraph @

author.t/pod.t

raw
1 #!/usr/bin/perl
2 # Copyright 2022 Jeffrey Kegler
3 # This file is part of Marpa::R2. Marpa::R2 is free software: you can
4 # redistribute it and/or modify it under the terms of the GNU Lesser
5 # General Public License as published by the Free Software Foundation,
6 # either version 3 of the License, or (at your option) any later version.
7 #
8 # Marpa::R2 is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser
14 # General Public License along with Marpa::R2. If not, see
15 # http://www.gnu.org/licenses/.
16
17 use 5.010001;
18 use strict;
19 use warnings;
20 use English qw( -no_match_vars );
21 use Fatal qw( open close );
22 use Carp;
23 use Pod::Simple;
24 use Test::Pod;
25 use Test::More;
26
27 # Test that the module passes perlcritic
28 BEGIN {
29 $OUTPUT_AUTOFLUSH = 1;
30 }
31
32 my %exclude = map { ( $_, 1 ) } qw(
33 inc/Test/Weaken.pm
34 );
35
36 open my $manifest, '<', 'MANIFEST'
37 or Marpa::R2::exception("open of MANIFEST failed: $ERRNO");
38
39 my @test_files = ();
40 FILE: while ( my $file = <$manifest> ) {
41 chomp $file;
42 $file =~ s/\s*[#].*\z//xms;
43 next FILE if -d $file;
44 next FILE if $exclude{$file};
45 my ($ext) = $file =~ / [.] ([^.]+) \z /xms;
46 next FILE if not defined $ext;
47 $ext = lc $ext;
48 given ($ext) {
49 when ('pl') { push @test_files, $file }
50 when ('pod') { push @test_files, $file }
51 when ('t') { push @test_files, $file }
52 when ('pm') { push @test_files, $file }
53 } ## end given
54 } # FILE
55 close $manifest;
56
57 Test::Pod::all_pod_files_ok(@test_files);
58
59 1;