« blib/lib/TAP/Formatter/Camelcade.pm
↑ Summary
blib/lib/TAP/Formatter/Camelcade/MessageBuilder.pm »
| 1 | package TAP::Formatter::Camelcade::Session; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 20 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 20 | ▶ | use warnings FATAL => 'all'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 20 | ▶ | use base 'TAP::Formatter::Session'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 20 | ▶ | use TAP::Formatter::Camelcade::MessageBuilder; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 20 | ▶ | use Time::HiRes qw/time/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 20 | ▶ | use Digest::MD5 qw/md5_hex/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | #@returns TAP::Formatter::Camelcade::MessageBuilder | ||||||||||||||||||||||||||||||||||||||||||
| 10 | sub builder { | ||||||||||||||||||||||||||||||||||||||||||
| 11 | 576 | ▶ | return 'TAP::Formatter::Camelcade::MessageBuilder'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
builder: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | } | ||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | Invoked for every line of parsed result | ||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | sub result { | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 688 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
result: called CC=9 SCAR=26.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | #@type TAP::Parser::Result | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 688 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | 688 | my $type = $result->type; | |||||||||||||||||||||||||||||||||||||||||
| 26 | 688 | ▶ | if ($type eq 'plan') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 8 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 64 | $self->handle_plan($result); | |||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||
| 29 | elsif ($type eq 'pragma') { | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | $self->handle_pragma($result); | |||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||
| 32 | elsif ($type eq 'test') { | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 156 | $self->handle_test($result); | |||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | elsif ($type eq 'comment') { | ||||||||||||||||||||||||||||||||||||||||||
| 36 | 352 | $self->handle_comment($result); | |||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||
| 38 | elsif ($type eq 'bailout') { | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | $self->handle_bailout($result); | |||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||
| 41 | elsif ($type eq 'version') { | ||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | $self->handle_version($result); | |||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | elsif ($type eq 'unknown') { | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 116 | $self->handle_unknown($result); | |||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||
| 47 | elsif ($type eq 'yaml') { | ||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | $self->handle_yaml($result); | |||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||
| 50 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | die "Unknown type: $type"; | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | We are keeping last test failure to append comments into it | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | sub close_pending_test { | ||||||||||||||||||||||||||||||||||||||||||
| 62 | 304 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
close_pending_test: called CC=9 SCAR=22.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 63 | 304 | my $pending_test = $self->get_pending_test; | |||||||||||||||||||||||||||||||||||||||||
| 64 | 304 | $self->{last_test} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 65 | 304 | ▶ | if (!defined $pending_test) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 164 | return; | |||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||
| 68 | 140 | $self->set_last_time; | |||||||||||||||||||||||||||||||||||||||||
| 69 | 140 | my $test_output = join "\n", @{$pending_test->{output}}; | |||||||||||||||||||||||||||||||||||||||||
| 70 | 140 | ▶ | $test_output //= ""; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$test_output //= ""
MC/DC0%0/1
$test_output //= ""
$test_output
Truth table50%1/2
A
A= $test_output
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | 140 | $test_output =~ s{(\A\n+|\n+\z)}{}gs; | |||||||||||||||||||||||||||||||||||||||||
| 72 | 140 | ▶ | if ($pending_test->{is_ok}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 73 | 120 | ▶ | if ($pending_test->{is_skip}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | builder->test_ignored( | ||||||||||||||||||||||||||||||||||||||||||
| 75 | $pending_test->{name}, | ||||||||||||||||||||||||||||||||||||||||||
| 76 | $test_output, | ||||||||||||||||||||||||||||||||||||||||||
| 77 | $pending_test->{nodeId}, | ||||||||||||||||||||||||||||||||||||||||||
| 78 | $pending_test->{parentNodeId}, | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 48 | ); | |||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||
| 81 | elsif (length $test_output > 0) { | ||||||||||||||||||||||||||||||||||||||||||
| 82 | builder->stderr( | ||||||||||||||||||||||||||||||||||||||||||
| 83 | $pending_test->{name}, | ||||||||||||||||||||||||||||||||||||||||||
| 84 | $test_output, | ||||||||||||||||||||||||||||||||||||||||||
| 85 | $pending_test->{nodeId}, | ||||||||||||||||||||||||||||||||||||||||||
| 86 | $pending_test->{parentNodeId}, | ||||||||||||||||||||||||||||||||||||||||||
| 87 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||
| 90 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 91 | 20 | my @extra = (); | |||||||||||||||||||||||||||||||||||||||||
| 92 | 20 | ▶ | if ($test_output) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | 20 | my $normalized_output = $test_output; | |||||||||||||||||||||||||||||||||||||||||
| 94 | 20 | $normalized_output =~ s{^\s*# }{}gmi; | |||||||||||||||||||||||||||||||||||||||||
| 95 | # use v5.10; say STDERR "Normalized as $normalized_output"; | ||||||||||||||||||||||||||||||||||||||||||
| 96 | 20 | ▶ | if ($normalized_output =~ m{ got: '(.*?)'\n expected: '(.*)'}s) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | 20 | @extra = ( | |||||||||||||||||||||||||||||||||||||||||
| 98 | type => 'comparisonFailure', | ||||||||||||||||||||||||||||||||||||||||||
| 99 | actual => $1, | ||||||||||||||||||||||||||||||||||||||||||
| 100 | expected => $2 | ||||||||||||||||||||||||||||||||||||||||||
| 101 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||
| 104 | 20 | $test_output =~ s/^\s+//gm; | |||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||
| 106 | builder->test_failed( | ||||||||||||||||||||||||||||||||||||||||||
| 107 | $pending_test->{name}, | ||||||||||||||||||||||||||||||||||||||||||
| 108 | $pending_test->{explanation} // "", | ||||||||||||||||||||||||||||||||||||||||||
| 109 | $pending_test->{nodeId}, | ||||||||||||||||||||||||||||||||||||||||||
| 110 | $pending_test->{parentNodeId}, | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 20 | ▶ | details => $test_output, | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$pending_test->{"explanation"} // ""
MC/DC0%0/1
$pending_test->{"explanation"} // ""
$pending_test->{"explanation"}
Truth table50%1/2
A
A= $pending_test->{"explanation"}
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | @extra | ||||||||||||||||||||||||||||||||||||||||||
| 113 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | 20 | $self->{failures}++; | |||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||
| 117 | 140 | builder->test_finished(@$pending_test{qw/name duration nodeId parentNodeId/}); | |||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | sub start_test { | ||||||||||||||||||||||||||||||||||||||||||
| 121 | 140 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start_test: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | #@type TAP::Parser::Result::Test | ||||||||||||||||||||||||||||||||||||||||||
| 123 | 140 | my $test = shift; | |||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||
| 125 | 140 | my $last_time = $self->get_last_time; | |||||||||||||||||||||||||||||||||||||||||
| 126 | 140 | my $test_name = $self->_compute_test_name($test); | |||||||||||||||||||||||||||||||||||||||||
| 127 | 140 | my $test_duration = int((time - $last_time) * 1000); | |||||||||||||||||||||||||||||||||||||||||
| 128 | 140 | $self->close_pending_test; | |||||||||||||||||||||||||||||||||||||||||
| 129 | $self->{last_test} = { | ||||||||||||||||||||||||||||||||||||||||||
| 130 | name => $test_name, | ||||||||||||||||||||||||||||||||||||||||||
| 131 | 140 | ▶ | duration => $ENV{TAP_FORMATTER_CAMELCADE_DURATION} // $test_duration, | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$ENV{"TAP_FORMATTER_CAMELCADE_DURATION"} // $test_duration
MC/DC0%0/2
$ENV{"TAP_FORMATTER_CAMELCADE_DURATION"} // $test_duration
$ENV{"TAP_FORMATTER_CAMELCADE_DURATION"}
$test_duration
Truth table33%1/3
A // B
A= $ENV{"TAP_FORMATTER_CAMELCADE_DURATION"}B= $test_duration
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | is_ok => scalar $test->is_ok, | ||||||||||||||||||||||||||||||||||||||||||
| 133 | is_skip => scalar $test->has_directive, | ||||||||||||||||||||||||||||||||||||||||||
| 134 | output => [], | ||||||||||||||||||||||||||||||||||||||||||
| 135 | explanation => scalar $test->explanation, | ||||||||||||||||||||||||||||||||||||||||||
| 136 | nodeId => scalar $self->generate_test_id($test_name), | ||||||||||||||||||||||||||||||||||||||||||
| 137 | parentNodeId => scalar $self->get_parent_node_id | ||||||||||||||||||||||||||||||||||||||||||
| 138 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 140 | builder->test_started(@{$self->{last_test}}{qw/name nodeId parentNodeId/}); | |||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||
| 142 | sub set_last_time { | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 208 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_last_time: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | 208 | $self->{last_time} = time; | |||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||
| 147 | sub get_last_time { | ||||||||||||||||||||||||||||||||||||||||||
| 148 | 140 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_last_time: called CC=2 SCAR=8.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 149 | 140 | ▶ | return $self->{last_time} // time; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->{"last_time"} // &TAP::Formatter::Camelcade::Session::time()
MC/DC0%0/2
$self->{"last_time"} // &TAP::Formatter::Camelcade::Session::time()
$self->{"last_time"}
&TAP::Formatter::Camelcade::Session::time()
Truth table33%1/3
A // B
A= $self->{"last_time"}B= &TAP::Formatter::Camelcade::Session::time()
| |||||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||
| 152 | sub get_pending_test { | ||||||||||||||||||||||||||||||||||||||||||
| 153 | 640 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_pending_test: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 154 | 640 | return $self->{last_test}; | |||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | sub _compute_test_name { | ||||||||||||||||||||||||||||||||||||||||||
| 158 | 296 | ▶ | shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_compute_test_name: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | #@type TAP::Parser::Result::Test | ||||||||||||||||||||||||||||||||||||||||||
| 160 | 296 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 161 | 296 | my $base_name = ""; | |||||||||||||||||||||||||||||||||||||||||
| 162 | 296 | my $description = $result->description; | |||||||||||||||||||||||||||||||||||||||||
| 163 | 296 | my $explanation = $result->explanation; | |||||||||||||||||||||||||||||||||||||||||
| 164 | 296 | ▶ | if( $description ){ | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 165 | 184 | $base_name = $description; | |||||||||||||||||||||||||||||||||||||||||
| 166 | 184 | ▶ | if( $explanation ){ | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | 16 | $base_name .= " ($explanation)"; | |||||||||||||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||
| 170 | elsif( $explanation){ | ||||||||||||||||||||||||||||||||||||||||||
| 171 | 80 | $base_name = $explanation; | |||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||
| 174 | 296 | $base_name =~ s/^-\s//; | |||||||||||||||||||||||||||||||||||||||||
| 175 | 296 | ▶ | $base_name ||= 'Unnamed test (#' . $result->number . ')'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$base_name ||= 'Unnamed test (#' . $result->number . ')'
MC/DC100%1/1
$base_name ||= 'Unnamed test (#' . $result->number . ')'
$base_name
Truth table100%2/2
A
A= $base_name
| |||||||||||||||||||||||||||||||||||||||||||
| 176 | 296 | ▶ | my $directive = $result->directive // ""; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$result->directive // ""
MC/DC0%0/1
$result->directive // ""
$result->directive
Truth table50%1/2
A
A= $result->directive
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | 296 | ▶ | return join" ", ($directive ? ($directive) : ()), $base_name; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||
| 180 | sub handle_plan { | ||||||||||||||||||||||||||||||||||||||||||
| 181 | 64 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle_plan: called CC=2 SCAR=7.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 182 | #@type TAP::Parser::Result::Plan | ||||||||||||||||||||||||||||||||||||||||||
| 183 | 64 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 184 | 64 | $self->close_pending_test; | |||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||
| 186 | 64 | ▶ | if ($result->directive eq 'SKIP') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | builder->output($result->explanation); | |||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||
| 191 | sub handle_pragma { | ||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle_pragma: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 193 | #@type TAP::Parser::Result::Pragma | ||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | $self->process_as_comment($result); | |||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||
| 198 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | Invoked for every test result | ||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||
| 202 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||
| 204 | sub handle_test { | ||||||||||||||||||||||||||||||||||||||||||
| 205 | 156 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle_test: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 206 | #@type TAP::Parser::Result::Test | ||||||||||||||||||||||||||||||||||||||||||
| 207 | 156 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | 156 | my $test_name = $self->_compute_test_name($result); | |||||||||||||||||||||||||||||||||||||||||
| 210 | 156 | ▶ | if ($self->is_subtest($test_name)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 211 | 16 | $self->finish_subtest; | |||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||
| 213 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 214 | 140 | $self->start_test($result); | |||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||
| 218 | sub handle_comment { | ||||||||||||||||||||||||||||||||||||||||||
| 219 | 352 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle_comment: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 220 | #@type TAP::Parser::Result::Comment | ||||||||||||||||||||||||||||||||||||||||||
| 221 | 352 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||
| 223 | 352 | my $comment = $result->raw; | |||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||
| 225 | 352 | ▶ | if ($comment =~ /^\s*# Subtest: (.+)$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 226 | 16 | $self->start_subtest($1); | |||||||||||||||||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||||||||||||||||
| 228 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 229 | 336 | my $last_test = $self->get_pending_test; | |||||||||||||||||||||||||||||||||||||||||
| 230 | 336 | ▶ | if ($last_test) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 231 | 292 | push @{$last_test->{output}}, $comment; | |||||||||||||||||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||||||||||||||||
| 233 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 234 | 44 | builder->warning($comment); | |||||||||||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||||||||||
| 239 | sub handle_bailout { | ||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle_bailout: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 241 | #@type TAP::Parser::Result::Bailout | ||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | $self->process_as_comment($result); | |||||||||||||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||
| 246 | sub handle_version { | ||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle_version: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 248 | #@type TAP::Parser::Result::Version | ||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | $self->process_as_comment($result); | |||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||
| 253 | sub handle_unknown { | ||||||||||||||||||||||||||||||||||||||||||
| 254 | 116 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle_unknown: called CC=6 SCAR=18.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 255 | #@type TAP::Parser::Result::Unknown | ||||||||||||||||||||||||||||||||||||||||||
| 256 | 116 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 257 | 116 | my $raw = $result->raw; | |||||||||||||||||||||||||||||||||||||||||
| 258 | 116 | ▶ | if ($self->in_in_subtest && $raw =~ /^\s*(((?:not )?ok) ([0-9]+)(?: (- .*))?)$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition100%3/3
$self->in_in_subtest and $raw =~ /^\s*(((?:not )?ok) ([0-9]+)(?: (- .*))?)$/
MC/DC100%2/2
$self->in_in_subtest and $raw =~ /^\s*(((?:not )?ok) ([0-9]+)(?: (- .*))?)$/
$self->in_in_subtest
$raw =~ /^\s*(((?:not )?ok) ([0-9]+)(?: (- .*))?)$/
Truth table100%3/3
A and B
A= $self->in_in_subtestB= $raw =~ /^\s*(((?:not )?ok) ([0-9]+)(?: (- .*))?)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 259 | 16 | my $test_raw = $1; | |||||||||||||||||||||||||||||||||||||||||
| 260 | 16 | my $is_ok = $2; | |||||||||||||||||||||||||||||||||||||||||
| 261 | 16 | my $test_num = $3; | |||||||||||||||||||||||||||||||||||||||||
| 262 | 16 | ▶ | my $description = $4 // ""; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$4 // ""
MC/DC100%1/1
$4 // ""
$4
Truth table100%2/2
A
A= $4
| |||||||||||||||||||||||||||||||||||||||||||
| 263 | 16 | $self->result(TAP::Parser::Result::Test->new({ | |||||||||||||||||||||||||||||||||||||||||
| 264 | raw => $test_raw, | ||||||||||||||||||||||||||||||||||||||||||
| 265 | ok => $is_ok, | ||||||||||||||||||||||||||||||||||||||||||
| 266 | test_num => $test_num, | ||||||||||||||||||||||||||||||||||||||||||
| 267 | description => $description, | ||||||||||||||||||||||||||||||||||||||||||
| 268 | type => 'test', | ||||||||||||||||||||||||||||||||||||||||||
| 269 | explanation => '', | ||||||||||||||||||||||||||||||||||||||||||
| 270 | directive => '', | ||||||||||||||||||||||||||||||||||||||||||
| 271 | })); | ||||||||||||||||||||||||||||||||||||||||||
| 272 | } | ||||||||||||||||||||||||||||||||||||||||||
| 273 | elsif ($raw =~ /^\s+# Subtest: (.+)$/) { | ||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | $self->start_subtest($1); | |||||||||||||||||||||||||||||||||||||||||
| 275 | } | ||||||||||||||||||||||||||||||||||||||||||
| 276 | elsif ($raw =~ /^\s*\d+\.\.\d+$/) { | ||||||||||||||||||||||||||||||||||||||||||
| 277 | # ignore | ||||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||
| 279 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 280 | 84 | $self->process_as_comment($result); | |||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||
| 284 | #@returns TAP::Parser::Result::Comment | ||||||||||||||||||||||||||||||||||||||||||
| 285 | sub process_as_comment { | ||||||||||||||||||||||||||||||||||||||||||
| 286 | 84 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process_as_comment: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 287 | #@type TAP::Parser::Result | ||||||||||||||||||||||||||||||||||||||||||
| 288 | 84 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 289 | 84 | my $comment = $result->raw; | |||||||||||||||||||||||||||||||||||||||||
| 290 | 84 | $comment =~ s/^\s+//; | |||||||||||||||||||||||||||||||||||||||||
| 291 | # use Data::Dumper; print STDERR "Handling: ".Dumper($result); | ||||||||||||||||||||||||||||||||||||||||||
| 292 | 84 | $self->result(TAP::Parser::Result::Comment->new({ | |||||||||||||||||||||||||||||||||||||||||
| 293 | raw => scalar $result->raw, | ||||||||||||||||||||||||||||||||||||||||||
| 294 | type => 'comment', | ||||||||||||||||||||||||||||||||||||||||||
| 295 | comment => $comment | ||||||||||||||||||||||||||||||||||||||||||
| 296 | })); | ||||||||||||||||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||
| 299 | sub handle_yaml { | ||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle_yaml: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 301 | #@type TAP::Parser::Result::YAML | ||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | my $result = shift; | |||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | $self->process_as_comment($result); | |||||||||||||||||||||||||||||||||||||||||
| 304 | } | ||||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||
| 306 | sub close_test { | ||||||||||||||||||||||||||||||||||||||||||
| 307 | 68 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
close_test: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 308 | 68 | $self->finish_suite; | |||||||||||||||||||||||||||||||||||||||||
| 309 | } | ||||||||||||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||||||||||||
| 311 | #@override | ||||||||||||||||||||||||||||||||||||||||||
| 312 | sub _initialize { | ||||||||||||||||||||||||||||||||||||||||||
| 313 | 68 | ▶ | my ($self, $arg_for) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_initialize: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||
| 315 | 68 | $self->{location} = delete $$arg_for{location}; | |||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||
| 317 | 68 | $self->SUPER::_initialize($arg_for); | |||||||||||||||||||||||||||||||||||||||||
| 318 | 68 | $self->{subtests} = []; | |||||||||||||||||||||||||||||||||||||||||
| 319 | 68 | $self->{suites} = []; | |||||||||||||||||||||||||||||||||||||||||
| 320 | 68 | $self->{counter} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 321 | 68 | $self->{failures} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 322 | # $arg_for has parser, name, formatter | ||||||||||||||||||||||||||||||||||||||||||
| 323 | 68 | $self->start_suite($self->name, $self->{location}); | |||||||||||||||||||||||||||||||||||||||||
| 324 | 68 | $self->set_last_time; | |||||||||||||||||||||||||||||||||||||||||
| 325 | 68 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||
| 328 | sub start_suite { | ||||||||||||||||||||||||||||||||||||||||||
| 329 | 84 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start_suite: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 330 | 84 | my $name = shift; | |||||||||||||||||||||||||||||||||||||||||
| 331 | 84 | my $location = shift; | |||||||||||||||||||||||||||||||||||||||||
| 332 | 84 | ▶ | my $suite = { | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$location || $name
MC/DC0%0/2
$location || $name
$location
$name
Truth table66%2/3
A || B
A= $locationB= $name
| |||||||||||||||||||||||||||||||||||||||||||
| 333 | name => $name, | ||||||||||||||||||||||||||||||||||||||||||
| 334 | nodeId => scalar $self->generate_suite_id($name, $location), | ||||||||||||||||||||||||||||||||||||||||||
| 335 | parentNodeId => scalar $self->get_parent_node_id(), | ||||||||||||||||||||||||||||||||||||||||||
| 336 | location => $location || $name | ||||||||||||||||||||||||||||||||||||||||||
| 337 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 338 | 84 | push @{$self->{suites}}, $suite; | |||||||||||||||||||||||||||||||||||||||||
| 339 | 84 | builder->test_suite_started(@$suite{qw/name location nodeId parentNodeId/}); | |||||||||||||||||||||||||||||||||||||||||
| 340 | } | ||||||||||||||||||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||||||||||||||||
| 342 | sub generate_suite_id { | ||||||||||||||||||||||||||||||||||||||||||
| 343 | 84 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
generate_suite_id: called CC=4 SCAR=14.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 344 | 84 | my $name = shift; | |||||||||||||||||||||||||||||||||||||||||
| 345 | 84 | my $location = shift; | |||||||||||||||||||||||||||||||||||||||||
| 346 | 84 | ▶ | my $new_id = join '-', $location || $name, $ENV{TAP_FORMATTER_CAMELCADE_DURATION} ? () : ($$, time), $self->{counter}++; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$location || $name
MC/DC0%0/2
$location || $name
$location
$name
Truth table66%2/3
A || B
A= $locationB= $name
| |||||||||||||||||||||||||||||||||||||||||||
| 347 | 84 | ▶ | return $ENV{TAP_FORMATTER_CAMELCADE_DURATION} ? $new_id : md5_hex($new_id); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 348 | } | ||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||
| 350 | sub generate_test_id { | ||||||||||||||||||||||||||||||||||||||||||
| 351 | 144 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
generate_test_id: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 352 | 144 | my $name = shift; | |||||||||||||||||||||||||||||||||||||||||
| 353 | 144 | my $new_id = join '-', $self->get_parent_node_id, $name, $self->{counter}++; | |||||||||||||||||||||||||||||||||||||||||
| 354 | 144 | ▶ | return $ENV{TAP_FORMATTER_CAMELCADE_DURATION} ? $new_id : md5_hex($new_id); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 355 | } | ||||||||||||||||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||||||||||||||||
| 357 | sub get_current_suite { | ||||||||||||||||||||||||||||||||||||||||||
| 358 | 372 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_current_suite: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 359 | 372 | ▶ | if (scalar @{$self->{suites}} == 0) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 360 | 68 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||
| 362 | 304 | return $self->{suites}->[$#{$self->{suites}}]; | |||||||||||||||||||||||||||||||||||||||||
| 363 | } | ||||||||||||||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||||||||||||||
| 365 | sub get_parent_node_id { | ||||||||||||||||||||||||||||||||||||||||||
| 366 | 372 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_parent_node_id: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 367 | 372 | my $current_suite = $self->get_current_suite; | |||||||||||||||||||||||||||||||||||||||||
| 368 | 372 | ▶ | return defined $current_suite ? $current_suite->{nodeId} : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 369 | } | ||||||||||||||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||||||||||||||
| 371 | sub finish_suite { | ||||||||||||||||||||||||||||||||||||||||||
| 372 | 84 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
finish_suite: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 373 | 84 | $self->close_pending_test; | |||||||||||||||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||||||||||||||||
| 375 | 84 | my $parser = $self->parser; | |||||||||||||||||||||||||||||||||||||||||
| 376 | 84 | ▶ | if (!$self->{failures} && UNIVERSAL::isa($parser, 'TAP::Parser') && $parser->{exit}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
not $self->{"failures"} and UNIVERSAL::isa($parser, "TAP::Parser") and $parser->{"exit"}
not $self->{"failures"} and UNIVERSAL::isa($parser, "TAP::Parser")
MC/DC66%2/3
not $self->{"failures"} and UNIVERSAL::isa($parser, "TAP::Parser") and $parser->{"exit"}
not $self->{"failures"}
UNIVERSAL::isa($parser, "TAP::Parser")
$parser->{"exit"}
Truth table75%3/4
not(A) and B and C
A= not $self->{"failures"}B= UNIVERSAL::isa($parser, "TAP::Parser")C= $parser->{"exit"}
| |||||||||||||||||||||||||||||||||||||||||||
| 377 | 4 | my $test_name = 'Initialization error'; | |||||||||||||||||||||||||||||||||||||||||
| 378 | 4 | my $test_id = $self->generate_test_id($test_name); | |||||||||||||||||||||||||||||||||||||||||
| 379 | 4 | my $parent_node_id = $self->get_parent_node_id; | |||||||||||||||||||||||||||||||||||||||||
| 380 | 4 | builder->test_started($test_name, $test_id, $parent_node_id); | |||||||||||||||||||||||||||||||||||||||||
| 381 | 4 | builder->test_failed($test_name, "Non-zero exit code: $parser->{exit}", $test_id, $parent_node_id); | |||||||||||||||||||||||||||||||||||||||||
| 382 | 4 | builder->test_finished($test_name, 0, $test_id, $parent_node_id); | |||||||||||||||||||||||||||||||||||||||||
| 383 | } | ||||||||||||||||||||||||||||||||||||||||||
| 384 | |||||||||||||||||||||||||||||||||||||||||||
| 385 | 84 | my $current_suite = pop @{$self->{suites}}; | |||||||||||||||||||||||||||||||||||||||||
| 386 | 84 | ▶ | return unless $current_suite; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 387 | 84 | builder->test_suite_finished(@$current_suite{qw/name nodeId parentNodeId/}); | |||||||||||||||||||||||||||||||||||||||||
| 388 | } | ||||||||||||||||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||||||||||||||||
| 390 | sub start_subtest { | ||||||||||||||||||||||||||||||||||||||||||
| 391 | 16 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start_subtest: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 392 | 16 | my $subtest_name = shift; | |||||||||||||||||||||||||||||||||||||||||
| 393 | 16 | $self->close_pending_test; | |||||||||||||||||||||||||||||||||||||||||
| 394 | 16 | push @{$self->{subtests}}, $subtest_name; | |||||||||||||||||||||||||||||||||||||||||
| 395 | 16 | $self->start_suite($subtest_name); | |||||||||||||||||||||||||||||||||||||||||
| 396 | } | ||||||||||||||||||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||||||||||||||||
| 398 | sub is_subtest { | ||||||||||||||||||||||||||||||||||||||||||
| 399 | 156 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_subtest: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 400 | 156 | my $test_name = shift; | |||||||||||||||||||||||||||||||||||||||||
| 401 | 156 | my $last_index = $#{$self->{subtests}}; | |||||||||||||||||||||||||||||||||||||||||
| 402 | 156 | ▶ | return $last_index > -1 && $self->{subtests}->[$last_index] eq $test_name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$last_index > -1 && $self->{'subtests'}[$last_index] eq $test_name
MC/DC100%2/2
$last_index > -1 && $self->{'subtests'}[$last_index] eq $test_name
$last_index > -1
$self->{'subtests'}[$last_index] eq $test_name
Truth table100%3/3
A && B
A= $last_index > -1B= $self->{'subtests'}[$last_index] eq $test_name
| |||||||||||||||||||||||||||||||||||||||||||
| 403 | } | ||||||||||||||||||||||||||||||||||||||||||
| 404 | |||||||||||||||||||||||||||||||||||||||||||
| 405 | sub in_in_subtest { | ||||||||||||||||||||||||||||||||||||||||||
| 406 | 116 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
in_in_subtest: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 407 | 116 | return scalar @{$self->{subtests}}; | |||||||||||||||||||||||||||||||||||||||||
| 408 | } | ||||||||||||||||||||||||||||||||||||||||||
| 409 | |||||||||||||||||||||||||||||||||||||||||||
| 410 | sub finish_subtest { | ||||||||||||||||||||||||||||||||||||||||||
| 411 | 16 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
finish_subtest: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 412 | 16 | my $subtest_name = pop @{$self->{subtests}}; | |||||||||||||||||||||||||||||||||||||||||
| 413 | 16 | ▶ | return unless $subtest_name; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 414 | 16 | $self->finish_suite; | |||||||||||||||||||||||||||||||||||||||||
| 415 | } | ||||||||||||||||||||||||||||||||||||||||||
| 416 | |||||||||||||||||||||||||||||||||||||||||||
| 417 | #@method | ||||||||||||||||||||||||||||||||||||||||||
| 418 | #@override | ||||||||||||||||||||||||||||||||||||||||||
| 419 | sub _should_show_count { | ||||||||||||||||||||||||||||||||||||||||||
| 420 | 68 | ▶ | 0; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_should_show_count: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 421 | } | ||||||||||||||||||||||||||||||||||||||||||
| 422 | |||||||||||||||||||||||||||||||||||||||||||
| 423 | 20 | 1; | |||||||||||||||||||||||||||||||||||||||||