line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Fennec::Collector::TB; |
2
|
139
|
|
|
139
|
|
775
|
use strict; |
|
139
|
|
|
|
|
270
|
|
|
139
|
|
|
|
|
5274
|
|
3
|
139
|
|
|
139
|
|
1303
|
use warnings; |
|
139
|
|
|
|
|
224
|
|
|
139
|
|
|
|
|
3841
|
|
4
|
139
|
|
|
139
|
|
648
|
use Carp qw/confess/; |
|
139
|
|
|
|
|
239
|
|
|
139
|
|
|
|
|
7214
|
|
5
|
|
|
|
|
|
|
|
6
|
139
|
|
|
139
|
|
622
|
use base 'Fennec::Collector'; |
|
139
|
|
|
|
|
307
|
|
|
139
|
|
|
|
|
79701
|
|
7
|
|
|
|
|
|
|
|
8
|
139
|
|
|
139
|
|
1246
|
use Fennec::Util qw/accessors/; |
|
139
|
|
|
|
|
255
|
|
|
139
|
|
|
|
|
1312
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
accessors qw/skip/; |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
1
|
4
|
sub ok { shift; Test::Builder->new->ok(@_) } |
|
2
|
|
|
|
|
85
|
|
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
|
70
|
my $self = shift; |
18
|
|
|
|
|
|
|
|
19
|
22
|
|
|
|
|
452
|
$self->SUPER::finish(); |
20
|
|
|
|
|
|
|
|
21
|
22
|
|
100
|
|
|
228
|
my $count = $self->test_count || 0; |
22
|
22
|
|
|
|
|
1452
|
print STDOUT "1..$count"; |
23
|
22
|
100
|
|
|
|
715
|
print STDOUT " # SKIP " . $self->skip if $self->skip; |
24
|
22
|
|
|
|
|
6323
|
print STDOUT "\n"; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub init { |
28
|
139
|
|
|
139
|
1
|
375
|
my $self = shift; |
29
|
139
|
|
|
|
|
209790
|
require Test::Builder; |
30
|
|
|
|
|
|
|
|
31
|
139
|
|
|
|
|
2370476
|
my $tbout = tie( *TBOUT, 'Fennec::Collector::TB::_Handle', 'STDOUT', $self ); |
32
|
139
|
|
|
|
|
695
|
my $tberr = tie( *TBERR, 'Fennec::Collector::TB::_Handle', 'STDERR', $self ); |
33
|
|
|
|
|
|
|
|
34
|
139
|
|
|
|
|
1371
|
my $tb = Test::Builder->new(); |
35
|
139
|
|
|
|
|
3361
|
$tb->use_numbers(0); |
36
|
139
|
|
|
|
|
1410
|
$tb->no_header(1); |
37
|
139
|
|
|
|
|
1333
|
$tb->no_ending(1); |
38
|
|
|
|
|
|
|
|
39
|
139
|
|
|
|
|
1144
|
my $old = select(TBOUT); |
40
|
139
|
|
|
|
|
525
|
$| = 1; |
41
|
139
|
|
|
|
|
594
|
select(TBERR); |
42
|
139
|
|
|
|
|
388
|
$| = 1; |
43
|
139
|
|
|
|
|
649
|
select($old); |
44
|
|
|
|
|
|
|
|
45
|
139
|
|
|
|
|
684
|
$tb->output( \*TBOUT ); |
46
|
139
|
|
|
|
|
16541
|
$tb->todo_output( \*TBOUT ); |
47
|
139
|
|
|
|
|
2687
|
$tb->failure_output( \*TBERR ); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub render { |
51
|
3483
|
|
|
3483
|
0
|
6355
|
my $self = shift; |
52
|
3483
|
|
|
|
|
5727
|
my ( $handle, $part ) = @_; |
53
|
|
|
|
|
|
|
|
54
|
3483
|
100
|
66
|
|
|
43486
|
if ( $handle eq 'STDOUT' && $part =~ m/^\s*(?:(not)\s+)?ok(\s|$)/ ) { |
55
|
3326
|
100
|
66
|
|
|
43258
|
my $fail = $1 && $1 eq 'not' ? 1 : 0; |
56
|
3326
|
|
|
|
|
10401
|
my ( $mod, $reason ) = $part =~ m/ # (TODO|skip) (.*)$/; |
57
|
3326
|
50
|
66
|
|
|
12170
|
$self->inc_test_failed if $fail && !$mod; |
58
|
3326
|
|
|
|
|
19345
|
$self->inc_test_count; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
3483
|
50
|
|
|
|
11134
|
return $self->debug($part) if $part =~ m/# FENNEC_DEBUG/; |
62
|
|
|
|
|
|
|
|
63
|
3483
|
50
|
33
|
|
|
43665
|
if ( $ENV{HARNESS_IS_VERBOSE} || $handle eq 'STDOUT' ) { |
64
|
3483
|
|
|
|
|
1434738
|
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
|
|
136491
|
use Fennec::Util qw/accessors get_test_call/; |
|
139
|
|
|
|
|
317
|
|
|
139
|
|
|
|
|
866
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
accessors qw/name collector/; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub TIEHANDLE { |
78
|
278
|
|
|
278
|
|
597
|
my $class = shift; |
79
|
278
|
|
|
|
|
725
|
my ( $name, $collector ) = @_; |
80
|
278
|
|
|
|
|
1823
|
return bless( {name => $name, collector => $collector}, $class ); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub PRINT { |
84
|
700
|
|
|
700
|
|
1034560
|
my $self = shift; |
85
|
700
|
|
|
|
|
2531
|
my @data = @_; |
86
|
700
|
|
|
|
|
6356
|
my @call = get_test_call(); |
87
|
|
|
|
|
|
|
|
88
|
700
|
|
|
|
|
5628
|
$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__ |