| 1 | 7 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 2 | package Inline::Foo; | ||||||||||||
| 3 | |||||||||||||
| 4 | 8 | require Inline; | |||||||||||
| 5 | 8 | our @ISA = qw(Inline); | |||||||||||
| 6 | 9 | our $VERSION = '0.85'; | |||||||||||
| 7 | |||||||||||||
| 8 | 7 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 7 | ▶ | use File::Spec; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | sub register { | ||||||||||||
| 12 | return { | ||||||||||||
| 13 | 0 | ▶ | language => 'Foo', | ||||||||||
|
Subroutine
register: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 14 | aliases => ['foo'], | ||||||||||||
| 15 | type => 'interpreted', | ||||||||||||
| 16 | suffix => 'foo', | ||||||||||||
| 17 | }; | ||||||||||||
| 18 | } | ||||||||||||
| 19 | |||||||||||||
| 20 | sub usage_config { | ||||||||||||
| 21 | 1 | ▶ | my $key = shift; | ||||||||||
|
Subroutine
usage_config: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 22 | 1 | "'$key' is not a valid config option for Inline::Foo\n"; | |||||||||||
| 23 | } | ||||||||||||
| 24 | |||||||||||||
| 25 | sub usage_config_bar { | ||||||||||||
| 26 | 0 | ▶ | "Invalid value for Inline::Foo config option BAR"; | ||||||||||
|
Subroutine
usage_config_bar: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | sub validate { | ||||||||||||
| 30 | 14 | ▶ | my $o = shift; | ||||||||||
|
Subroutine
validate: called CC=7 SCAR=19.6
Pod
undocumented
| |||||||||||||
| 31 | 14 | ▶ | $o->{ILSM}{PATTERN} ||= 'foo-'; | ||||||||||
|
Condition50%1/2
$o->{"ILSM"}{"PATTERN"} ||= "foo-"
MC/DC0%0/1
$o->{"ILSM"}{"PATTERN"} ||= "foo-"
$o->{"ILSM"}{"PATTERN"}
Truth table50%1/2
A
A= $o->{"ILSM"}{"PATTERN"}
| |||||||||||||
| 32 | 14 | ▶ | $o->{ILSM}{BAR} ||= 0; | ||||||||||
|
Condition50%1/2
$o->{"ILSM"}{"BAR"} ||= 0
MC/DC0%0/1
$o->{"ILSM"}{"BAR"} ||= 0
$o->{"ILSM"}{"BAR"}
Truth table50%1/2
A
A= $o->{"ILSM"}{"BAR"}
| |||||||||||||
| 33 | 14 | ▶ | while (@_) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 34 | 7 | my ($key, $value) = splice @_, 0, 2; | |||||||||||
| 35 | 7 | ▶ | if ($key eq 'PATTERN') { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 36 | 3 | $o->{ILSM}{PATTERN} = $value; | |||||||||||
| 37 | 3 | next; | |||||||||||
| 38 | } | ||||||||||||
| 39 | 4 | ▶ | if ($key eq 'BAR') { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 40 | 3 | ▶ | croak usage_config_bar | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 41 | unless $value =~ /^[01]$/; | ||||||||||||
| 42 | 3 | $o->{ILSM}{BAR} = $value; | |||||||||||
| 43 | 3 | next; | |||||||||||
| 44 | } | ||||||||||||
| 45 | 1 | croak usage_config($key); | |||||||||||
| 46 | } | ||||||||||||
| 47 | } | ||||||||||||
| 48 | |||||||||||||
| 49 | sub build { | ||||||||||||
| 50 | 13 | ▶ | my $o = shift; | ||||||||||
|
Subroutine
build: called CC=5 SCAR=16.3
Pod
undocumented
| |||||||||||||
| 51 | 13 | my $code = $o->{API}{code}; | |||||||||||
| 52 | 13 | my $pattern = $o->{ILSM}{PATTERN}; | |||||||||||
| 53 | 13 | $code =~ s/$pattern//g; | |||||||||||
| 54 | 13 | ▶ | $code =~ s/bar-//g if $o->{ILSM}{BAR}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 55 | { | ||||||||||||
| 56 | 13 | package Foo::Tester; | |||||||||||
| 57 | 13 | our $VERSION = '0.02'; | |||||||||||
| 58 | 13 | ▶ | eval $code; | ||||||||||
|
Subroutine
add: called CC=1 SCAR=0.1
Subroutine
subtract: called CC=1 SCAR=0.1
Subroutine
subtract2: called CC=1 SCAR=0.1
Subroutine
test1: called CC=1 SCAR=0.1
Subroutine
test2: called CC=1 SCAR=0.1
Subroutine
test3: called CC=1 SCAR=0.1
Subroutine
test4: called CC=1 SCAR=0.1
Subroutine
test5: not called CC=1 SCAR=0.1
| |||||||||||||
| 59 | } | ||||||||||||
| 60 | 13 | ▶ | croak "Foo build failed:\n$@" if $@; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 61 | 13 | my $path = File::Spec->catdir($o->{API}{install_lib},'auto',$o->{API}{modpname}); | |||||||||||
| 62 | 13 | my $obj = $o->{API}{location}; | |||||||||||
| 63 | 13 | ▶ | $o->mkpath($path) unless -d $path; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 64 | 13 | ▶ | open FOO_OBJ, "> $obj" | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 65 | or croak "Can't open $obj for output\n$!"; | ||||||||||||
| 66 | 13 | binmode(FOO_OBJ, ':utf8'); | |||||||||||
| 67 | 13 | print FOO_OBJ $code; | |||||||||||
| 68 | 13 | close \*FOO_OBJ; | |||||||||||
| 69 | } | ||||||||||||
| 70 | |||||||||||||
| 71 | sub load { | ||||||||||||
| 72 | 13 | ▶ | my $o = shift; | ||||||||||
|
Subroutine
load: called CC=3 SCAR=11.1
Pod
undocumented
| |||||||||||||
| 73 | 13 | my $obj = $o->{API}{location}; | |||||||||||
| 74 | 13 | ▶ | open FOO_OBJ, "< $obj" | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 75 | or croak "Can't open $obj for output\n$!"; | ||||||||||||
| 76 | 13 | binmode(FOO_OBJ, ':utf8'); | |||||||||||
| 77 | 13 | my $code = join '', <FOO_OBJ>; | |||||||||||
| 78 | 13 | close \*FOO_OBJ; | |||||||||||
| 79 | 13 | eval "package $o->{API}{pkg};\n$code"; | |||||||||||
| 80 | 13 | ▶ | croak "Unable to load Foo module $obj:\n$@" if $@; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 81 | } | ||||||||||||
| 82 | |||||||||||||
| 83 | sub info { | ||||||||||||
| 84 | 3 | ▶ | my $o = shift; | ||||||||||
|
Subroutine
info: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 85 | } | ||||||||||||
| 86 | |||||||||||||
| 87 | 10 | 1; | |||||||||||