MY.pm untested

filter: Statementstmt 0.0% 0 / 38 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 55 CC 3 SCAR 12.8
CC
3
Cov
0%
test_via_harness
6.0
test_via_script
6.0
postamble
2.0
CRAP 3.6
1 use strict;
2 use warnings;
3  
4 package MY;
5  
6 use File::Basename qw( basename );
7 use File::Spec::Functions qw( catdir rel2abs );
8 use Module::Loaded qw( is_loaded );
9  
10 my $append_script_path = sub {
11 my ( $self, $inherited ) = @_;
12  
13 my $path = '';
14 $path = "\$($_):$path" foreach grep { -d basename $self->{ $_ } } map { "INST_$_" } qw( SCRIPT BIN );
15 if ( $path ne '' ) {
16 $inherited =~ s/\A[ \t]+//;
17 $inherited = "\tPATH=\"$path:\$\$PATH\" " . $inherited
18 }
19  
20 $inherited
21 };
22  
23 # https://metacpan.org/pod/ExtUtils::MM_Any#postamble-(o)
24 sub postamble {
25 my ( $self ) = @_;
26  
27 my $make_fragment = '';
28  
29 $make_fragment
30 }
31  
32 # https://metacpan.org/pod/ExtUtils::MM_Any#test_via_harness
33 sub test_via_harness {
34 my ( $self, $perl, $tests ) = @_;
35  
36 my $tdata = rel2abs( catdir( qw( t data ) ) );
37 $perl .= " -I$tdata" if -d $tdata;
38  
39 my $inherited = $self->SUPER::test_via_harness( $perl, $tests );
40  
41 $append_script_path->( $self, $inherited )
42 }
43  
44 # https://metacpan.org/pod/ExtUtils::MM_Any#test_via_script
45 # testdb_* PHONY targets
46 sub test_via_script {
47 my ( $self, $perl, $test ) = @_;
48  
49 my $tdata = rel2abs( catdir( qw( t data ) ) );
50 $perl .= " -I$tdata" if -d $tdata;
51  
52 my $inherited = $self->SUPER::test_via_script( $perl, $test );
53  
54 $append_script_path->( $self, $inherited )
55 }
56  
57 1