| Filename | /home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Test2/Event/Fail.pm |
| Statements | Executed 13 statements in 291µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 11µs | 12µs | Test2::Event::Fail::BEGIN@2 |
| 1 | 1 | 1 | 8µs | 8µs | Test2::Event::Fail::BEGIN@9 |
| 1 | 1 | 1 | 6µs | 7µs | Test2::Event::Fail::BEGIN@7 |
| 1 | 1 | 1 | 4µs | 57µs | Test2::Event::Fail::BEGIN@15 |
| 1 | 1 | 1 | 4µs | 20µs | Test2::Event::Fail::BEGIN@3 |
| 1 | 1 | 1 | 400ns | 400ns | Test2::Event::Fail::__ANON__ (xsub) |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::add_info |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::causes_fail |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::diagnostics |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::facet_data |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::global |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::increments_count |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::no_display |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::sets_plan |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::subtest_id |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::summary |
| 0 | 0 | 0 | 0s | 0s | Test2::Event::Fail::terminate |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Test2::Event::Fail; | ||||
| 2 | 2 | 20µs | 2 | 14µs | # spent 12µs (11+2) within Test2::Event::Fail::BEGIN@2 which was called:
# once (11µs+2µs) by Test::Builder::BEGIN@18 at line 2 # spent 12µs making 1 call to Test2::Event::Fail::BEGIN@2
# spent 2µs making 1 call to strict::import |
| 3 | 2 | 22µs | 2 | 37µs | # spent 20µs (4+17) within Test2::Event::Fail::BEGIN@3 which was called:
# once (4µs+17µs) by Test::Builder::BEGIN@18 at line 3 # spent 20µs making 1 call to Test2::Event::Fail::BEGIN@3
# spent 17µs making 1 call to warnings::import |
| 4 | |||||
| 5 | 1 | 300ns | our $VERSION = '1.302198'; | ||
| 6 | |||||
| 7 | 2 | 41µs | 2 | 7µs | # spent 7µs (6+400ns) within Test2::Event::Fail::BEGIN@7 which was called:
# once (6µs+400ns) by Test::Builder::BEGIN@18 at line 7 # spent 7µs making 1 call to Test2::Event::Fail::BEGIN@7
# spent 400ns making 1 call to Test2::Event::Fail::__ANON__ |
| 8 | |||||
| 9 | # spent 8µs within Test2::Event::Fail::BEGIN@9 which was called:
# once (8µs+0s) by Test::Builder::BEGIN@18 at line 13 | ||||
| 10 | 1 | 400ns | require Test2::Event; | ||
| 11 | 1 | 6µs | our @ISA = qw(Test2::Event); | ||
| 12 | 1 | 3µs | *META_KEY = \&Test2::Util::ExternalMeta::META_KEY; | ||
| 13 | 1 | 15µs | 1 | 8µs | } # spent 8µs making 1 call to Test2::Event::Fail::BEGIN@9 |
| 14 | |||||
| 15 | 2 | 181µs | 2 | 111µs | # spent 57µs (4+53) within Test2::Event::Fail::BEGIN@15 which was called:
# once (4µs+53µs) by Test::Builder::BEGIN@18 at line 15 # spent 57µs making 1 call to Test2::Event::Fail::BEGIN@15
# spent 53µs making 1 call to Test2::Util::HashBase::import |
| 16 | |||||
| 17 | ############# | ||||
| 18 | # Old API | ||||
| 19 | sub summary { "fail" } | ||||
| 20 | sub increments_count { 1 } | ||||
| 21 | sub diagnostics { 0 } | ||||
| 22 | sub no_display { 0 } | ||||
| 23 | sub subtest_id { undef } | ||||
| 24 | sub terminate { () } | ||||
| 25 | sub global { () } | ||||
| 26 | sub sets_plan { () } | ||||
| 27 | |||||
| 28 | sub causes_fail { | ||||
| 29 | my $self = shift; | ||||
| 30 | return 0 if $self->{+AMNESTY} && @{$self->{+AMNESTY}}; | ||||
| 31 | return 1; | ||||
| 32 | } | ||||
| 33 | |||||
| 34 | ############# | ||||
| 35 | # New API | ||||
| 36 | |||||
| 37 | sub add_info { | ||||
| 38 | my $self = shift; | ||||
| 39 | |||||
| 40 | for my $in (@_) { | ||||
| 41 | $in = {%$in} if ref($in) ne 'ARRAY'; | ||||
| 42 | $in = Test2::EventFacet::Info->new($in); | ||||
| 43 | |||||
| 44 | push @{$self->{+INFO}} => $in; | ||||
| 45 | } | ||||
| 46 | } | ||||
| 47 | |||||
| 48 | sub facet_data { | ||||
| 49 | my $self = shift; | ||||
| 50 | my $out = $self->common_facet_data; | ||||
| 51 | |||||
| 52 | $out->{about}->{details} = 'fail'; | ||||
| 53 | |||||
| 54 | $out->{assert} = {pass => 0, details => $self->{+NAME}}; | ||||
| 55 | |||||
| 56 | $out->{info} = [map {{ %{$_} }} @{$self->{+INFO}}] if $self->{+INFO}; | ||||
| 57 | |||||
| 58 | return $out; | ||||
| 59 | } | ||||
| 60 | |||||
| 61 | 1 | 2µs | 1; | ||
| 62 | |||||
| 63 | __END__ | ||||
# spent 400ns within Test2::Event::Fail::__ANON__ which was called:
# once (400ns+0s) by Test2::Event::Fail::BEGIN@7 at line 7 |