| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# $Header: /home/fergal/my/cvs/Test-Tester/lib/Test/Tester/CaptureRunner.pm,v 1.3 2003/03/05 01:07:55 fergal Exp $ |
|
2
|
6
|
|
|
6
|
|
41
|
use strict; |
|
|
6
|
|
|
|
|
11
|
|
|
|
6
|
|
|
|
|
317
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Tester::CaptureRunner; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.302180'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
2150
|
use Test::Tester::Capture; |
|
|
6
|
|
|
|
|
22
|
|
|
|
6
|
|
|
|
|
1375
|
|
|
10
|
|
|
|
|
|
|
require Exporter; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new |
|
13
|
|
|
|
|
|
|
{ |
|
14
|
6
|
|
|
6
|
0
|
14
|
my $pkg = shift; |
|
15
|
6
|
|
|
|
|
19
|
my $self = bless {}, $pkg; |
|
16
|
6
|
|
|
|
|
18
|
return $self; |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub run_tests |
|
20
|
|
|
|
|
|
|
{ |
|
21
|
18
|
|
|
18
|
0
|
28
|
my $self = shift; |
|
22
|
|
|
|
|
|
|
|
|
23
|
18
|
|
|
|
|
31
|
my $test = shift; |
|
24
|
|
|
|
|
|
|
|
|
25
|
18
|
|
|
|
|
43
|
capture()->reset; |
|
26
|
|
|
|
|
|
|
|
|
27
|
18
|
|
|
|
|
111
|
$self->{StartLevel} = $Test::Builder::Level; |
|
28
|
18
|
|
|
|
|
161
|
&$test(); |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub get_results |
|
32
|
|
|
|
|
|
|
{ |
|
33
|
18
|
|
|
18
|
0
|
29
|
my $self = shift; |
|
34
|
18
|
|
|
|
|
33
|
my @results = capture()->details; |
|
35
|
|
|
|
|
|
|
|
|
36
|
18
|
|
|
|
|
48
|
my $start = $self->{StartLevel}; |
|
37
|
18
|
|
|
|
|
37
|
foreach my $res (@results) |
|
38
|
|
|
|
|
|
|
{ |
|
39
|
26
|
50
|
|
|
|
61
|
next if defined $res->{depth}; |
|
40
|
26
|
|
|
|
|
51
|
my $depth = $res->{_depth} - $res->{_level} - $start - 3; |
|
41
|
|
|
|
|
|
|
# print "my $depth = $res->{_depth} - $res->{_level} - $start - 1\n"; |
|
42
|
26
|
|
|
|
|
73
|
$res->{depth} = $depth; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
18
|
|
|
|
|
85
|
return @results; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub get_premature |
|
49
|
|
|
|
|
|
|
{ |
|
50
|
18
|
|
|
18
|
0
|
44
|
return capture()->premature; |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub capture |
|
54
|
|
|
|
|
|
|
{ |
|
55
|
54
|
|
|
54
|
0
|
136
|
return Test::Tester::Capture->new; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |