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
|
|
45
|
use strict; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
369
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Tester::CaptureRunner; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.302181'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
2452
|
use Test::Tester::Capture; |
|
6
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
1433
|
|
10
|
|
|
|
|
|
|
require Exporter; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new |
13
|
|
|
|
|
|
|
{ |
14
|
6
|
|
|
6
|
0
|
15
|
my $pkg = shift; |
15
|
6
|
|
|
|
|
16
|
my $self = bless {}, $pkg; |
16
|
6
|
|
|
|
|
15
|
return $self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub run_tests |
20
|
|
|
|
|
|
|
{ |
21
|
18
|
|
|
18
|
0
|
35
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
18
|
|
|
|
|
27
|
my $test = shift; |
24
|
|
|
|
|
|
|
|
25
|
18
|
|
|
|
|
53
|
capture()->reset; |
26
|
|
|
|
|
|
|
|
27
|
18
|
|
|
|
|
116
|
$self->{StartLevel} = $Test::Builder::Level; |
28
|
18
|
|
|
|
|
175
|
&$test(); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub get_results |
32
|
|
|
|
|
|
|
{ |
33
|
18
|
|
|
18
|
0
|
56
|
my $self = shift; |
34
|
18
|
|
|
|
|
34
|
my @results = capture()->details; |
35
|
|
|
|
|
|
|
|
36
|
18
|
|
|
|
|
48
|
my $start = $self->{StartLevel}; |
37
|
18
|
|
|
|
|
62
|
foreach my $res (@results) |
38
|
|
|
|
|
|
|
{ |
39
|
26
|
50
|
|
|
|
60
|
next if defined $res->{depth}; |
40
|
26
|
|
|
|
|
48
|
my $depth = $res->{_depth} - $res->{_level} - $start - 3; |
41
|
|
|
|
|
|
|
# print "my $depth = $res->{_depth} - $res->{_level} - $start - 1\n"; |
42
|
26
|
|
|
|
|
53
|
$res->{depth} = $depth; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
18
|
|
|
|
|
92
|
return @results; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub get_premature |
49
|
|
|
|
|
|
|
{ |
50
|
18
|
|
|
18
|
0
|
43
|
return capture()->premature; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub capture |
54
|
|
|
|
|
|
|
{ |
55
|
54
|
|
|
54
|
0
|
148
|
return Test::Tester::Capture->new; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 NAME |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Test::Tester::CaptureRunner - Help testing test modules built with Test::Builder |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 DESCRIPTION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This stuff if needed to allow me to play with other ways of monitoring the |
67
|
|
|
|
|
|
|
test results. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 AUTHOR |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Copyright 2003 by Fergal Daly <fergal@esatclear.ie>. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 LICENSE |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Under the same license as Perl itself |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
See http://www.perl.com/perl/misc/Artistic.html |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |