line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Lib; |
2
|
7
|
|
|
7
|
|
363250
|
use strict; |
|
7
|
|
|
|
|
55
|
|
|
7
|
|
|
|
|
332
|
|
3
|
7
|
|
|
7
|
|
32
|
use warnings; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
427
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.003'; |
6
|
|
|
|
|
|
|
$VERSION =~ tr/_/d/; |
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
62
|
use File::Spec; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
194
|
|
9
|
7
|
|
|
7
|
|
34
|
use Cwd (); |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
90
|
|
10
|
7
|
|
|
7
|
|
2811
|
use lib (); |
|
7
|
|
|
|
|
4290
|
|
|
7
|
|
|
|
|
1617
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub import { |
13
|
7
|
|
|
7
|
|
56
|
my $class = shift; |
14
|
7
|
|
|
|
|
9
|
my $dir = shift; |
15
|
7
|
50
|
|
|
|
25
|
if (! defined $dir) { |
16
|
7
|
|
|
|
|
337
|
my $file = File::Spec->rel2abs((caller)[1]); |
17
|
7
|
|
|
|
|
208
|
$dir = File::Spec->catpath((File::Spec->splitpath($file))[0,1], ''); |
18
|
|
|
|
|
|
|
} |
19
|
7
|
|
|
|
|
36
|
for my $i (0..5) { |
20
|
27
|
|
|
|
|
185
|
my $tdir = File::Spec->catdir($dir, (File::Spec->updir) x $i); |
21
|
27
|
|
|
|
|
1400
|
my $abs_path = Cwd::abs_path($tdir); |
22
|
27
|
|
|
|
|
229
|
my $dirname = (File::Spec->splitdir($abs_path))[-1]; |
23
|
|
|
|
|
|
|
|
24
|
27
|
100
|
|
|
|
96
|
if ($dirname eq 't') { |
25
|
6
|
|
|
|
|
34
|
my $tlib = File::Spec->catdir($tdir, 'lib'); |
26
|
6
|
50
|
|
|
|
84
|
if (-d $tlib) { |
27
|
6
|
|
|
|
|
37
|
lib->import($tlib); |
28
|
6
|
|
|
|
|
8346
|
return; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
1
|
|
|
|
|
34
|
require Carp; |
33
|
1
|
|
|
|
|
213
|
Carp::croak("unable to find t/lib directory in $dir"); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |