line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::XS::Check; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
183092
|
use strict; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use Test2::API qw( context ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
63
|
|
9
|
1
|
|
|
1
|
|
308
|
use XS::Check 0.07; |
|
1
|
|
|
|
|
8869
|
|
|
1
|
|
|
|
|
61
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw( xs_ok ); |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
8
|
use Exporter qw( import ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
165
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub xs_ok { |
16
|
2
|
|
|
2
|
1
|
6455
|
my $file = shift; |
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
|
|
7
|
my $context = context(); |
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
|
|
121
|
my @errors; |
21
|
2
|
|
|
3
|
|
25
|
my $check = XS::Check->new( reporter => sub { push @errors, {@_} } ); |
|
3
|
|
|
|
|
782
|
|
22
|
2
|
|
|
|
|
33
|
$check->check_file($file); |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
10991
|
$context->ok( !@errors, "XS check for $file" ); |
25
|
2
|
100
|
|
|
|
466
|
if (@errors) { |
26
|
1
|
|
|
|
|
8
|
$context->diag("$_->{message} at line $_->{line}") for @errors; |
27
|
|
|
|
|
|
|
} |
28
|
2
|
|
|
|
|
386
|
$context->release; |
29
|
|
|
|
|
|
|
|
30
|
2
|
|
|
|
|
97
|
return !@errors; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# ABSTRACT: Test that your XS files are problem-free with XS::Check |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |