| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#line 1 |
|
2
|
|
|
|
|
|
|
package Test::Pod; |
|
3
|
1
|
|
|
1
|
|
3002
|
|
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
42
|
|
|
4
|
|
|
|
|
|
|
use strict; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
#line 13 |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use vars qw( $VERSION ); |
|
9
|
|
|
|
|
|
|
$VERSION = '1.26'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#line 63 |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use 5.004; |
|
14
|
1
|
|
|
1
|
|
5
|
|
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
58
|
|
|
15
|
|
|
|
|
|
|
use Pod::Simple; |
|
16
|
|
|
|
|
|
|
use Test::Builder; |
|
17
|
|
|
|
|
|
|
use File::Spec; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $Test = Test::Builder->new; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub import { |
|
22
|
|
|
|
|
|
|
my $self = shift; |
|
23
|
|
|
|
|
|
|
my $caller = caller; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
for my $func ( qw( pod_file_ok all_pod_files all_pod_files_ok ) ) { |
|
26
|
|
|
|
|
|
|
no strict 'refs'; |
|
27
|
|
|
|
|
|
|
*{$caller."::".$func} = \&$func; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
$Test->exported_to($caller); |
|
31
|
|
|
|
|
|
|
$Test->plan(@_); |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#line 100 |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub pod_file_ok { |
|
37
|
|
|
|
|
|
|
my $file = shift; |
|
38
|
|
|
|
|
|
|
my $name = @_ ? shift : "POD test for $file"; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
if ( !-f $file ) { |
|
41
|
|
|
|
|
|
|
$Test->ok( 0, $name ); |
|
42
|
|
|
|
|
|
|
$Test->diag( "$file does not exist" ); |
|
43
|
|
|
|
|
|
|
return; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $checker = Pod::Simple->new; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
$checker->output_string( \my $trash ); # Ignore any output |
|
49
|
|
|
|
|
|
|
$checker->parse_file( $file ); |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
my $ok = !$checker->any_errata_seen; |
|
52
|
|
|
|
|
|
|
$Test->ok( $ok, $name ); |
|
53
|
|
|
|
|
|
|
if ( !$ok ) { |
|
54
|
|
|
|
|
|
|
my $lines = $checker->{errata}; |
|
55
|
|
|
|
|
|
|
for my $line ( sort { $a<=>$b } keys %$lines ) { |
|
56
|
|
|
|
|
|
|
my $errors = $lines->{$line}; |
|
57
|
|
|
|
|
|
|
$Test->diag( "$file ($line): $_" ) for @$errors; |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
return $ok; |
|
62
|
|
|
|
|
|
|
} # pod_file_ok |
|
63
|
|
|
|
|
|
|
|
|
64
|
1
|
|
|
1
|
|
33
|
#line 150 |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
33
|
|
|
65
|
|
|
|
|
|
|
|
|
66
|
1
|
|
|
1
|
|
1029
|
sub all_pod_files_ok { |
|
|
1
|
|
|
|
|
36990
|
|
|
|
1
|
|
|
|
|
33
|
|
|
67
|
1
|
|
|
1
|
|
15
|
my @files = @_ ? @_ : all_pod_files(); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
25
|
|
|
68
|
1
|
|
|
1
|
|
7
|
|
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
70
|
|
|
69
|
|
|
|
|
|
|
$Test->plan( tests => scalar @files ); |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
my $ok = 1; |
|
72
|
|
|
|
|
|
|
foreach my $file ( @files ) { |
|
73
|
1
|
|
|
1
|
|
44
|
pod_file_ok( $file, $file ) or undef $ok; |
|
74
|
1
|
|
|
|
|
2
|
} |
|
75
|
|
|
|
|
|
|
return $ok; |
|
76
|
1
|
|
|
|
|
3
|
} |
|
77
|
1
|
|
|
1
|
|
6
|
|
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
913
|
|
|
78
|
3
|
|
|
|
|
6
|
#line 183 |
|
|
3
|
|
|
|
|
16
|
|
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub all_pod_files { |
|
81
|
1
|
|
|
|
|
30
|
my @queue = @_ ? @_ : _starting_points(); |
|
82
|
1
|
|
|
|
|
52
|
my @pod = (); |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
while ( @queue ) { |
|
85
|
|
|
|
|
|
|
my $file = shift @queue; |
|
86
|
|
|
|
|
|
|
if ( -d $file ) { |
|
87
|
|
|
|
|
|
|
local *DH; |
|
88
|
|
|
|
|
|
|
opendir DH, $file or next; |
|
89
|
|
|
|
|
|
|
my @newfiles = readdir DH; |
|
90
|
|
|
|
|
|
|
closedir DH; |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
@newfiles = File::Spec->no_upwards( @newfiles ); |
|
93
|
|
|
|
|
|
|
@newfiles = grep { $_ ne "CVS" && $_ ne ".svn" } @newfiles; |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
foreach my $newfile (@newfiles) { |
|
96
|
|
|
|
|
|
|
my $filename = File::Spec->catfile( $file, $newfile ); |
|
97
|
|
|
|
|
|
|
if ( -f $filename ) { |
|
98
|
|
|
|
|
|
|
push @queue, $filename; |
|
99
|
|
|
|
|
|
|
} |
|
100
|
|
|
|
|
|
|
else { |
|
101
|
|
|
|
|
|
|
push @queue, File::Spec->catdir( $file, $newfile ); |
|
102
|
14
|
|
|
14
|
1
|
27
|
} |
|
103
|
14
|
50
|
|
|
|
57
|
} |
|
104
|
|
|
|
|
|
|
} |
|
105
|
14
|
50
|
|
|
|
573
|
if ( -f $file ) { |
|
106
|
0
|
|
|
|
|
0
|
push @pod, $file if _is_perl( $file ); |
|
107
|
0
|
|
|
|
|
0
|
} |
|
108
|
0
|
|
|
|
|
0
|
} # while |
|
109
|
|
|
|
|
|
|
return @pod; |
|
110
|
|
|
|
|
|
|
} |
|
111
|
14
|
|
|
|
|
115
|
|
|
112
|
|
|
|
|
|
|
sub _starting_points { |
|
113
|
14
|
|
|
|
|
477
|
return 'blib' if -e 'blib'; |
|
114
|
14
|
|
|
|
|
4207
|
return 'lib'; |
|
115
|
|
|
|
|
|
|
} |
|
116
|
14
|
|
|
|
|
185738
|
|
|
117
|
14
|
|
|
|
|
166
|
sub _is_perl { |
|
118
|
14
|
100
|
|
|
|
10249
|
my $file = shift; |
|
119
|
1
|
|
|
|
|
3
|
|
|
120
|
1
|
|
|
|
|
5
|
return 1 if $file =~ /\.PL$/; |
|
|
0
|
|
|
|
|
0
|
|
|
121
|
1
|
|
|
|
|
3
|
return 1 if $file =~ /\.p(l|m|od)$/; |
|
122
|
1
|
|
|
|
|
8
|
return 1 if $file =~ /\.t$/; |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
local *FH; |
|
125
|
|
|
|
|
|
|
open FH, $file or return; |
|
126
|
14
|
|
|
|
|
407
|
my $first = <FH>; |
|
127
|
|
|
|
|
|
|
close FH; |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
return 1 if defined $first && ($first =~ /^#!.*perl/); |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
return; |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
#line 268 |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
1; |