line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Test::TAP::Model::Subtest; |
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
47245
|
use strict; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
266
|
|
6
|
7
|
|
|
7
|
|
38
|
use warnings; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
461
|
|
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
11896
|
use overload '""' => "str", '==' => "equal"; |
|
7
|
|
|
|
|
11284
|
|
|
7
|
|
|
|
|
51
|
|
9
|
|
|
|
|
|
|
|
10
|
7
|
|
|
7
|
|
559
|
use Carp qw/croak/; |
|
7
|
|
|
|
|
51
|
|
|
7
|
|
|
|
|
7024
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
57
|
|
|
57
|
1
|
121
|
my $pkg = shift; |
14
|
57
|
|
|
|
|
78
|
my $struct = shift; |
15
|
|
|
|
|
|
|
|
16
|
57
|
50
|
|
|
|
155
|
croak "eek! You can't bless non test events into $pkg" unless $struct->{type} eq "test"; |
17
|
|
|
|
|
|
|
|
18
|
57
|
|
|
|
|
339
|
bless \$struct, $pkg; # don't bless the structure, it's not ours to mess with |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
4
|
|
|
4
|
1
|
8046
|
sub str { ${ $_[0] }->{str} } |
|
4
|
|
|
|
|
105
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# predicates about the case |
24
|
16
|
|
|
16
|
1
|
355
|
sub ok { ${ $_[0] }->{ok} }; *passed = \&ok; |
|
16
|
|
|
|
|
826
|
|
25
|
3
|
|
|
3
|
1
|
16
|
sub nok { !$_[0]->ok }; *failed = \&nok; |
26
|
8
|
|
|
8
|
1
|
13
|
sub skipped { ${ $_[0] }->{skip} } |
|
8
|
|
|
|
|
81
|
|
27
|
14
|
|
|
14
|
1
|
22
|
sub todo { ${ $_[0] }->{todo} } |
|
14
|
|
|
|
|
110
|
|
28
|
16
|
|
|
16
|
1
|
28
|
sub actual_ok { ${ $_[0] }->{actual_ok} } |
|
16
|
|
|
|
|
111
|
|
29
|
4
|
|
|
4
|
1
|
11
|
sub actual_nok { !$_[0]->actual_ok } |
30
|
4
|
|
100
|
4
|
1
|
13
|
sub normal { $_[0]->actual_ok xor $_[0]->todo } |
31
|
1
|
|
|
1
|
1
|
4
|
sub unexpected { !$_[0]->normal }; |
32
|
2
|
|
|
2
|
1
|
3
|
sub unplanned { ${ $_[0] }->{unplanned} } |
|
2
|
|
|
|
|
9
|
|
33
|
1
|
|
|
1
|
1
|
5
|
sub planned { !$_[0]->unplanned } |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# member data extraction |
36
|
1
|
|
|
1
|
1
|
4
|
sub num { ${ $_[0] }->{num} } |
|
1
|
|
|
|
|
10
|
|
37
|
4
|
100
|
|
4
|
1
|
13
|
sub diag { ${ $_[0] }->{diag} || ""} |
|
4
|
|
|
|
|
62
|
|
38
|
1
|
50
|
|
1
|
1
|
3
|
sub line { ${ $_[0] }->{line} || ""} |
|
1
|
|
|
|
|
12
|
|
39
|
2
|
|
|
2
|
1
|
15
|
sub reason { ${ $_[0] }->{reason} } # for skip or todo |
|
2
|
|
|
|
|
13
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# pugs specific |
42
|
13
|
50
|
|
13
|
1
|
18
|
sub pos { ${ $_[0] }->{pos} || ""} |
|
13
|
|
|
|
|
222
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# heuristical |
45
|
4
|
50
|
|
4
|
1
|
19
|
sub test_file { $_[0]->pos =~ /(?:file\s+|^)?(\S+?)[\s[:punct:]]*(?:\s+|$)/ ? $1 : "" }; |
46
|
4
|
50
|
|
4
|
1
|
1530
|
sub test_line { $_[0]->pos =~ /line\s+(\d+)/i ? $1 : ""} |
47
|
4
|
100
|
|
4
|
1
|
15
|
sub test_column { $_[0]->pos =~ /column?\s+(\d+)/ ? $1 : ""} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub equal { |
50
|
3
|
|
|
3
|
0
|
4
|
my $self = shift; |
51
|
3
|
|
|
|
|
5
|
my $other = shift; |
52
|
|
|
|
|
|
|
|
53
|
3
|
100
|
25
|
|
|
9
|
($self->actual_ok xor $other->actual_nok) |
|
|
|
50
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
66
|
|
|
|
|
54
|
|
|
|
|
|
|
and |
55
|
|
|
|
|
|
|
($self->skipped xor !$other->skipped) |
56
|
|
|
|
|
|
|
and |
57
|
|
|
|
|
|
|
($self->todo xor !$other->todo) |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__PACKAGE__ |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |