| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Test::Stream::DebugInfo; | 
| 2 | 109 |  |  | 109 |  | 1109 | use strict; | 
|  | 109 |  |  |  |  | 193 |  | 
|  | 109 |  |  |  |  | 2846 |  | 
| 3 | 109 |  |  | 109 |  | 541 | use warnings; | 
|  | 109 |  |  |  |  | 166 |  | 
|  | 109 |  |  |  |  | 3272 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 109 |  |  | 109 |  | 539 | use Test::Stream::Util qw/get_tid/; | 
|  | 109 |  |  |  |  | 174 |  | 
|  | 109 |  |  |  |  | 649 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 109 |  |  | 109 |  | 543 | use Carp qw/confess/; | 
|  | 109 |  |  |  |  | 194 |  | 
|  | 109 |  |  |  |  | 6904 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | use Test::Stream::HashBase( | 
| 10 | 109 |  |  |  |  | 858 | accessors => [qw/frame todo skip detail pid tid parent_todo/], | 
| 11 | 109 |  |  | 109 |  | 58990 | ); | 
|  | 109 |  |  |  |  | 254 |  | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | sub init { | 
| 14 |  |  |  |  |  |  | confess "Frame is required" | 
| 15 | 1030 | 100 |  | 1030 | 0 | 3240 | unless $_[0]->{+FRAME}; | 
| 16 |  |  |  |  |  |  |  | 
| 17 | 1029 |  | 33 |  |  | 5365 | $_[0]->{+PID} ||= $$; | 
| 18 | 1029 |  | 50 |  |  | 5875 | $_[0]->{+TID} ||= get_tid(); | 
| 19 |  |  |  |  |  |  | } | 
| 20 |  |  |  |  |  |  |  | 
| 21 | 309 |  |  | 309 | 0 | 479 | sub snapshot { bless {%{$_[0]}}, __PACKAGE__ }; | 
|  | 309 |  |  |  |  | 4322 |  | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | sub trace { | 
| 24 | 329 |  |  | 329 | 1 | 857 | my $self = shift; | 
| 25 | 329 | 100 |  |  |  | 1181 | return $self->{+DETAIL} if $self->{+DETAIL}; | 
| 26 | 192 |  |  |  |  | 501 | my ($pkg, $file, $line) = $self->call; | 
| 27 | 192 |  |  |  |  | 958 | return "at $file line $line"; | 
| 28 |  |  |  |  |  |  | } | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | sub alert { | 
| 31 | 5 |  |  | 5 | 1 | 24 | my $self = shift; | 
| 32 | 5 |  |  |  |  | 10 | my ($msg) = @_; | 
| 33 | 5 |  |  |  |  | 21 | warn $msg . ' ' . $self->trace . ".\n"; | 
| 34 |  |  |  |  |  |  | } | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  | sub throw { | 
| 37 | 7 |  |  | 7 | 1 | 34 | my $self = shift; | 
| 38 | 7 |  |  |  |  | 16 | my ($msg) = @_; | 
| 39 | 7 |  |  |  |  | 25 | die $msg . ' ' . $self->trace . ".\n"; | 
| 40 |  |  |  |  |  |  | } | 
| 41 |  |  |  |  |  |  |  | 
| 42 | 193 |  |  | 193 | 1 | 246 | sub call { @{$_[0]->{+FRAME}} } | 
|  | 193 |  |  |  |  | 644 |  | 
| 43 |  |  |  |  |  |  |  | 
| 44 | 12 |  |  | 12 | 1 | 68 | sub package { $_[0]->{+FRAME}->[0] } | 
| 45 | 237 |  |  | 237 | 1 | 1544 | sub file    { $_[0]->{+FRAME}->[1] } | 
| 46 | 209 |  |  | 209 | 1 | 1094 | sub line    { $_[0]->{+FRAME}->[2] } | 
| 47 | 6 |  |  | 6 | 1 | 37 | sub subname { $_[0]->{+FRAME}->[3] } | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | sub no_diag { | 
| 50 | 257 |  |  | 257 | 0 | 1067 | my $self = shift; | 
| 51 |  |  |  |  |  |  | return defined($self->{+TODO}) | 
| 52 |  |  |  |  |  |  | || defined($self->{+SKIP}) | 
| 53 | 257 |  | 100 |  |  | 2387 | || defined($self->{+PARENT_TODO}); | 
| 54 |  |  |  |  |  |  | } | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | sub no_fail { | 
| 57 | 212 |  |  | 212 | 0 | 321 | my $self = shift; | 
| 58 |  |  |  |  |  |  | return defined($self->{+TODO}) | 
| 59 | 212 |  | 100 |  |  | 2141 | || defined($self->{+SKIP}); | 
| 60 |  |  |  |  |  |  | } | 
| 61 |  |  |  |  |  |  |  | 
| 62 |  |  |  |  |  |  | 1; | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | __END__ |