Minilla/ReleaseTest.pm

filter: Statementstmt 46.6% 28 / 60 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 7 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 75.0% 9 / 12 Podpod 0.0% 0 / 2 totaltotal 43.0% 37 / 86 CC 7 SCAR 23.9
CC
7
Cov
41%
write_release_tests
30.0
__ANON__
12.0
prereqs
2.0
CRAP 10.9
« Minilla/CLI/Prepare.pm ↑ Summary Minilla/ModuleMaker/ModuleBuild.pm »
1 package Minilla::ReleaseTest;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Data::Section::Simple qw(get_data_section);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use File::pushd;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use File::Spec::Functions qw(catfile);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use File::Path qw(mkpath);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use Minilla::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Minilla::Util qw(spew);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 0 ▶sub write_release_tests {
Subroutine write_release_tests: not called CC=5 SCAR=34.0
Pod undocumented
14 0 my ($class, $project, $dir) = @_;
15  
16 0 mkpath(catfile($dir, 'xt', 'minilla'));
17  
18 0 my $stopwords = do {
19 0 ▶ my $append_people_into_stopwords = sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
20 0 my $people = shift;
21 0 my @stopwords;
22 0 ▶ for (@{$people || +[]}) {
Condition0%0/2
$people || []
l!l
00
MC/DC0%0/1
$people || []
$people
Truth table0%0/2
A
A= $people
Aresult
11
00
23 0 s!<.*!!; # trim e-mail address
24 0 push @stopwords, split(/\s+/, $_);
25 }
26 0 return @stopwords;
27 0 };
28  
29 0 my @stopwords;
30 0 push @stopwords, $append_people_into_stopwords->($project->contributors);
31 0 push @stopwords, $append_people_into_stopwords->($project->authors);
32 0 local $Data::Dumper::Terse = 1;
33 0 local $Data::Dumper::Useqq = 1;
34 0 local $Data::Dumper::Purity = 1;
35 0 local $Data::Dumper::Indent = 0;
36 0 Data::Dumper::Dumper([map { split /\s+/, $_ } @stopwords]);
37 };
38  
39 0 my $config = $project->config->{ReleaseTest};
40 0 my $name = $project->dist_name;
41 0 for my $file (qw(
42 xt/minilla/minimum_version.t
43 xt/minilla/cpan_meta.t
44 xt/minilla/pod.t
45 xt/minilla/spelling.t
46 xt/minilla/permissions.t
47 )) {
48 0 infof("Writing release tests: %s\n", $file);
49  
50 0 ▶ if ($file eq 'xt/minilla/minimum_version.t' && ($config->{MinimumVersion}||'') eq 'false') {
Branch: 1 branch
BranchTrueFalseTotal
if ($file eq "xt/minilla/minimum_version.t" and ($config->{"MinimumVersion"} || "") eq "false") 0 0 0
Condition0%0/5
$file eq "xt/minilla/minimum_version.t" and ($config->{"MinimumVersion"} || "") eq "false"
!ll&&!rl&&r
000
$config->{'MinimumVersion'} || ''
l!l
00
MC/DC0%0/2
$file eq "xt/minilla/minimum_version.t" and ($config->{"MinimumVersion"} || "") eq "false"
$file eq "xt/minilla/minimum_version.t" $config->{'MinimumVersion'}
Truth table0%0/3
A and B
A= $file eq "xt/minilla/minimum_version.t"B= $config->{'MinimumVersion'}
ABresult
0X0
100
111
51 0 infof("Skipping MinimumVersion");
52 0 next;
53 }
54  
55 0 my $content = get_data_section($file);
56 0 $content =~s!<<DIST>>!$name!g;
57 0 $content =~s!<<STOPWORDS>>!$stopwords!g;
58 0 spew(catfile($dir, $file), $content);
59 }
60 }
61  
62 0 ▶sub prereqs {
Subroutine prereqs: not called CC=1 SCAR=6.9
Pod undocumented
63 +{
64 0 develop => {
65 requires => {
66 'Test::MinimumVersion::Fast' => 0.04,
67 'Test::CPAN::Meta' => 0,
68 'Test::Pod' => 1.41,
69 'Test::Spellunker' => 'v0.2.7',
70 'Test::PAUSE::Permissions' => 0.07,
71 },
72 },
73 };
74 }
75  
76 2 1;
77 __DATA__
« Minilla/CLI/Prepare.pm ↑ Summary Minilla/ModuleMaker/ModuleBuild.pm »