line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Builder::Formatter; |
2
|
163
|
|
|
163
|
|
1635
|
use strict; |
|
163
|
|
|
|
|
376
|
|
|
163
|
|
|
|
|
5084
|
|
3
|
163
|
|
|
163
|
|
890
|
use warnings; |
|
163
|
|
|
|
|
353
|
|
|
163
|
|
|
|
|
10402
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.302182'; |
6
|
|
|
|
|
|
|
|
7
|
163
|
|
|
163
|
|
73078
|
BEGIN { require Test2::Formatter::TAP; our @ISA = qw(Test2::Formatter::TAP) } |
|
163
|
|
|
|
|
7941
|
|
8
|
|
|
|
|
|
|
|
9
|
163
|
|
|
163
|
|
1311
|
use Test2::Util::HashBase qw/no_header no_diag/; |
|
163
|
|
|
|
|
355
|
|
|
163
|
|
|
|
|
1230
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
163
|
|
|
163
|
|
1620
|
*OUT_STD = Test2::Formatter::TAP->can('OUT_STD'); |
13
|
163
|
|
|
|
|
760
|
*OUT_ERR = Test2::Formatter::TAP->can('OUT_ERR'); |
14
|
|
|
|
|
|
|
|
15
|
163
|
|
|
|
|
647
|
my $todo = OUT_ERR() + 1; |
16
|
163
|
|
|
|
|
62900
|
*OUT_TODO = sub() { $todo }; |
|
0
|
|
|
|
|
0
|
|
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub init { |
20
|
245
|
|
|
245
|
0
|
560
|
my $self = shift; |
21
|
245
|
|
|
|
|
1666
|
$self->SUPER::init(@_); |
22
|
245
|
|
|
|
|
1042
|
$self->{+HANDLES}->[OUT_TODO] = $self->{+HANDLES}->[OUT_STD]; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub plan_tap { |
26
|
334
|
|
|
334
|
0
|
937
|
my ($self, $f) = @_; |
27
|
|
|
|
|
|
|
|
28
|
334
|
100
|
|
|
|
1517
|
return if $self->{+NO_HEADER}; |
29
|
332
|
|
|
|
|
1820
|
return $self->SUPER::plan_tap($f); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub debug_tap { |
33
|
2
|
|
|
2
|
0
|
6
|
my ($self, $f, $num) = @_; |
34
|
2
|
50
|
|
|
|
5
|
return if $self->{+NO_DIAG}; |
35
|
2
|
|
|
|
|
9
|
my @out = $self->SUPER::debug_tap($f, $num); |
36
|
|
|
|
|
|
|
$self->redirect(\@out) if @out && ref $f->{about} && defined $f->{about}->{package} |
37
|
2
|
50
|
33
|
|
|
17
|
&& $f->{about}->{package} eq 'Test::Builder::TodoDiag'; |
|
|
|
33
|
|
|
|
|
|
|
|
33
|
|
|
|
|
38
|
2
|
|
|
|
|
6
|
return @out; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub info_tap { |
42
|
882
|
|
|
882
|
0
|
1630
|
my ($self, $f) = @_; |
43
|
882
|
100
|
|
|
|
1902
|
return if $self->{+NO_DIAG}; |
44
|
881
|
|
|
|
|
2700
|
my @out = $self->SUPER::info_tap($f); |
45
|
|
|
|
|
|
|
$self->redirect(\@out) if @out && ref $f->{about} && defined $f->{about}->{package} |
46
|
881
|
100
|
33
|
|
|
7762
|
&& $f->{about}->{package} eq 'Test::Builder::TodoDiag'; |
|
|
|
33
|
|
|
|
|
|
|
|
66
|
|
|
|
|
47
|
881
|
|
|
|
|
2411
|
return @out; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub redirect { |
51
|
438
|
|
|
438
|
0
|
824
|
my ($self, $out) = @_; |
52
|
438
|
|
|
|
|
1277
|
$_->[0] = OUT_TODO for @$out; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
632
|
|
|
632
|
0
|
1761
|
sub no_subtest_space { 1 } |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=pod |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=encoding UTF-8 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 NAME |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Test::Builder::Formatter - Test::Builder subclass of Test2::Formatter::TAP |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 DESCRIPTION |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This is what takes events and turns them into TAP. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SYNOPSIS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
use Test::Builder; # Loads Test::Builder::Formatter for you |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 SOURCE |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
The source code repository for Test2 can be found at |
80
|
|
|
|
|
|
|
F<http://github.com/Test-More/test-more/>. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 MAINTAINERS |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=over 4 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item Chad Granum E<lt>exodist@cpan.orgE<gt> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=back |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 AUTHORS |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=over 4 |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item Chad Granum E<lt>exodist@cpan.orgE<gt> |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=back |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 COPYRIGHT |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Copyright 2020 Chad Granum E<lt>exodist@cpan.orgE<gt>. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
103
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
See F<http://dev.perl.org/licenses/> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |