builder/MyBuilder.pm

filter: Statementstmt 95.0% 38 / 40 Branchbran 50.0% 4 / 8 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 2 totaltotal 75.0% 51 / 68 CC 7 SCAR 11.6
CC
7
Cov
81%
_build_discount
5.7
ACTION_code
3.0
new
2.0
CRAP 3.2
« blib/lib/Text/Markdown/Discount.pm ↑ Summary lib/Text/Markdown/Discount.xs »
1 package builder::MyBuilder;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use base "Module::Build";
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Cwd qw(getcwd);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 my $DISCOUNT_VERSION = "3.0.2.0";
10 1 my $DISCOUNT_DIR = "discount-$DISCOUNT_VERSION";
11  
12 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
13 0 my ($class, %argv) = @_;
14  
15 0 $class->SUPER::new(
16 %argv,
17 needs_compiler => 1,
18 include_dirs => [$DISCOUNT_DIR],
19 );
20 }
21  
22 1 ▶sub _build_discount {
Subroutine _build_discount: called CC=5 SCAR=17.4
23 1 my $self = shift;
24  
25 1 my $cwd = getcwd();
26 1 ▶ chdir $DISCOUNT_DIR or die "chdir $DISCOUNT_DIR: $!";
Branch: 1 branch
BranchTrueFalseTotal
chdir $DISCOUNT_DIR or die "chdir ${DISCOUNT_DIR}: $!" 1 0 1
27 1 my $ok = do {
28 1 local $ENV{CC} = $self->config("cc") . " -fPIC";
29 1 $self->do_system("sh", "configure.sh");
30 };
31 1 ▶ $ok &&= $self->do_system($self->config("make"), "clean");
Condition33%1/3
$ok &&= $self->do_system($self->config("make"), "clean")
!ll&&!rl&&r
001
MC/DC0%0/2
$ok &&= $self->do_system($self->config("make"), "clean")
$ok $self->do_system($self->config("make"), "clean")
Truth table33%1/3
A &&= B
A= $okB= $self->do_system($self->config("make"), "clean")
ABresult
0X0
100
111
32 1 ▶ $ok &&= $self->do_system($self->config("make"), "libmarkdown");
Condition33%1/3
$ok &&= $self->do_system($self->config("make"), "libmarkdown")
!ll&&!rl&&r
001
MC/DC0%0/2
$ok &&= $self->do_system($self->config("make"), "libmarkdown")
$ok $self->do_system($self->config("make"), "libmarkdown")
Truth table33%1/3
A &&= B
A= $okB= $self->do_system($self->config("make"), "libmarkdown")
ABresult
0X0
100
111
33 1 ▶ chdir $cwd or die "chdir $cwd: $!";
Branch: 1 branch
BranchTrueFalseTotal
chdir $cwd or die "chdir ${cwd}: $!" 1 0 1
34 1 $ok;
35 }
36  
37 1 ▶sub ACTION_code {
Subroutine ACTION_code: called CC=3 SCAR=11.1
Pod undocumented
38 1 my ($self, @argv) = @_;
39  
40 1 my $spec = $self->_infer_xs_spec(File::Spec->catfile("lib", "Text", "Markdown", "Discount.xs"));
41 1 my $archive = File::Spec->catfile($DISCOUNT_DIR, "libmarkdown.a");
42 my @sources = (
43 __FILE__,
44 $spec->{lib_file},
45 1 grep { -f } glob(File::Spec->catfile($DISCOUNT_DIR, "*")),
46 );
47 1 ▶ if (!$self->up_to_date(\@sources, $archive)) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->up_to_date(\@sources, $archive)) 1 0 1
48 1 ▶ $self->_build_discount or die;
Branch: 1 branch
BranchTrueFalseTotal
$self->_build_discount or die 1 0 1
49 }
50 1 push @{$self->{properties}{objects}}, $archive;
51 1 $self->SUPER::ACTION_code(@argv);
52 }
53  
54 1 1;
« blib/lib/Text/Markdown/Discount.pm ↑ Summary lib/Text/Markdown/Discount.xs »