corpus/dist1/xt/lib/Local/Test.pm

filter: Statementstmt 97.2% 35 / 36 Branchbran 50.0% 7 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 82.7% 48 / 58 CC 10 SCAR 15.3
CC
10
Cov
84%
BUILD
6.7
run
5.1
BEGIN
1.0
CRAP 4.6
« lib/XT/Files.pm ↑ Summary lib/XT/Files/Plugin/Default.pm »
1 package Local::Test;
2  
3 4 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 our $VERSION = '0.001';
8  
9 4 ▶use parent 'XT::Files::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub BUILD {
12 8 ▶ my ( $self, $args ) = @_;
Subroutine BUILD: called CC=6 SCAR=19.0
Pod undocumented
13  
14 8 my $report_file = $ENV{REPORT_FILE_BASE};
15 8 ▶ die 'Environment variable REPORT_FILE not set' if !defined $report_file;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $report_file 0 8 8
16 8 $report_file .= '.new';
17  
18 8 ▶ open my $fh, '>', $report_file or die "Unable to write file $report_file: $!";
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, ">", $report_file or die "Unable to write file ${report_file}: $!" 0 8 8
19 ARG:
20 8 for my $key ( sort keys %{$args} ) {
21 8 ▶ next ARG if $key eq 'xtf';
Branch: 1 branch
BranchTrueFalseTotal
if $key eq "xtf" 8 0 8
22 0 print $fh "$key=$args->{$key}\n";
23 }
24 8 ▶ close $fh or die "Unable to write file $report_file: $!";
Branch: 1 branch
BranchTrueFalseTotal
close $fh or die "Unable to write file ${report_file}: $!" 0 8 8
25  
26 8 return $self;
27 }
28  
29 sub run {
30 8 ▶ my ( $self, $args ) = @_;
Subroutine run: called CC=5 SCAR=16.3
Pod undocumented
31  
32 8 my $report_file = $ENV{REPORT_FILE_BASE};
33 8 ▶ die 'Environment variable REPORT_FILE not set' if !defined $report_file;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $report_file 0 8 8
34 8 $report_file .= '.run';
35  
36 8 ▶ open my $fh, '>', $report_file or die "Unable to write file $report_file: $!";
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, ">", $report_file or die "Unable to write file ${report_file}: $!" 0 8 8
37 8 for my $arg ( @{$args} ) {
38 21 my ( $key, $value ) = @{$arg};
39 21 print $fh "$key=$value\n";
40 }
41 8 ▶ close $fh or die "Unable to write file $report_file: $!";
Branch: 1 branch
BranchTrueFalseTotal
close $fh or die "Unable to write file ${report_file}: $!" 0 8 8
42  
43 8 return;
44 }
45  
46 4 1;
47  
48 # vim: ts=4 sts=4 sw=4 et: syntax=perl
« lib/XT/Files.pm ↑ Summary lib/XT/Files/Plugin/Default.pm »