| 1 | package Test2::Plugin::ExitSummary; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 167 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 167 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 167 | our $VERSION = '1.302226'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 167 | ▶ | use Test2::API qw/test2_add_callback_exit/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 167 | my $ADDED_HOOK = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 177 | ▶ | sub import { test2_add_callback_exit(\&summary) unless $ADDED_HOOK++ } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 5 | ▶ | sub active { $ADDED_HOOK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
active: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 125 | ▶ | sub summary { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
summary: called CC=12 SCAR=24.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 125 | my ($ctx, $real, $new) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | # Avoid double-printing diagnostics if Test::Builder already loaded. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 125 | ▶ | return if $INC{'Test/Builder.pm'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 124 | my $hub = $ctx->hub; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 124 | my $plan = $hub->plan; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 124 | my $count = $hub->count; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 124 | my $failed = $hub->failed; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 124 | ▶ | $ctx->diag('No tests run!') if !$count && (!$plan || $plan ne 'SKIP'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
not $count and !$plan || $plan ne "SKIP"
not $plan or $plan ne "SKIP"
MC/DC100%3/3
not $count and !$plan || $plan ne "SKIP"
not $count
not $plan
$plan ne "SKIP"
Truth table100%4/4
not(A) and not(B) or C
A= not $countB= not $planC= $plan ne "SKIP"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 124 | ▶ | $ctx->diag('Tests were run but no plan was declared and done_testing() was not seen.') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$count and not $plan
MC/DC100%2/2
$count and not $plan
$count
not $plan
Truth table100%3/3
A and not(B)
A= $countB= not $plan
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | if $count && !$plan; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 124 | ▶ | $ctx->diag("Looks like your test exited with $real after test #$count.") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | if $real; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 124 | ▶ | $ctx->diag("Did not follow plan: expected $plan, ran $count.") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
$plan and $plan =~ /^[0-9]+$/ and defined $count and $count != $plan
$plan and $plan =~ /^[0-9]+$/ and defined $count
$plan and $plan =~ /^[0-9]+$/
MC/DC75%3/4
$plan and $plan =~ /^[0-9]+$/ and defined $count and $count != $plan
$plan
$plan =~ /^[0-9]+$/
defined $count
$count != $plan
Truth table80%4/5
A and B and C and D
A= $planB= $plan =~ /^[0-9]+$/C= defined $countD= $count != $plan
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | if $plan && $plan =~ m/^[0-9]+$/ && defined $count && $count != $plan; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 167 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||