| 1 | 1 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2 | package Module::Depends::Intrusive; | ||||||||||||||
| 3 | 1 | ▶ | use base qw( Module::Depends ); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 1 | ▶ | use Cwd qw( getcwd ); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 1 | ▶ | use ExtUtils::MakeMaker (); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | |||||||||||||||
| 7 | 10 | ▶ | sub _find_modules { | ||||||||||||
|
Subroutine
_find_modules: called CC=5 SCAR=16.2
| |||||||||||||||
| 8 | 10 | my $self = shift; | |||||||||||||
| 9 | |||||||||||||||
| 10 | # this order is important, as when a Makefile.PL and Build.PL are | ||||||||||||||
| 11 | # present, the Makefile.PL could just be a passthrough | ||||||||||||||
| 12 | 10 | ▶ | my $pl = -e 'Build.PL' ? 'Build.PL' : -e 'Makefile.PL' ? 'Makefile.PL' : 0; | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 13 | 10 | ▶ | unless ($pl) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 14 | 1 | $self->error( 'No {Build,Makefile}.PL found in '.$self->dist_dir ); | |||||||||||||
| 15 | 1 | return $self; | |||||||||||||
| 16 | } | ||||||||||||||
| 17 | |||||||||||||||
| 18 | # fake up Module::Build and ExtUtils::MakeMaker | ||||||||||||||
| 19 | 1 | ▶ | no warnings 'redefine'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 20 | 9 | local *STDIN; # run non-interactive | |||||||||||||
| 21 | 0 | ▶ | local *ExtUtils::Liblist::ext = sub { | ||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||
| 22 | 0 | my ($class, $lib) = @_; | |||||||||||||
| 23 | 0 | $lib =~ s/\-l//; | |||||||||||||
| 24 | 0 | push @{ $self->libs }, $lib; | |||||||||||||
| 25 | 0 | return 1; | |||||||||||||
| 26 | 9 | }; | |||||||||||||
| 27 | 9 | ▶ | local *CORE::GLOBAL::exit = sub { }; | ||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=0.0
| |||||||||||||||
| 28 | 9 | local $INC{"Module/Build.pm"} = 1; | |||||||||||||
| 29 | 9 | local @MyModuleBuilder::ISA = qw( Module::Build ); | |||||||||||||
| 30 | 2 | ▶ | local *Module::Build::new = sub { | ||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||
| 31 | 2 | my $class = shift; | |||||||||||||
| 32 | 2 | my %args = @_; | |||||||||||||
| 33 | 2 | ▶ | $self->requires( $args{requires} || {} ); | ||||||||||||
|
Condition50%1/2
$args{'requires'} || {}
MC/DC0%0/1
$args{'requires'} || {}
$args{'requires'}
Truth table50%1/2
A
A= $args{'requires'}
| |||||||||||||||
| 34 | 2 | ▶ | $self->build_requires( $args{build_requires} || {} ); | ||||||||||||
|
Condition100%2/2
$args{'build_requires'} || {}
MC/DC100%1/1
$args{'build_requires'} || {}
$args{'build_requires'}
Truth table100%2/2
A
A= $args{'build_requires'}
| |||||||||||||||
| 35 | 2 | bless {}, "Module::Depends::Intrusive::Fake::Module::Build"; | |||||||||||||
| 36 | 9 | }; | |||||||||||||
| 37 | 0 | ▶ | local *Module::Build::subclass = sub { 'Module::Build' }; | ||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||
| 38 | 9 | local $Module::Build::VERSION = 666; | |||||||||||||
| 39 | |||||||||||||||
| 40 | 4 | ▶ | my $WriteMakefile = sub { | ||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.1
| |||||||||||||||
| 41 | 4 | my %args = @_; | |||||||||||||
| 42 | 4 | ▶ | $self->requires( $args{PREREQ_PM} || {} ); | ||||||||||||
|
Condition50%1/2
$args{'PREREQ_PM'} || {}
MC/DC0%0/1
$args{'PREREQ_PM'} || {}
$args{'PREREQ_PM'}
Truth table50%1/2
A
A= $args{'PREREQ_PM'}
| |||||||||||||||
| 43 | 4 | 1; | |||||||||||||
| 44 | 9 | }; | |||||||||||||
| 45 | 9 | local *main::WriteMakefile; | |||||||||||||
| 46 | 9 | local *ExtUtils::MakeMaker::WriteMakefile = $WriteMakefile; | |||||||||||||
| 47 | |||||||||||||||
| 48 | # Inline::MakeMaker | ||||||||||||||
| 49 | 9 | local $INC{"Inline/MakeMaker.pm"} = 1; | |||||||||||||
| 50 | |||||||||||||||
| 51 | 9 | local @Inline::MakeMaker::EXPORT = qw( WriteMakefile WriteInlineMakefile ); | |||||||||||||
| 52 | 9 | local @Inline::MakeMaker::ISA = qw( Exporter ); | |||||||||||||
| 53 | 9 | local *Inline::MakeMaker::WriteMakefile = $WriteMakefile; | |||||||||||||
| 54 | 9 | local *Inline::MakeMaker::WriteInlineMakefile = $WriteMakefile; | |||||||||||||
| 55 | |||||||||||||||
| 56 | # Module::Install | ||||||||||||||
| 57 | 9 | local $INC{"inc/Module/Install.pm"} = 1; | |||||||||||||
| 58 | 9 | local $inc::Module::Install::VERSION = 666; | |||||||||||||
| 59 | 9 | local @inc::Module::Install::ISA = qw( Exporter ); | |||||||||||||
| 60 | 9 | local @inc::Module::Install::EXPORT = qw( | |||||||||||||
| 61 | configure_requires repository bugtracker | ||||||||||||||
| 62 | all_from auto_install AUTOLOAD build_requires check_nmake include | ||||||||||||||
| 63 | include_deps installdirs Makefile makemaker_args Meta name no_index | ||||||||||||||
| 64 | requires WriteAll clean_files can_cc sign cc_inc_paths cc_files | ||||||||||||||
| 65 | cc_optimize_flags author license | ||||||||||||||
| 66 | |||||||||||||||
| 67 | ); | ||||||||||||||
| 68 | 9 | ▶ | local *inc::Module::Install::AUTOLOAD = sub { 1 }; | ||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||
| 69 | 3 | ▶ | local *inc::Module::Install::requires = sub { | ||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.4
| |||||||||||||||
| 70 | 3 | ▶ | my %deps = (@_ == 1 ? ( $_[0] => 0 ) : @_); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 71 | 3 | $self->requires->{ $_ } = $deps{ $_ } for keys %deps; | |||||||||||||
| 72 | 9 | }; | |||||||||||||
| 73 | 9 | local *inc::Module::Install::include_deps = *inc::Module::Install::requires; | |||||||||||||
| 74 | 4 | ▶ | local *inc::Module::Install::build_requires = sub { | ||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||
| 75 | 4 | ▶ | my %deps = (@_ == 1 ? ( $_[0] => 0 ) : @_); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 76 | 4 | $self->build_requires->{ $_ } = $deps{ $_ } for keys %deps; | |||||||||||||
| 77 | 9 | }; | |||||||||||||
| 78 | 2 | ▶ | local *inc::Module::Install::configure_requires = sub { | ||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.4
| |||||||||||||||
| 79 | 2 | ▶ | my %deps = (@_ == 1 ? ( $_[0] => 0 ) : @_); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 80 | 2 | $self->configure_requires->{ $_ } = $deps{ $_ } for keys %deps; | |||||||||||||
| 81 | 9 | }; | |||||||||||||
| 82 | |||||||||||||||
| 83 | 9 | my $file = File::Spec->catfile( getcwd(), $pl ); | |||||||||||||
| 84 | 9 | eval { | |||||||||||||
| 85 | package main; | ||||||||||||||
| 86 | 1 | ▶ | no strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 87 | 1 | ▶ | no warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 88 | 9 | local $0 = $file; | |||||||||||||
| 89 | 9 | do "$file"; | |||||||||||||
| 90 | }; | ||||||||||||||
| 91 | 9 | ▶ | $self->error( $@ ) if $@; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 92 | 9 | delete $INC{$file}; | |||||||||||||
| 93 | 9 | return $self; | |||||||||||||
| 94 | } | ||||||||||||||
| 95 | |||||||||||||||
| 96 | package Module::Depends::Intrusive::Fake::Module::Build; | ||||||||||||||
| 97 | 0 | ▶ | sub DESTROY {} | ||||||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=0.0
| |||||||||||||||
| 98 | 2 | ▶ | sub AUTOLOAD { shift } | ||||||||||||
|
Subroutine
AUTOLOAD: called CC=1 SCAR=0.0
| |||||||||||||||
| 99 | 0 | ▶ | sub y_n { | ||||||||||||
|
Subroutine
y_n: not called CC=3 SCAR=24.8
| |||||||||||||||
| 100 | 0 | my ($self, $question, $default) = @_; | |||||||||||||
| 101 | 0 | ▶ | $default ||= 'n'; | ||||||||||||
|
Condition0%0/2
$default ||= "n"
MC/DC0%0/1
$default ||= "n"
$default
Truth table0%0/2
A
A= $default
| |||||||||||||||
| 102 | 0 | ▶ | return 1 if lc $default eq 'y'; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 103 | 0 | return 0; # ok, we may say no when yes was intended, but we can't hang | |||||||||||||
| 104 | } | ||||||||||||||
| 105 | |||||||||||||||
| 106 | 1 | 1; | |||||||||||||
| 107 | |||||||||||||||
| 108 | __END__ | ||||||||||||||