| 1 | package Test::Catch; | ||||||||||
| 2 | 2 | ▶ | use 5.012; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use Test::More(); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use XS::libcatch(); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use Test::Builder(); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 2 | our $VERSION = '2.0.2'; | |||||||||
| 8 | |||||||||||
| 9 | 2 | XS::Loader::load(); | |||||||||
| 10 | |||||||||||
| 11 | 3 | ▶ | sub import { | ||||||||
|
Subroutine
import: called CC=2 SCAR=6.9
| |||||||||||
| 12 | 3 | shift; | |||||||||
| 13 | 3 | ▶ | if (@_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 1 | run(@_); | |||||||||
| 15 | 1 | Test::More::done_testing(); | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 3 | my $pkg = caller(); | |||||||||
| 19 | 2 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 3 | *{"${pkg}::catch_run"} = \&run; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 5 | ▶ | sub run { | ||||||||
|
Subroutine
run: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 24 | 5 | my @args = @_; | |||||||||
| 25 | 5 | my $ctx = Test::Builder->new->ctx; | |||||||||
| 26 | 5 | my $hub = $ctx->hub; | |||||||||
| 27 | 5 | my $count = $hub->count; | |||||||||
| 28 | 5 | my $failed = $hub->failed; | |||||||||
| 29 | 5 | my $depth = $hub->nested; | |||||||||
| 30 | 5 | my $ret = _run($count, $failed, $depth, @args); | |||||||||
| 31 | 5 | $hub->set_count($count); | |||||||||
| 32 | 5 | $hub->set_failed($failed); | |||||||||
| 33 | 5 | $ctx->release; | |||||||||
| 34 | 5 | return $ret; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 2 | 1; | |||||||||