buildlib/Clownfish/CFC/Build.pm

filter: Statementstmt 42.7% 86 / 201 Branchbran 13.7% 11 / 80 Conditioncond 0.0% 0 / 17 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 68.0% 17 / 25 Podpod 0.0% 0 / 8 totaltotal 33.6% 114 / 339 CC 51 SCAR 39.9
CC
51
Cov
33%
ACTION_test_valgrind
182.0
__ANON__
72.0
ACTION_dist
56.0
CRAP 53.8
« blib/lib/Clownfish/CFC/Perl/Build.pm ↑ Summary lib/Clownfish/CFC/Perl/Build/Charmonic.pm »
1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements. See the NOTICE file distributed with
3 # this work for additional information regarding copyright ownership.
4 # The ASF licenses this file to You under the Apache License, Version 2.0
5 # (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15  
16 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 package Clownfish::CFC::Build;
20  
21 1 our $VERSION = '0.008000';
22 1 $VERSION = eval $VERSION;
23  
24 # In order to find Clownfish::CFC::Perl::Build::Charmonic, look in 'lib'
25 # and cleanup @INC afterwards.
26 1 ▶use lib 'lib';
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use base qw( Clownfish::CFC::Perl::Build::Charmonic );
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶no lib 'lib';
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 1 ▶use File::Spec::Functions qw( catfile updir catdir curdir );
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶use File::Copy qw( move );
Subroutine BEGIN: called CC=1 SCAR=0.0
32 1 ▶use File::Path qw( rmtree );
Subroutine BEGIN: called CC=1 SCAR=0.0
33 1 ▶use File::Find qw( find );
Subroutine BEGIN: called CC=1 SCAR=0.0
34 1 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 1 ▶use Cwd qw( getcwd );
Subroutine BEGIN: called CC=1 SCAR=0.0
36 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 # Establish the filepaths for various assets. If the file `LICENSE` is found
39 # in the current working directory, this is a CPAN distribution rather than a
40 # checkout from version control and things live in different dirs.
41 1 my $CHARMONIZER_C;
42 my $LEMON_DIR;
43 1 my $INCLUDE;
44 1 my $CFC_SOURCE_DIR;
45 1 my $MODULES_DIR;
46 1 my $IS_CPAN = -e 'LICENSE';
47 1 ▶if ($IS_CPAN) {
Branch: 1 branch
BranchTrueFalseTotal
if ($IS_CPAN) { } 1 0 1
48 1 $CHARMONIZER_C = 'charmonizer.c';
49 1 $INCLUDE = 'include';
50 1 $LEMON_DIR = 'lemon';
51 1 $CFC_SOURCE_DIR = 'src';
52 1 $MODULES_DIR = 'modules';
53 }
54 else {
55 0 $CHARMONIZER_C = catfile( updir(), 'common', 'charmonizer.c' );
56 0 $INCLUDE = catdir( updir(), 'include' );
57 0 $LEMON_DIR = catdir( updir(), updir(), 'lemon' );
58 0 $CFC_SOURCE_DIR = catdir( updir(), 'src' );
59 0 $MODULES_DIR = catdir( updir(), 'modules' );
60 }
61 1 my $CMARK_SOURCE_DIR = catdir( $MODULES_DIR, 'CommonMark', 'src' );
62 1 my $LEMON_EXE_PATH = catfile( $LEMON_DIR, "lemon$Config{_exe}" );
63 1 my $PPPORT_H_PATH = catfile( $INCLUDE, 'ppport.h' );
64  
65 1 __PACKAGE__->add_property('with_system_cmark');
66  
67 0 ▶sub new {
Subroutine new: not called CC=6 SCAR=37.4
Pod undocumented
68 0 my ( $class, %args ) = @_;
69 0 $args{c_source} = [ $CFC_SOURCE_DIR ];
70 0 ▶ $args{include_dirs} ||= [];
Condition0%0/2
$args{"include_dirs"} ||= []
l!l
00
MC/DC0%0/1
$args{"include_dirs"} ||= []
$args{"include_dirs"}
Truth table0%0/2
A
A= $args{"include_dirs"}
Aresult
11
00
71 0 my @aux_include = (
72 $INCLUDE,
73 $CFC_SOURCE_DIR,
74 curdir(), # for charmony.h
75 );
76 0 push @{ $args{include_dirs} }, @aux_include;
77 0 my $self = $class->SUPER::new(
78 %args,
79 recursive_test_files => 1,
80 charmonizer_params => {
81 charmonizer_c => $CHARMONIZER_C,
82 },
83 );
84 0 ▶ if ($self->with_system_cmark) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->with_system_cmark) { } 0 0 0
85 0 my %pkg_info = eval {
86 0 require ExtUtils::PkgConfig;
87 0 ExtUtils::PkgConfig->find('libcmark');
88 };
89 0 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) { } 0 0 0
90 0 push @{ $self->extra_linker_flags }, '-lcmark';
91 }
92 else {
93 0 push @{ $self->extra_compiler_flags }, $pkg_info{cflags}
94 0 ▶ if defined $pkg_info{cflags};
Branch: 1 branch
BranchTrueFalseTotal
if defined $pkg_info{"cflags"} 0 0 0
95 0 push @{ $self->extra_linker_flags }, $pkg_info{libs}
96 0 ▶ if defined $pkg_info{libs};
Branch: 1 branch
BranchTrueFalseTotal
if defined $pkg_info{"libs"} 0 0 0
97 }
98 }
99 else {
100 0 push @{ $self->c_source }, $CMARK_SOURCE_DIR;
101 0 push @{ $self->include_dirs }, $CMARK_SOURCE_DIR;
102 }
103 0 return $self;
104 }
105  
106 1 ▶sub _run_make {
Subroutine _run_make: called CC=6 SCAR=19.5
107 1 my ( $self, %params ) = @_;
108 1 my @command = @{ $params{args} };
109 1 my $dir = $params{dir};
110 1 my $current_directory = getcwd();
111 1 ▶ chdir $dir if $dir;
Branch: 1 branch
BranchTrueFalseTotal
if $dir 1 0 1
112 1 unshift @command, 'CC=' . $self->config('cc');
113 1 ▶ if ( $self->config('cc') =~ /^cl\b/ ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->config('cc') =~ /^cl\b/) { } 0 1 1
elsif ($^O =~ /mswin/i) { } 0 1 1
114 0 unshift @command, "-f", "Makefile.MSVC";
115 }
116 elsif ( $^O =~ /mswin/i ) {
117 0 unshift @command, "-f", "Makefile.MinGW";
118 }
119 1 unshift @command, "$Config{make}";
120 1 ▶ system(@command) and confess("$Config{make} failed");
Branch: 1 branch
BranchTrueFalseTotal
system @command and confess(qq[$Clownfish::CFC::Build::Config{"make"} failed]) 0 1 1
121 1 ▶ chdir $current_directory if $dir;
Branch: 1 branch
BranchTrueFalseTotal
if $dir 1 0 1
122 }
123  
124 # Write ppport.h, which supplies some XS routines not found in older Perls and
125 # allows us to use more up-to-date XS API while still supporting Perls back to
126 # 5.8.3.
127 #
128 # The Devel::PPPort docs recommend that we distribute ppport.h rather than
129 # require Devel::PPPort itself, but ppport.h isn't compatible with the Apache
130 # license.
131 1 ▶sub ACTION_ppport {
Subroutine ACTION_ppport: called CC=2 SCAR=10.1
Pod undocumented
132 1 my $self = shift;
133 1 ▶ if ( !-e $PPPORT_H_PATH ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not -e $PPPORT_H_PATH) 0 1 1
134 0 require Devel::PPPort;
135 0 $self->add_to_cleanup($PPPORT_H_PATH);
136 0 Devel::PPPort::WriteFile($PPPORT_H_PATH);
137 }
138 }
139  
140 # Build the Lemon parser generator.
141 1 ▶sub ACTION_lemon {
Subroutine ACTION_lemon: called CC=1 SCAR=0.0
Pod undocumented
142 1 my $self = shift;
143 1 print "Building the Lemon parser generator...\n\n";
144 1 $self->_run_make(
145 dir => $LEMON_DIR,
146 args => [],
147 );
148 }
149  
150 # Run all .y files through lemon.
151 1 ▶sub ACTION_parsers {
Subroutine ACTION_parsers: called CC=7 SCAR=25.7
Pod undocumented
152 1 my $self = shift;
153 1 $self->depends_on('lemon');
154 1 my $y_files = $self->rscan_dir( $CFC_SOURCE_DIR, qr/\.y$/ );
155 1 for my $y_file (@$y_files) {
156 1 my $c_file = $y_file;
157 1 my $h_file = $y_file;
158 1 ▶ $c_file =~ s/\.y$/.c/ or die "no match";
Branch: 1 branch
BranchTrueFalseTotal
$c_file =~ s/\.y$/.c/ or die "no match" 1 0 1
159 1 ▶ $h_file =~ s/\.y$/.h/ or die "no match";
Branch: 1 branch
BranchTrueFalseTotal
$h_file =~ s/\.y$/.h/ or die "no match" 1 0 1
160 1 ▶ next if $self->up_to_date( $y_file, $c_file );
Branch: 1 branch
BranchTrueFalseTotal
if $self->up_to_date($y_file, $c_file) 1 0 1
161 0 $self->add_to_cleanup( $c_file, $h_file );
162 0 my $lemon_report_file = $y_file;
163 0 ▶ $lemon_report_file =~ s/\.y$/.out/ or die "no match";
Branch: 1 branch
BranchTrueFalseTotal
$lemon_report_file =~ s/\.y$/.out/ or die "no match" 0 0 0
164 0 $self->add_to_cleanup($lemon_report_file);
165 0 ▶ system( $LEMON_EXE_PATH, '-c', $y_file ) and die "lemon failed";
Branch: 1 branch
BranchTrueFalseTotal
system $LEMON_EXE_PATH, "-c", $y_file and die "lemon failed" 0 0 0
166 }
167 }
168  
169 # Run all .l files through flex.
170 0 ▶sub ACTION_lexers {
Subroutine ACTION_lexers: not called CC=6 SCAR=37.4
Pod undocumented
171 0 my $self = shift;
172 0 my $l_files = $self->rscan_dir( $CFC_SOURCE_DIR, qr/\.l$/ );
173 # Rerun flex if lemon file changes.
174 0 my $y_files = $self->rscan_dir( $CFC_SOURCE_DIR, qr/\.y$/ );
175 0 for my $l_file (@$l_files) {
176 0 my $c_file = $l_file;
177 0 my $h_file = $l_file;
178 0 ▶ $c_file =~ s/\.l$/.c/ or die "no match";
Branch: 1 branch
BranchTrueFalseTotal
$c_file =~ s/\.l$/.c/ or die "no match" 0 0 0
179 0 ▶ $h_file =~ s/\.l$/.h/ or die "no match";
Branch: 1 branch
BranchTrueFalseTotal
$h_file =~ s/\.l$/.h/ or die "no match" 0 0 0
180 next
181 0 ▶ if $self->up_to_date( [ $l_file, @$y_files ],
Branch: 1 branch
BranchTrueFalseTotal
if $self->up_to_date([$l_file, @$y_files], [$c_file, $h_file]) 0 0 0
182 [ $c_file, $h_file ] );
183 0 ▶ system( 'flex', '--nounistd', '-o', $c_file, "--header-file=$h_file", $l_file )
Branch: 1 branch
BranchTrueFalseTotal
system "flex", "--nounistd", "-o", $c_file, "--header-file=$h_file", $l_file and die "flex failed" 0 0 0
184 and die "flex failed";
185 }
186 }
187  
188 1 ▶sub ACTION_code {
Subroutine ACTION_code: called CC=2 SCAR=7.0
Pod undocumented
189 1 my $self = shift;
190  
191 1 $self->depends_on(qw( charmony ppport parsers ));
192  
193 1 my @flags = $self->split_like_shell($self->charmony("EXTRA_CFLAGS"));
194 # The flag for the MSVC6 hack contains spaces. Make sure it stays quoted.
195 1 ▶ @flags = map { /\s/ ? qq{"$_"} : $_ } @flags;
Branch: 1 branch
BranchTrueFalseTotal
/\s/ ? : 0 8 8
196  
197 1 $self->extra_compiler_flags( '-DCFCPERL', @flags );
198  
199 1 $self->SUPER::ACTION_code;
200 }
201  
202 0 ▶sub _valgrind_base_command {
Subroutine _valgrind_base_command: not called CC=1 SCAR=6.9
203 return
204 0 "PERL_DESTRUCT_LEVEL=2 CLOWNFISH_VALGRIND=1 valgrind "
205 . "--leak-check=yes "
206 . "--show-reachable=yes "
207 . "--dsymutil=yes "
208 . "--suppressions=../../devel/conf/cfcompiler-perl.supp ";
209 }
210  
211 # Run the entire test suite under Valgrind.
212 #
213 # For this to work, the test suite must be run under a debugging Perl.
214 #
215 # A custom suppressions file will probably be needed -- use your judgment.
216 # To pass in one or more local suppressions files, provide a comma separated
217 # list like so:
218 #
219 # $ ./Build test_valgrind --suppressions=foo.supp,bar.supp
220 0 ▶sub ACTION_test_valgrind {
Subroutine ACTION_test_valgrind: not called CC=13 SCAR=52.0
Pod undocumented
221 0 my $self = shift;
222 # Debian's debugperl uses the Config.pm of the standard system perl
223 # so -DDEBUGGING won't be detected.
224 0 ▶ die "Must be run under a perl that was compiled with -DDEBUGGING"
Branch: 1 branch
BranchTrueFalseTotal
unless $self->config("ccflags") =~ /-D?DEBUGGING\b/ or $^X =~ /\bdebugperl\b/ 0 0 0
Condition0%0/3
$self->config("ccflags") =~ /-D?DEBUGGING\b/ or $^X =~ /\bdebugperl\b/
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->config("ccflags") =~ /-D?DEBUGGING\b/ or $^X =~ /\bdebugperl\b/
$self->config("ccflags") =~ /-D?DEBUGGING\b/ $^X =~ /\bdebugperl\b/
Truth table0%0/3
A or B
A= $self->config("ccflags") =~ /-D?DEBUGGING\b/B= $^X =~ /\bdebugperl\b/
ABresult
1X1
011
000
225 unless $self->config('ccflags') =~ /-D?DEBUGGING\b/
226 || $^X =~ /\bdebugperl\b/;
227 0 $self->depends_on('code');
228  
229 # Unbuffer STDOUT, grab test file names and suppressions files.
230 0 $|++;
231 0 my $t_files = $self->find_test_files; # not public M::B API, may fail
232 0 my $valgrind_command = $self->_valgrind_base_command;
233  
234 0 ▶ if ( my $local_supp = $self->args('suppressions') ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $local_supp = $self->args("suppressions")) 0 0 0
235 0 for my $supp ( split( ',', $local_supp ) ) {
236 0 $valgrind_command .= "--suppressions=$supp ";
237 }
238 }
239  
240 # Iterate over test files.
241 0 my @failed;
242 0 for my $t_file (@$t_files) {
243  
244 # Run test file under Valgrind.
245 0 print "Testing $t_file...";
246 0 ▶ die "Can't find '$t_file'" unless -f $t_file;
Branch: 1 branch
BranchTrueFalseTotal
unless -f $t_file 0 0 0
247 0 my $command = "$valgrind_command $^X -Mblib $t_file 2>&1";
248 0 my $output = "\n" . ( scalar localtime(time) ) . "\n$command\n";
249 0 $output .= `$command`;
250  
251 # Screen-scrape Valgrind output, looking for errors and leaks.
252 0 ▶ if ( $?
Branch: 1 branch
BranchTrueFalseTotal
if ($? or $output =~ /ERROR SUMMARY:\s+[^0\s]/ or $output =~ /definitely lost:\s+[^0\s]/ or $output =~ /possibly lost:\s+[^0\s]/ or $output =~ /still reachable:\s+[^0\s]/) { } 0 0 0
Condition0%0/12
$? or $output =~ /ERROR SUMMARY:\s+[^0\s]/ or $output =~ /definitely lost:\s+[^0\s]/ or $output =~ /possibly lost:\s+[^0\s]/ or $output =~ /still reachable:\s+[^0\s]/
l!l&&r!l&&!r
000
$? or $output =~ /ERROR SUMMARY:\s+[^0\s]/ or $output =~ /definitely lost:\s+[^0\s]/ or $output =~ /possibly lost:\s+[^0\s]/
l!l&&r!l&&!r
000
$? or $output =~ /ERROR SUMMARY:\s+[^0\s]/ or $output =~ /definitely lost:\s+[^0\s]/
l!l&&r!l&&!r
000
$? or $output =~ /ERROR SUMMARY:\s+[^0\s]/
l!l&&r!l&&!r
000
MC/DC0%0/5
$? or $output =~ /ERROR SUMMARY:\s+[^0\s]/ or $output =~ /definitely lost:\s+[^0\s]/ or $output =~ /possibly lost:\s+[^0\s]/ or $output =~ /still reachable:\s+[^0\s]/
$? $output =~ /ERROR SUMMARY:\s+[^0\s]/ $output =~ /definitely lost:\s+[^0\s]/ $output =~ /possibly lost:\s+[^0\s]/ $output =~ /still reachable:\s+[^0\s]/
Truth table0%0/6
A or B or C or D or E
A= $?B= $output =~ /ERROR SUMMARY:\s+[^0\s]/C= $output =~ /definitely lost:\s+[^0\s]/D= $output =~ /possibly lost:\s+[^0\s]/E= $output =~ /still reachable:\s+[^0\s]/
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
253 or $output =~ /ERROR SUMMARY:\s+[^0\s]/
254 or $output =~ /definitely lost:\s+[^0\s]/
255 or $output =~ /possibly lost:\s+[^0\s]/
256 or $output =~ /still reachable:\s+[^0\s]/ )
257 {
258 0 print " failed.\n";
259 0 push @failed, $t_file;
260 0 print "$output\n";
261 }
262 else {
263 0 print " succeeded.\n";
264 }
265 }
266  
267 # If there are failed tests, print a summary list.
268 0 ▶ if (@failed) {
Branch: 1 branch
BranchTrueFalseTotal
if (@failed) 0 0 0
269 0 print "\nFailed "
270 . scalar @failed . "/"
271 . scalar @$t_files
272 . " test files:\n "
273 . join( "\n ", @failed ) . "\n";
274 0 exit(1);
275 }
276 }
277  
278 0 ▶sub ACTION_dist {
Subroutine ACTION_dist: not called CC=7 SCAR=40.3
Pod undocumented
279 0 my $self = shift;
280  
281 # We build our Perl release tarball from a subdirectory rather than from
282 # the top-level $REPOS_ROOT. Because some assets we need are outside this
283 # directory, we need to copy them in.
284 0 my %to_copy = (
285 '../../CHANGES' => 'CHANGES',
286 '../../CONTRIBUTING.md' => 'CONTRIBUTING.md',
287 '../../LICENSE' => 'LICENSE',
288 '../../NOTICE' => 'NOTICE',
289 '../../README.md' => 'README.md',
290 '../../lemon' => 'lemon',
291 '../src' => 'src',
292 '../include' => 'include',
293 '../modules' => 'modules',
294 '../common/test/cfbase' => 't/cfbase',
295 '../common/test/cfclash' => 't/cfclash',
296 '../common/test/cfext' => 't/cfext',
297 '../common/test/cfinc' => 't/cfinc',
298 $CHARMONIZER_C => 'charmonizer.c',
299 );
300 0 print "Copying files...\n";
301 0 ▶ while (my ($from, $to) = each %to_copy) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %to_copy) 0 0 0
302 0 ▶ confess("'$to' already exists") if -e $to;
Branch: 1 branch
BranchTrueFalseTotal
if -e $to 0 0 0
303 0 ▶ system("cp -R $from $to") and confess("cp failed");
Branch: 1 branch
BranchTrueFalseTotal
system "cp -R $from $to" and confess("cp failed") 0 0 0
304 }
305 0 ▶ move( "MANIFEST", "MANIFEST.bak" ) or die "move() failed: $!";
Branch: 1 branch
BranchTrueFalseTotal
move("MANIFEST", "MANIFEST.bak") or die "move() failed: $!" 0 0 0
306 0 my $saved = _hide_pod( $self, { 'lib/Clownfish/CFC.pod' => 1 } );
307 0 $self->depends_on("manifest");
308 0 $self->SUPER::ACTION_dist;
309 0 _restore_pod( $self, $saved );
310  
311 # Now that the tarball is packaged up, delete the copied assets.
312 0 rmtree($_) for values %to_copy;
313 0 unlink("META.yml");
314 0 unlink("META.json");
315 0 ▶ move( "MANIFEST.bak", "MANIFEST" ) or die "move() failed: $!";
Branch: 1 branch
BranchTrueFalseTotal
move("MANIFEST.bak", "MANIFEST") or die "move() failed: $!" 0 0 0
316 }
317  
318 # Strip POD from files in the `lib` directory. This is a temporary measure to
319 # allow us to release Clownfish as a separate dist but with a cloaked API.
320 0 ▶sub _hide_pod {
Subroutine _hide_pod: not called CC=1 SCAR=6.9
321 0 my ( $self, $excluded ) = @_;
322 0 my %saved;
323 find(
324 {
325 no_chdir => 1,
326 0 ▶ wanted => sub {
Subroutine __ANON__: not called CC=8 SCAR=42.8
327 0 my $path = $File::Find::name;
328 0 ▶ return if $excluded->{$path};
Branch: 1 branch
BranchTrueFalseTotal
if $excluded->{$path} 0 0 0
329 0 ▶ return unless $path =~ /\.(pm|pod)$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $path =~ /\.(pm|pod)$/ 0 0 0
330 0 ▶ open( my $fh, '<:encoding(UTF-8)', $path )
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<:encoding(UTF-8)", $path or confess("Can't open '${path}' for reading: $!") 0 0 0
331 or confess("Can't open '$path' for reading: $!");
332 0 my $content = do { local $/; <$fh> };
333 0 close $fh;
334 0 ▶ if ( $path =~ /\.pod$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($path =~ /\.pod$/) { } 0 0 0
335 0 $saved{$path} = $content;
336 0 print "Hiding POD for $path\n";
337 0 ▶ unlink($path) or confess("Can't unlink '$path': $!");
Branch: 1 branch
BranchTrueFalseTotal
unlink $path or confess("Can't unlink '${path}': $!") 0 0 0
338 }
339 else {
340 0 my $copy = $content;
341 0 $copy =~ s/^=\w+.*?^=cut\s*$//gsm;
342 0 ▶ return if $copy eq $content;
Branch: 1 branch
BranchTrueFalseTotal
if $copy eq $content 0 0 0
343 0 print "Hiding POD for $path\n";
344 0 $saved{$path} = $content;
345 0 ▶ open( $fh, '>:encoding(UTF-8)', $path )
Branch: 1 branch
BranchTrueFalseTotal
open $fh, ">:encoding(UTF-8)", $path or confess("Can't open '${path}' for writing: $!") 0 0 0
346 or confess("Can't open '$path' for writing: $!");
347 0 print $fh $copy;
348 }
349 },
350 },
351 0 'lib',
352 );
353 0 return \%saved;
354 }
355  
356 # Undo POD hiding.
357 0 ▶sub _restore_pod {
Subroutine _restore_pod: not called CC=3 SCAR=24.8
358 0 my ( $self, $saved ) = @_;
359 0 ▶ while ( my ( $path, $content ) = each %$saved ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$saved) 0 0 0
360 0 ▶ open( my $fh, '>:encoding(UTF-8)', $path )
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, ">:encoding(UTF-8)", $path or confess("Can't open '${path}' for writing: $!") 0 0 0
361 or confess("Can't open '$path' for writing: $!");
362 0 print $fh $saved->{$path};
363 }
364 }
365  
366 1 1;
367  
« blib/lib/Clownfish/CFC/Perl/Build.pm ↑ Summary lib/Clownfish/CFC/Perl/Build/Charmonic.pm »