line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Builder::Formatter; |
2
|
163
|
|
|
163
|
|
1622
|
use strict; |
|
163
|
|
|
|
|
369
|
|
|
163
|
|
|
|
|
4854
|
|
3
|
163
|
|
|
163
|
|
860
|
use warnings; |
|
163
|
|
|
|
|
348
|
|
|
163
|
|
|
|
|
9911
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.302181'; |
6
|
|
|
|
|
|
|
|
7
|
163
|
|
|
163
|
|
72013
|
BEGIN { require Test2::Formatter::TAP; our @ISA = qw(Test2::Formatter::TAP) } |
|
163
|
|
|
|
|
7951
|
|
8
|
|
|
|
|
|
|
|
9
|
163
|
|
|
163
|
|
1306
|
use Test2::Util::HashBase qw/no_header no_diag/; |
|
163
|
|
|
|
|
332
|
|
|
163
|
|
|
|
|
1133
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
163
|
|
|
163
|
|
1562
|
*OUT_STD = Test2::Formatter::TAP->can('OUT_STD'); |
13
|
163
|
|
|
|
|
819
|
*OUT_ERR = Test2::Formatter::TAP->can('OUT_ERR'); |
14
|
|
|
|
|
|
|
|
15
|
163
|
|
|
|
|
667
|
my $todo = OUT_ERR() + 1; |
16
|
163
|
|
|
|
|
61332
|
*OUT_TODO = sub() { $todo }; |
|
0
|
|
|
|
|
0
|
|
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub init { |
20
|
245
|
|
|
245
|
0
|
556
|
my $self = shift; |
21
|
245
|
|
|
|
|
1638
|
$self->SUPER::init(@_); |
22
|
245
|
|
|
|
|
973
|
$self->{+HANDLES}->[OUT_TODO] = $self->{+HANDLES}->[OUT_STD]; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub plan_tap { |
26
|
334
|
|
|
334
|
0
|
1033
|
my ($self, $f) = @_; |
27
|
|
|
|
|
|
|
|
28
|
334
|
100
|
|
|
|
1429
|
return if $self->{+NO_HEADER}; |
29
|
332
|
|
|
|
|
1791
|
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
|
|
|
|
|
11
|
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
|
|
|
28
|
&& $f->{about}->{package} eq 'Test::Builder::TodoDiag'; |
|
|
|
33
|
|
|
|
|
|
|
|
33
|
|
|
|
|
38
|
2
|
|
|
|
|
8
|
return @out; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub info_tap { |
42
|
882
|
|
|
882
|
0
|
1622
|
my ($self, $f) = @_; |
43
|
882
|
100
|
|
|
|
1903
|
return if $self->{+NO_DIAG}; |
44
|
881
|
|
|
|
|
2619
|
my @out = $self->SUPER::info_tap($f); |
45
|
|
|
|
|
|
|
$self->redirect(\@out) if @out && ref $f->{about} && defined $f->{about}->{package} |
46
|
881
|
100
|
33
|
|
|
7794
|
&& $f->{about}->{package} eq 'Test::Builder::TodoDiag'; |
|
|
|
33
|
|
|
|
|
|
|
|
66
|
|
|
|
|
47
|
881
|
|
|
|
|
2424
|
return @out; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub redirect { |
51
|
438
|
|
|
438
|
0
|
864
|
my ($self, $out) = @_; |
52
|
438
|
|
|
|
|
1290
|
$_->[0] = OUT_TODO for @$out; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
632
|
|
|
632
|
0
|
1704
|
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 |