blib/lib/Test/Builder/Formatter.pm

filter: Statementstmt 97.3% 36 / 37 Branchbran 80.0% 8 / 10 Conditioncond 38.8% 7 / 18 MC/DCmcdc 12.5% 1 / 8 Subroutinesub 91.6% 11 / 12 Podpod 0.0% 0 / 6 totaltotal 69.2% 63 / 91 CC 13 SCAR 15.4
CC
13
Cov
78%
debug_tap
9.2
info_tap
6.8
plan_tap
2.0
CRAP 4.7
« blib/lib/Test2/Hub/Subtest.pm ↑ Summary lib/Test/Tester/Capture.pm »
1 package Test::Builder::Formatter;
2 184 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 184 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 184 our $VERSION = '1.302226';
6  
7 184 ▶BEGIN { require Test2::Formatter::TAP; our @ISA = qw(Test2::Formatter::TAP) }
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 184 ▶use Test2::Util::HashBase qw/no_header no_diag/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 184 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.1
12 184 *OUT_STD = Test2::Formatter::TAP->can('OUT_STD');
13 184 *OUT_ERR = Test2::Formatter::TAP->can('OUT_ERR');
14  
15 184 my $todo = OUT_ERR() + 1;
16 0 ▶ *OUT_TODO = sub() { $todo };
Subroutine __ANON__: not called CC=1 SCAR=1.2
17 }
18  
19 279 ▶sub init {
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
20 279 my $self = shift;
21 279 $self->SUPER::init(@_);
22 279 $self->{+HANDLES}->[OUT_TODO] = $self->{+HANDLES}->[OUT_STD];
23 }
24  
25 349 ▶sub plan_tap {
Subroutine plan_tap: called CC=2 SCAR=6.9
Pod undocumented
26 349 my ($self, $f) = @_;
27  
28 349 ▶ return if $self->{+NO_HEADER};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"no_header"} 2 347 349
29 347 return $self->SUPER::plan_tap($f);
30 }
31  
32 2 ▶sub debug_tap {
Subroutine debug_tap: called CC=6 SCAR=22.1
Pod undocumented
33 2 my ($self, $f, $num) = @_;
34 2 ▶ return if $self->{+NO_DIAG};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"no_diag"} 0 2 2
35 2 my @out = $self->SUPER::debug_tap($f, $num);
36 $self->redirect(\@out) if @out && ref $f->{about} && defined $f->{about}->{package}
37 2 ▶ && $f->{about}->{package} eq 'Test::Builder::TodoDiag';
Branch: 1 branch
BranchTrueFalseTotal
if @out and ref $f->{"about"} and defined $f->{"about"}{"package"} and $f->{"about"}{"package"} eq "Test::Builder::TodoDiag" 0 2 2
Condition33%3/9
@out and ref $f->{"about"} and defined $f->{"about"}{"package"} and $f->{"about"}{"package"} eq "Test::Builder::TodoDiag"
!ll&&!rl&&r
020
@out and ref $f->{"about"} and defined $f->{"about"}{"package"}
!ll&&!rl&&r
002
@out and ref $f->{"about"}
!ll&&!rl&&r
002
MC/DC0%0/4
@out and ref $f->{"about"} and defined $f->{"about"}{"package"} and $f->{"about"}{"package"} eq "Test::Builder::TodoDiag"
@out ref $f->{"about"} defined $f->{"about"}{"package"} $f->{"about"}{"package"} eq "Test::Builder::TodoDiag"
Truth table20%1/5
A and B and C and D
A= @outB= ref $f->{"about"}C= defined $f->{"about"}{"package"}D= $f->{"about"}{"package"} eq "Test::Builder::TodoDiag"
ABCDresult
0XXX0
10XX0
110X0
11100
11111
38 2 return @out;
39 }
40  
41 916 ▶sub info_tap {
Subroutine info_tap: called CC=6 SCAR=19.1
Pod undocumented
42 916 my ($self, $f) = @_;
43 916 ▶ return if $self->{+NO_DIAG};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"no_diag"} 1 915 916
44 915 my @out = $self->SUPER::info_tap($f);
45 $self->redirect(\@out) if @out && ref $f->{about} && defined $f->{about}->{package}
46 915 ▶ && $f->{about}->{package} eq 'Test::Builder::TodoDiag';
Branch: 1 branch
BranchTrueFalseTotal
if @out and ref $f->{"about"} and defined $f->{"about"}{"package"} and $f->{"about"}{"package"} eq "Test::Builder::TodoDiag" 439 476 915
Condition44%4/9
@out and ref $f->{"about"} and defined $f->{"about"}{"package"} and $f->{"about"}{"package"} eq "Test::Builder::TodoDiag"
!ll&&!rl&&r
0476439
@out and ref $f->{"about"} and defined $f->{"about"}{"package"}
!ll&&!rl&&r
00915
@out and ref $f->{"about"}
!ll&&!rl&&r
00915
MC/DC25%1/4
@out and ref $f->{"about"} and defined $f->{"about"}{"package"} and $f->{"about"}{"package"} eq "Test::Builder::TodoDiag"
@out ref $f->{"about"} defined $f->{"about"}{"package"} $f->{"about"}{"package"} eq "Test::Builder::TodoDiag"
Truth table40%2/5
A and B and C and D
A= @outB= ref $f->{"about"}C= defined $f->{"about"}{"package"}D= $f->{"about"}{"package"} eq "Test::Builder::TodoDiag"
ABCDresult
0XXX0
10XX0
110X0
11100
11111
47 915 return @out;
48 }
49  
50 439 ▶sub redirect {
Subroutine redirect: called CC=2 SCAR=6.9
Pod undocumented
51 439 my ($self, $out) = @_;
52 439 $_->[0] = OUT_TODO for @$out;
53 }
54  
55 651 ▶sub no_subtest_space { 1 }
Subroutine no_subtest_space: called CC=1 SCAR=0.0
Pod undocumented
56  
57 184 1;
58  
59 __END__
« blib/lib/Test2/Hub/Subtest.pm ↑ Summary lib/Test/Tester/Capture.pm »