line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Lib; |
2
|
7
|
|
|
7
|
|
148465
|
use strict; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
272
|
|
3
|
7
|
|
|
7
|
|
42
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
383
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.002'; |
6
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
36
|
use File::Spec; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
147
|
|
9
|
7
|
|
|
7
|
|
85
|
use Cwd (); |
|
7
|
|
|
|
|
23
|
|
|
7
|
|
|
|
|
126
|
|
10
|
7
|
|
|
7
|
|
6931
|
use lib (); |
|
7
|
|
|
|
|
5215
|
|
|
7
|
|
|
|
|
2111
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub import { |
13
|
7
|
|
|
7
|
|
57
|
my $class = shift; |
14
|
7
|
|
|
|
|
11
|
my $dir = shift; |
15
|
7
|
50
|
|
|
|
41
|
if (! defined $dir) { |
16
|
7
|
|
|
|
|
379
|
my $file = File::Spec->rel2abs((caller)[1]); |
17
|
7
|
|
|
|
|
219
|
$dir = File::Spec->catpath((File::Spec->splitpath($file))[0,1], ''); |
18
|
|
|
|
|
|
|
} |
19
|
7
|
|
|
|
|
28
|
for my $i (0..5) { |
20
|
27
|
|
|
|
|
249
|
my $tdir = File::Spec->catdir($dir, (File::Spec->updir) x $i); |
21
|
27
|
|
|
|
|
3791
|
my $abs_path = Cwd::abs_path($tdir); |
22
|
27
|
|
|
|
|
289
|
my $dirname = (File::Spec->splitdir($abs_path))[-1]; |
23
|
|
|
|
|
|
|
|
24
|
27
|
100
|
|
|
|
108
|
if ($dirname eq 't') { |
25
|
6
|
|
|
|
|
50
|
my $tlib = File::Spec->catdir($tdir, 'lib'); |
26
|
6
|
50
|
|
|
|
174
|
if (-d $tlib) { |
27
|
6
|
|
|
|
|
35
|
lib->import($tlib); |
28
|
6
|
|
|
|
|
14094
|
return; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
1
|
|
|
|
|
17
|
die "unable to find t/lib directory in $dir"; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |