_build/lib/MyModuleBuilder.pm

filter: Statementstmt 22.7% 18 / 79 Branchbran 6.2% 1 / 16 Conditioncond 0.0% 0 / 20 MC/DCmcdc 0.0% 0 / 12 Subroutinesub 41.6% 5 / 12 Podpod 0.0% 0 / 8 totaltotal 16.3% 24 / 147 CC 19 SCAR 28.0
CC
19
Cov
17%
process_elc_files
42.0
ACTION_muse
20.0
ACTION_fakeinstall
12.0
CRAP 16.5
↑ Summary Build »
1 package MyModuleBuilder;
2 1 ▶use Module::Build;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 our @ISA = qw(Module::Build);
4 1 ▶use File::stat;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use ExtUtils::Install;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub process_elc_files {
9 0 ▶ my $self = shift;
Subroutine process_elc_files: not called CC=6 SCAR=37.4
Pod undocumented
10 0 ▶ if ( exists $self->{args}{noelc} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{"args"}{"noelc"}) 0 0 0
11 0 return;
12 }
13 # Files to ignore byte-compile
14 0 my @ignore = qw(pde-load.el pde-loaddefs.el pde-patch.el);
15 0 my @el = glob("lisp/*.el");
16 0 foreach my $el ( @el ) {
17 0 ▶ next if grep { basename($el) eq $_ } @ignore;
Branch: 1 branch
BranchTrueFalseTotal
if grep {basename($el) eq $_;} @ignore 0 0 0
18 0 my $elc = $el."c";
19 0 ▶ unless ( -e $elc && stat($elc)->mtime > stat($el)->mtime ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-e $elc and &MyModuleBuilder::stat($elc)->mtime > &MyModuleBuilder::stat($el)->mtime) 0 0 0
Condition0%0/3
-e $elc and &MyModuleBuilder::stat($elc)->mtime > &MyModuleBuilder::stat($el)->mtime
!ll&&!rl&&r
000
MC/DC0%0/2
-e $elc and &MyModuleBuilder::stat($elc)->mtime > &MyModuleBuilder::stat($el)->mtime
-e $elc &MyModuleBuilder::stat($elc)->mtime > &MyModuleBuilder::stat($el)->mtime
Truth table0%0/3
A and B
A= -e $elcB= &MyModuleBuilder::stat($elc)->mtime > &MyModuleBuilder::stat($el)->mtime
ABresult
0X0
100
111
20 0 my $cmd = qq/emacs -q -batch --no-site-file --eval="(setq load-path (append load-path '(\\".\\" \\"contrib\\")))" -f batch-byte-compile $el/;
21 0 print $cmd, "\n";
22 0 system($cmd);
23 }
24 }
25 0 unlink("lisp/tools/perldoc-cache.el");
26 }
27  
28 sub ACTION_test {
29 1 ▶ my ($emacs_version) = `emacs --version`;
Subroutine ACTION_test: called CC=3 SCAR=15.0
Pod undocumented
30 1 ▶ if ( $emacs_version =~ /GNU Emacs/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($emacs_version =~ /GNU Emacs/) { } 0 1 1
31 0 ▶ if ( $emacs_version =~ /2[23]/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($emacs_version =~ /2[23]/) { } 0 0 0
32 0 print "Seem everything is Ok\n";
33 } else {
34 0 print "Your emacs version is too low, PDE may not work. Consider upgrade it.\n"
35 }
36 }
37 else {
38 1 print "No emacs found in your system.\n";
39 }
40 1 return 1;
41 }
42  
43 sub ACTION_fakeinstall {
44 0 ▶ my $self = shift;
Subroutine ACTION_fakeinstall: not called CC=3 SCAR=24.8
Pod undocumented
45 0 $self->SUPER::ACTION_install(@_);
46 0 my $home = $ENV{HOME};
47 0 ▶ my $elispdir = $self->{args}{elispdir} || "$home/.emacs.d/pde";
Condition0%0/2
$self->{'args'}{'elispdir'} || "$home/.emacs.d/pde"
l!l
00
MC/DC0%0/1
$self->{'args'}{'elispdir'} || "$home/.emacs.d/pde"
$self->{'args'}{'elispdir'}
Truth table0%0/2
A
A= $self->{'args'}{'elispdir'}
Aresult
11
00
48 ExtUtils::Install::install( {lisp => $elispdir}, !$self->quiet, 1,
49 0 ▶ $self->{args}{uninst} || 0 );
Condition0%0/2
$self->{'args'}{'uninst'} || 0
l!l
00
MC/DC0%0/1
$self->{'args'}{'uninst'} || 0
$self->{'args'}{'uninst'}
Truth table0%0/2
A
A= $self->{'args'}{'uninst'}
Aresult
11
00
50 }
51  
52 sub ACTION_install {
53 0 ▶ my $self = shift;
Subroutine ACTION_install: not called CC=3 SCAR=24.8
Pod undocumented
54 0 $self->SUPER::ACTION_install(@_);
55 0 my $home = $ENV{HOME};
56 0 ▶ my $elispdir = $self->{args}{elispdir} || "$home/.emacs.d/pde";
Condition0%0/2
$self->{'args'}{'elispdir'} || "$home/.emacs.d/pde"
l!l
00
MC/DC0%0/1
$self->{'args'}{'elispdir'} || "$home/.emacs.d/pde"
$self->{'args'}{'elispdir'}
Truth table0%0/2
A
A= $self->{'args'}{'elispdir'}
Aresult
11
00
57 ExtUtils::Install::install( {lisp => $elispdir}, !$self->quiet, 0,
58 0 ▶ $self->{args}{uninst} || 0 );
Condition0%0/2
$self->{'args'}{'uninst'} || 0
l!l
00
MC/DC0%0/1
$self->{'args'}{'uninst'} || 0
$self->{'args'}{'uninst'}
Truth table0%0/2
A
A= $self->{'args'}{'uninst'}
Aresult
11
00
59 }
60  
61 sub ACTION_info {
62 0 ▶ my $self = shift;
Subroutine ACTION_info: not called CC=3 SCAR=24.8
Pod undocumented
63 0 my $texi = "lisp/doc/pde.texi";
64 0 my $info = "lisp/doc/pde.info";
65 0 ▶ if ( !-e $info || stat($texi)->mtime > stat($info)->mtime ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not -e $info or &MyModuleBuilder::stat($texi)->mtime > &MyModuleBuilder::stat($info)->mtime) { } 0 0 0
Condition0%0/3
not -e $info or &MyModuleBuilder::stat($texi)->mtime > &MyModuleBuilder::stat($info)->mtime
l!l&&r!l&&!r
000
MC/DC0%0/2
not -e $info or &MyModuleBuilder::stat($texi)->mtime > &MyModuleBuilder::stat($info)->mtime
not -e $info &MyModuleBuilder::stat($texi)->mtime > &MyModuleBuilder::stat($info)->mtime
Truth table0%0/3
not(A) or B
A= not -e $infoB= &MyModuleBuilder::stat($texi)->mtime > &MyModuleBuilder::stat($info)->mtime
ABresult
1X1
011
000
66 0 print qq/makeinfo --fill-column=70 $texi\n/;
67 0 system("makeinfo", "--fill-column=70", "-o", $info, $texi);
68 }
69 else {
70 0 print "$info is already updated to date\n";
71 }
72 0 return;
73 }
74  
75 sub ACTION_disthtml {
76 0 ▶ my $self = shift;
Subroutine ACTION_disthtml: not called CC=3 SCAR=24.8
Pod undocumented
77 0 $self->depends_on('muse');
78 0 my $html = 'lisp/doc/pde.html';
79 0 my $htmldir = 'lisp/doc/pde';
80 0 my $texi = "lisp/doc/pde.texi";
81 0 ▶ if ( !-e $html || stat($texi)->mtime > stat($html)->mtime ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not -e $html or &MyModuleBuilder::stat($texi)->mtime > &MyModuleBuilder::stat($html)->mtime) { } 0 0 0
Condition0%0/3
not -e $html or &MyModuleBuilder::stat($texi)->mtime > &MyModuleBuilder::stat($html)->mtime
l!l&&r!l&&!r
000
MC/DC0%0/2
not -e $html or &MyModuleBuilder::stat($texi)->mtime > &MyModuleBuilder::stat($html)->mtime
not -e $html &MyModuleBuilder::stat($texi)->mtime > &MyModuleBuilder::stat($html)->mtime
Truth table0%0/3
not(A) or B
A= not -e $htmlB= &MyModuleBuilder::stat($texi)->mtime > &MyModuleBuilder::stat($html)->mtime
ABresult
1X1
011
000
82 0 print qq/makeinfo --no-split --html -o $html $texi\n/;
83 0 system("makeinfo", "--no-split", "--html", "-o", $html, $texi);
84 0 print qq/makeinfo --html -o $htmldir $texi\n/;
85 0 system("makeinfo", "--html", "-o", $htmldir, $texi);
86 }
87 else {
88 0 print "html documents is updated to date.\n";
89 }
90 0 return;
91 }
92  
93 sub ACTION_muse {
94 0 ▶ my $self = shift;
Subroutine ACTION_muse: not called CC=4 SCAR=30.0
Pod undocumented
95 0 my @muse = ('misc/QuickStart.muse', 'misc/QuickStartEn.muse');
96 0 my @otherlib = (
97 '/home/ywb/.emacs.d/site-lisp/mycontrib/dot-emacs-helper.el',
98 "/home/ywb/.emacs.d/config/muse-init.el",
99 "/home/ywb/proj/darcs/pde/misc/muse-myhtml.el"
100 );
101 0 foreach my $muse ( @muse ) {
102 0 (my $html = 'lisp/doc/'.basename($muse)) =~ s/\.muse/.html/;
103 0 ▶ if ( !-e $html || stat($muse)->mtime > stat($muse)->mtime ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not -e $html or &MyModuleBuilder::stat($muse)->mtime > &MyModuleBuilder::stat($muse)->mtime) { } 0 0 0
Condition0%0/3
not -e $html or &MyModuleBuilder::stat($muse)->mtime > &MyModuleBuilder::stat($muse)->mtime
l!l&&r!l&&!r
000
MC/DC0%0/2
not -e $html or &MyModuleBuilder::stat($muse)->mtime > &MyModuleBuilder::stat($muse)->mtime
not -e $html &MyModuleBuilder::stat($muse)->mtime > &MyModuleBuilder::stat($muse)->mtime
Truth table0%0/3
not(A) or B
A= not -e $htmlB= &MyModuleBuilder::stat($muse)->mtime > &MyModuleBuilder::stat($muse)->mtime
ABresult
1X1
011
000
104 system("emacs", "-q", "-batch",
105 0 (map { +"-l" => $_ } @otherlib),
106 "-f", "muse-project-batch-publish", "PDE");
107 }
108 else {
109 0 print "$html is updated to date.\n";
110 }
111 }
112 0 return;
113 }
114  
115 sub ACTION_dist {
116 0 ▶ my $self = shift;
Subroutine ACTION_dist: not called CC=1 SCAR=6.9
Pod undocumented
117 0 $self->depends_on('info');
118 0 $self->depends_on('disthtml');
119 0 return $self->SUPER::ACTION_dist(@_);
120 }
121  
122 1 1;
↑ Summary Build »