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
|
5
|
|
|
5
|
|
25
|
use strict; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
204
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Tester::CaptureRunner; |
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
2337
|
use Test::Tester::Capture; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
1197
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
5
|
|
|
5
|
0
|
11
|
my $pkg = shift; |
12
|
5
|
|
|
|
|
13
|
my $self = bless {}, $pkg; |
13
|
5
|
|
|
|
|
13
|
return $self; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub run_tests |
17
|
|
|
|
|
|
|
{ |
18
|
16
|
|
|
16
|
0
|
22
|
my $self = shift; |
19
|
|
|
|
|
|
|
|
20
|
16
|
|
|
|
|
17
|
my $test = shift; |
21
|
|
|
|
|
|
|
|
22
|
16
|
|
|
|
|
38
|
capture()->reset; |
23
|
|
|
|
|
|
|
|
24
|
16
|
|
|
|
|
82
|
$self->{StartLevel} = $Test::Builder::Level; |
25
|
16
|
|
|
|
|
250
|
&$test(); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub get_results |
29
|
|
|
|
|
|
|
{ |
30
|
16
|
|
|
16
|
0
|
24
|
my $self = shift; |
31
|
16
|
|
|
|
|
29
|
my @results = capture()->details; |
32
|
|
|
|
|
|
|
|
33
|
16
|
|
|
|
|
40
|
my $start = $self->{StartLevel}; |
34
|
16
|
|
|
|
|
133
|
foreach my $res (@results) |
35
|
|
|
|
|
|
|
{ |
36
|
22
|
50
|
|
|
|
56
|
next if defined $res->{depth}; |
37
|
22
|
|
|
|
|
76
|
my $depth = $res->{_depth} - $res->{_level} - $start - 3; |
38
|
|
|
|
|
|
|
# print "my $depth = $res->{_depth} - $res->{_level} - $start - 1\n"; |
39
|
22
|
|
|
|
|
54
|
$res->{depth} = $depth; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
16
|
|
|
|
|
68
|
return @results; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub get_premature |
46
|
|
|
|
|
|
|
{ |
47
|
16
|
|
|
16
|
0
|
31
|
return capture()->premature; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub capture |
51
|
|
|
|
|
|
|
{ |
52
|
48
|
|
|
48
|
0
|
139
|
return Test::Tester::Capture->new; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |