line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
441
|
use 5.006; # our |
|
2
|
|
|
|
|
5
|
|
2
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
37
|
|
3
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
144
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package App::cpanm::meta::checker::State; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.001002'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Shared state for a single test run |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
440
|
use Moo qw(has); |
|
2
|
|
|
|
|
9697
|
|
|
2
|
|
|
|
|
11
|
|
14
|
2
|
|
|
2
|
|
1246
|
use Carp qw(croak); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
76
|
|
15
|
2
|
|
|
2
|
|
922
|
use CPAN::Meta; |
|
2
|
|
|
|
|
42900
|
|
|
2
|
|
|
|
|
61
|
|
16
|
2
|
|
|
2
|
|
995
|
use CPAN::Meta::Check qw(verify_dependencies); |
|
2
|
|
|
|
|
10054
|
|
|
2
|
|
|
|
|
108
|
|
17
|
2
|
|
|
2
|
|
857
|
use App::cpanm::meta::checker::State::Duplicates; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
60
|
|
18
|
2
|
|
|
2
|
|
730
|
use Path::Tiny qw(path); |
|
2
|
|
|
|
|
8130
|
|
|
2
|
|
|
|
|
1188
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has 'tests' => ( |
25
|
|
|
|
|
|
|
is => ro =>, |
26
|
|
|
|
|
|
|
lazy => 1, |
27
|
|
|
|
|
|
|
required => 1, |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has 'list_fd' => ( |
35
|
|
|
|
|
|
|
is => ro =>, |
36
|
|
|
|
|
|
|
lazy => 1, |
37
|
|
|
|
|
|
|
builder => sub { |
38
|
0
|
|
|
0
|
|
|
\*STDERR; |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
has '_duplicates' => ( |
43
|
|
|
|
|
|
|
is => ro =>, |
44
|
|
|
|
|
|
|
lazy => 1, |
45
|
|
|
|
|
|
|
builder => sub { |
46
|
0
|
|
|
0
|
|
|
return App::cpanm::meta::checker::State::Duplicates->new(); |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub _output { |
51
|
0
|
|
|
0
|
|
|
my ( $self, $prefix, $message ) = @_; |
52
|
0
|
|
|
|
|
|
return $self->list_fd->printf( qq[%s: %s\n], $prefix, $message ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub x_test_list { |
60
|
0
|
|
|
0
|
1
|
|
my ( $self, $path, ) = @_; |
61
|
0
|
|
|
|
|
|
return $self->_output( 'list', path($path)->basename ); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub x_test_list_nonempty { |
69
|
0
|
|
|
0
|
1
|
|
my ( $self, $path ) = @_; |
70
|
0
|
0
|
|
|
|
|
return unless path($path)->children; |
71
|
0
|
|
|
|
|
|
return $self->_output( 'list_nonempty', path($path)->basename ); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub x_test_list_empty { |
79
|
0
|
|
|
0
|
1
|
|
my ( $self, $path ) = @_; |
80
|
0
|
0
|
|
|
|
|
return if path($path)->children; |
81
|
0
|
|
|
|
|
|
return $self->_output( 'list_empty', path($path)->basename ); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
## no critic (Compatibility::PerlMinimumVersionAndWhy) |
85
|
|
|
|
|
|
|
# _Pulp__5010_qr_m_propagate_properly |
86
|
|
|
|
|
|
|
my $distversion_re = qr{ |
87
|
|
|
|
|
|
|
\A |
88
|
|
|
|
|
|
|
(.*) |
89
|
|
|
|
|
|
|
- |
90
|
|
|
|
|
|
|
( |
91
|
|
|
|
|
|
|
[^-]+ |
92
|
|
|
|
|
|
|
(?:-TRIAL)? |
93
|
|
|
|
|
|
|
) |
94
|
|
|
|
|
|
|
\z |
95
|
|
|
|
|
|
|
}msx; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub x_test_list_duplicates { |
102
|
0
|
|
|
0
|
1
|
|
my ( $self, $path ) = @_; |
103
|
0
|
|
|
|
|
|
my $basename = path($path)->basename; |
104
|
0
|
|
|
|
|
|
my ( $dist, $version ) = $basename =~ $distversion_re; |
105
|
0
|
|
|
|
|
|
$self->_duplicates->seen_dist_version( $dist, $version ); |
106
|
|
|
|
|
|
|
|
107
|
0
|
0
|
|
|
|
|
return unless $self->_duplicates->has_duplicates($dist); |
108
|
|
|
|
|
|
|
|
109
|
0
|
|
|
|
|
|
my $label = 'list_duplicates'; |
110
|
0
|
|
|
|
|
|
my $fmt = '%s-%s'; |
111
|
|
|
|
|
|
|
|
112
|
0
|
0
|
|
|
|
|
if ( $self->_duplicates->reported_duplicates($dist) ) { |
113
|
0
|
|
|
|
|
|
$self->_output( $label, sprintf $fmt, $dist, $version ); |
114
|
0
|
|
|
|
|
|
return; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
0
|
|
|
|
|
|
$self->_output( $label, sprintf $fmt, $dist, $_ ) for $self->_duplicates->duplicate_versions($dist); |
118
|
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
|
$self->_duplicates->reported_duplicates( $dist, 1 ); |
120
|
|
|
|
|
|
|
|
121
|
0
|
|
|
|
|
|
return; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub _cache_cpan_meta { |
125
|
0
|
|
|
0
|
|
|
my ( undef, $path, $state ) = @_; |
126
|
0
|
0
|
|
|
|
|
return $state->{cpan_meta} if defined $state->{cpan_meta}; |
127
|
0
|
|
|
|
|
|
return ( $state->{cpan_meta} = CPAN::Meta->load_file( path($path)->child('MYMETA.json') ) ); |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub _cpan_meta_check_phase_type { |
131
|
0
|
|
|
0
|
|
|
my ( $self, %args ) = @_; |
132
|
0
|
|
|
|
|
|
my $meta = $self->_cache_cpan_meta( $args{path}, $args{state} ); |
133
|
0
|
|
|
|
|
|
for my $dep ( verify_dependencies( $meta, $args{phase}, $args{type} ) ) { |
134
|
0
|
|
|
|
|
|
$self->_output( $args{label}, ( sprintf '%s: %s', path( $args{path} )->basename, $dep ) ); |
135
|
|
|
|
|
|
|
} |
136
|
0
|
|
|
|
|
|
return; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
for my $phase (qw( runtime configure build develop test )) { |
182
|
|
|
|
|
|
|
for my $rel (qw( requires suggests conflicts recommends )) { |
183
|
|
|
|
|
|
|
my $method = 'x_test_check_' . $phase . '_' . $rel; |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
my $code = sub { |
186
|
0
|
|
|
0
|
|
|
my ( $self, $path, $state ) = @_; |
187
|
0
|
|
|
|
|
|
return $self->_cpan_meta_check_phase_type( |
188
|
|
|
|
|
|
|
path => $path, |
189
|
|
|
|
|
|
|
state => $state, |
190
|
|
|
|
|
|
|
label => ( 'check_' . $phase . '_' . $rel ), |
191
|
|
|
|
|
|
|
phase => $phase, |
192
|
|
|
|
|
|
|
type => $rel, |
193
|
|
|
|
|
|
|
); |
194
|
|
|
|
|
|
|
}; |
195
|
|
|
|
|
|
|
{ |
196
|
|
|
|
|
|
|
## no critic (TestingAndDebugging::ProhibitNoStrict) |
197
|
2
|
|
|
2
|
|
10
|
no strict 'refs'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
228
|
|
198
|
|
|
|
|
|
|
*{$method} = $code; |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
sub check_path { |
212
|
0
|
|
|
0
|
1
|
|
my ( $self, $path ) = @_; |
213
|
0
|
|
|
|
|
|
my $state = {}; |
214
|
0
|
|
|
|
|
|
for my $test ( @{ $self->tests } ) { |
|
0
|
|
|
|
|
|
|
215
|
0
|
|
|
|
|
|
my $method = 'x_test_' . $test; |
216
|
0
|
0
|
|
|
|
|
if ( not $self->can($method) ) { |
217
|
0
|
|
|
|
|
|
return croak("no method $method for test $test"); |
218
|
|
|
|
|
|
|
} |
219
|
0
|
|
|
|
|
|
$self->$method( $path, $state ); |
220
|
|
|
|
|
|
|
} |
221
|
0
|
|
|
|
|
|
return; |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
2
|
|
|
2
|
|
7
|
no Moo; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
11
|
|
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
1; |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
__END__ |