line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Fennec::Collector::TB; |
2
|
139
|
|
|
139
|
|
876
|
use strict; |
|
139
|
|
|
|
|
165
|
|
|
139
|
|
|
|
|
2853
|
|
3
|
139
|
|
|
139
|
|
645
|
use warnings; |
|
139
|
|
|
|
|
194
|
|
|
139
|
|
|
|
|
2688
|
|
4
|
139
|
|
|
139
|
|
600
|
use Carp qw/confess/; |
|
139
|
|
|
|
|
171
|
|
|
139
|
|
|
|
|
4313
|
|
5
|
|
|
|
|
|
|
|
6
|
139
|
|
|
139
|
|
545
|
use base 'Fennec::Collector'; |
|
139
|
|
|
|
|
182
|
|
|
139
|
|
|
|
|
47268
|
|
7
|
|
|
|
|
|
|
|
8
|
139
|
|
|
139
|
|
887
|
use Fennec::Util qw/accessors/; |
|
139
|
|
|
|
|
233
|
|
|
139
|
|
|
|
|
735
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
accessors qw/skip/; |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
1
|
7
|
sub ok { shift; Test::Builder->new->ok(@_) } |
|
2
|
|
|
|
|
64
|
|
13
|
0
|
|
|
0
|
1
|
0
|
sub diag { shift; Test::Builder->new->diag(@_) } |
|
0
|
|
|
|
|
0
|
|
14
|
0
|
|
|
0
|
0
|
0
|
sub report { confess "Must override report" } |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub finish { |
17
|
22
|
|
|
22
|
1
|
91
|
my $self = shift; |
18
|
|
|
|
|
|
|
|
19
|
22
|
|
|
|
|
428
|
$self->SUPER::finish(); |
20
|
|
|
|
|
|
|
|
21
|
22
|
|
100
|
|
|
121
|
my $count = $self->test_count || 0; |
22
|
22
|
|
|
|
|
922
|
print STDOUT "1..$count"; |
23
|
22
|
100
|
|
|
|
556
|
print STDOUT " # SKIP " . $self->skip if $self->skip; |
24
|
22
|
|
|
|
|
1599
|
print STDOUT "\n"; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub init { |
28
|
139
|
|
|
139
|
1
|
222
|
my $self = shift; |
29
|
139
|
|
|
|
|
68513
|
require Test::Builder; |
30
|
|
|
|
|
|
|
|
31
|
139
|
|
|
|
|
5894223
|
my $tbout = tie( *TBOUT, 'Fennec::Collector::TB::_Handle', 'STDOUT', $self ); |
32
|
139
|
|
|
|
|
444
|
my $tberr = tie( *TBERR, 'Fennec::Collector::TB::_Handle', 'STDERR', $self ); |
33
|
|
|
|
|
|
|
|
34
|
139
|
|
|
|
|
512
|
my $tb = Test::Builder->new(); |
35
|
139
|
|
|
|
|
1151
|
$tb->use_numbers(0); |
36
|
139
|
|
|
|
|
14023
|
$tb->no_header(1); |
37
|
139
|
|
|
|
|
12575
|
$tb->no_ending(1); |
38
|
|
|
|
|
|
|
|
39
|
139
|
|
|
|
|
11420
|
my $old = select(TBOUT); |
40
|
139
|
|
|
|
|
368
|
$| = 1; |
41
|
139
|
|
|
|
|
410
|
select(TBERR); |
42
|
139
|
|
|
|
|
304
|
$| = 1; |
43
|
139
|
|
|
|
|
422
|
select($old); |
44
|
|
|
|
|
|
|
|
45
|
139
|
|
|
|
|
516
|
$tb->output( \*TBOUT ); |
46
|
139
|
|
|
|
|
13561
|
$tb->todo_output( \*TBOUT ); |
47
|
139
|
|
|
|
|
12813
|
$tb->failure_output( \*TBERR ); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub render { |
51
|
3728
|
|
|
3728
|
0
|
6712
|
my $self = shift; |
52
|
3728
|
|
|
|
|
9193
|
my ( $handle, $part ) = @_; |
53
|
|
|
|
|
|
|
|
54
|
3728
|
100
|
66
|
|
|
29300
|
if ( $handle eq 'STDOUT' && $part =~ m/^\s*(?:(not)\s+)?ok(\s|$)/ ) { |
55
|
3669
|
100
|
66
|
|
|
16767
|
my $fail = $1 && $1 eq 'not' ? 1 : 0; |
56
|
3669
|
|
|
|
|
9909
|
my ( $mod, $reason ) = $part =~ m/ # (TODO|skip) (.*)$/; |
57
|
3669
|
50
|
66
|
|
|
9253
|
$self->inc_test_failed if $fail && !$mod; |
58
|
3669
|
|
|
|
|
15291
|
$self->inc_test_count; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
3728
|
50
|
|
|
|
9680
|
return $self->debug($part) if $part =~ m/# FENNEC_DEBUG/; |
62
|
|
|
|
|
|
|
|
63
|
3728
|
50
|
33
|
|
|
18786
|
if ( $ENV{HARNESS_IS_VERBOSE} || $handle eq 'STDOUT' ) { |
64
|
3728
|
|
|
|
|
449573
|
print STDOUT "$part\n"; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
else { |
67
|
0
|
|
|
|
|
0
|
print STDERR "$part\n"; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
package Fennec::Collector::TB::_Handle; |
72
|
|
|
|
|
|
|
|
73
|
139
|
|
|
139
|
|
96624
|
use Fennec::Util qw/accessors get_test_call/; |
|
139
|
|
|
|
|
258
|
|
|
139
|
|
|
|
|
633
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
accessors qw/name collector/; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub TIEHANDLE { |
78
|
278
|
|
|
278
|
|
523
|
my $class = shift; |
79
|
278
|
|
|
|
|
563
|
my ( $name, $collector ) = @_; |
80
|
278
|
|
|
|
|
980
|
return bless( {name => $name, collector => $collector}, $class ); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub PRINT { |
84
|
704
|
|
|
704
|
|
406464
|
my $self = shift; |
85
|
704
|
|
|
|
|
2384
|
my @data = @_; |
86
|
704
|
|
|
|
|
4212
|
my @call = get_test_call(); |
87
|
|
|
|
|
|
|
|
88
|
704
|
|
|
|
|
2777
|
$self->collector->report( |
89
|
|
|
|
|
|
|
pid => $$, |
90
|
|
|
|
|
|
|
source => join( ", " => @call[0 .. 2] ), |
91
|
|
|
|
|
|
|
data => \@data, |
92
|
|
|
|
|
|
|
name => $self->name, |
93
|
|
|
|
|
|
|
); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
__END__ |