line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#line 1 |
2
|
|
|
|
|
|
|
package Test::Builder::Module; |
3
|
21
|
|
|
21
|
|
34697
|
|
|
21
|
|
|
|
|
38
|
|
|
21
|
|
|
|
|
663
|
|
4
|
|
|
|
|
|
|
use strict; |
5
|
21
|
|
|
21
|
|
14905
|
|
|
21
|
|
|
|
|
73
|
|
|
21
|
|
|
|
|
7420
|
|
6
|
|
|
|
|
|
|
use Test::Builder; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.98'; |
12
|
|
|
|
|
|
|
$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#line 74 |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import { |
18
|
|
|
|
|
|
|
my($class) = shift; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# Don't run all this when loading ourself. |
21
|
|
|
|
|
|
|
return 1 if $class eq 'Test::Builder::Module'; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $test = $class->builder; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $caller = caller; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$test->exported_to($caller); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$class->import_extra( \@_ ); |
30
|
|
|
|
|
|
|
my(@imports) = $class->_strip_imports( \@_ ); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$test->plan(@_); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
$class->export_to_level( 1, $class, @imports ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _strip_imports { |
38
|
|
|
|
|
|
|
my $class = shift; |
39
|
|
|
|
|
|
|
my $list = shift; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my @imports = (); |
42
|
|
|
|
|
|
|
my @other = (); |
43
|
|
|
|
|
|
|
my $idx = 0; |
44
|
|
|
|
|
|
|
while( $idx <= $#{$list} ) { |
45
|
|
|
|
|
|
|
my $item = $list->[$idx]; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
if( defined $item and $item eq 'import' ) { |
48
|
|
|
|
|
|
|
push @imports, @{ $list->[ $idx + 1 ] }; |
49
|
|
|
|
|
|
|
$idx++; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else { |
52
|
|
|
|
|
|
|
push @other, $item; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$idx++; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
@$list = @other; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
return @imports; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#line 137 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub import_extra { } |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
#line 167 |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub builder { |
70
|
|
|
|
|
|
|
return Test::Builder->new; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |