blib/lib/Test2/API/Breakage.pm

filter: Statementstmt 94.3% 50 / 53 Branchbran 100% 10 / 10 Conditioncond 66.6% 12 / 18 MC/DCmcdc 33.3% 3 / 9 Subroutinesub 100% 8 / 8 Podpod 75.0% 3 / 4 totaltotal 84.3% 86 / 102 CC 15 SCAR 24.0
CC
15
Cov
89%
report
15.6
BEGIN
1.0
BEGIN
1.0
CRAP 11.0
« blib/lib/Test2/IPC/Driver/Files.pm ↑ Summary blib/lib/Test/Builder.pm »
1 package Test2::API::Breakage;
2 24 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 24 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 24 our $VERSION = '1.302226';
6  
7  
8 24 ▶use Test2::Util qw/pkg_to_file/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 24 our @EXPORT_OK = qw{
11 upgrade_suggested
12 upgrade_required
13 known_broken
14 };
15 24 ▶BEGIN { require Exporter; our @ISA = qw(Exporter) }
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 36 ▶sub upgrade_suggested {
Subroutine upgrade_suggested: called CC=1 SCAR=0.0
Pod documented
18 return (
19 36 'Test::Exception' => '0.42',
20 'Test::FITesque' => '0.04',
21 'Test::Module::Used' => '0.2.5',
22 'Test::Moose::More' => '0.025',
23 );
24 }
25  
26 36 ▶sub upgrade_required {
Subroutine upgrade_required: called CC=1 SCAR=0.0
Pod documented
27 return (
28 36 'Test::Builder::Clutch' => '0.07',
29 'Test::Dist::VersionSync' => '1.1.4',
30 'Test::Modern' => '0.012',
31 'Test::SharedFork' => '0.34',
32 'Test::Alien' => '0.04',
33 'Test::UseAllModules' => '0.14',
34 'Test::More::Prefix' => '0.005',
35  
36 'Test2::Tools::EventDumper' => 0.000007,
37 'Test2::Harness' => 0.000013,
38  
39 'Test::DBIx::Class::Schema' => '1.0.9',
40 'Test::Clustericious::Cluster' => '0.30',
41 );
42 }
43  
44 36 ▶sub known_broken {
Subroutine known_broken: called CC=1 SCAR=0.0
Pod documented
45 return (
46 36 'Test::Able' => '0.11',
47 'Test::Aggregate' => '0.373',
48 'Test::Flatten' => '0.11',
49 'Test::Group' => '0.20',
50 'Test::ParallelSubtest' => '0.05',
51 'Test::Pretty' => '0.32',
52 'Test::Wrapper' => '0.3.0',
53  
54 'Log::Dispatch::Config::TestLog' => '0.02',
55 );
56 }
57  
58 # Not reportable:
59 # Device::Chip => 0.07 - Tests will not pass, but not broken if already installed, also no fixed version we can upgrade to.
60  
61 40 ▶sub report {
Subroutine report: called CC=15 SCAR=27.5
Pod undocumented
62 40 my $class = shift;
63 40 my ($require) = @_;
64  
65 40 my %suggest = __PACKAGE__->upgrade_suggested();
66 40 my %required = __PACKAGE__->upgrade_required();
67 40 my %broken = __PACKAGE__->known_broken();
68  
69 40 my @warn;
70 40 for my $mod (keys %suggest) {
71 150 my $file = pkg_to_file($mod);
72 0 ▶ next unless $INC{$file} || ($require && eval { require $file; 1 });
Branch: 1 branch
BranchTrueFalseTotal
unless $INC{$file} or $require and eval { do { require $file; 1 } } 148 2 150
Condition66%4/6
$INC{$file} or $require and eval { do { require $file; 1 } }
l!l&&r!l&&!r
20148
$require and eval { do { require $file; 1 } }
!ll&&!rl&&r
14440
MC/DC33%1/3
$INC{$file} or $require and eval { do { require $file; 1 } }
$INC{$file} $require eval { do { require $file; 1 } }
Truth table75%3/4
A or B and C
A= $INC{$file}B= $requireC= eval { do { require $file; 1 } }
ABCresult
1XX1
0111
00X0
0100
73 2 my $want = $suggest{$mod};
74 2 ▶ next if eval { $mod->VERSION($want); 1 };
Branch: 1 branch
BranchTrueFalseTotal
if eval { do { $mod->VERSION($want); 1 } } 1 1 2
75 1 my $error = $@;
76 1 chomp $error;
77 1 push @warn => " * Module '$mod' is outdated, we recommend updating above $want. error was: '$error'; INC is $INC{$file}";
78 }
79  
80 40 for my $mod (keys %required) {
81 395 my $file = pkg_to_file($mod);
82 0 ▶ next unless $INC{$file} || ($require && eval { require $file; 1 });
Branch: 1 branch
BranchTrueFalseTotal
unless $INC{$file} or $require and eval { do { require $file; 1 } } 393 2 395
Condition66%4/6
$INC{$file} or $require and eval { do { require $file; 1 } }
l!l&&r!l&&!r
20393
$require and eval { do { require $file; 1 } }
!ll&&!rl&&r
38940
MC/DC33%1/3
$INC{$file} or $require and eval { do { require $file; 1 } }
$INC{$file} $require eval { do { require $file; 1 } }
Truth table75%3/4
A or B and C
A= $INC{$file}B= $requireC= eval { do { require $file; 1 } }
ABCresult
1XX1
0111
00X0
0100
83 2 my $want = $required{$mod};
84 2 ▶ next if eval { $mod->VERSION($want); 1 };
Branch: 1 branch
BranchTrueFalseTotal
if eval { do { $mod->VERSION($want); 1 } } 1 1 2
85 1 push @warn => " * Module '$mod' is outdated and known to be broken, please update to $want or higher.";
86 }
87  
88 40 for my $mod (keys %broken) {
89 290 my $file = pkg_to_file($mod);
90 0 ▶ next unless $INC{$file} || ($require && eval { require $file; 1 });
Branch: 1 branch
BranchTrueFalseTotal
unless $INC{$file} or $require and eval { do { require $file; 1 } } 288 2 290
Condition66%4/6
$INC{$file} or $require and eval { do { require $file; 1 } }
l!l&&r!l&&!r
20288
$require and eval { do { require $file; 1 } }
!ll&&!rl&&r
28440
MC/DC33%1/3
$INC{$file} or $require and eval { do { require $file; 1 } }
$INC{$file} $require eval { do { require $file; 1 } }
Truth table75%3/4
A or B and C
A= $INC{$file}B= $requireC= eval { do { require $file; 1 } }
ABCresult
1XX1
0111
00X0
0100
91 2 my $tested = $broken{$mod};
92 2 push @warn => " * Module '$mod' is known to be broken in version $tested and below, newer versions have not been tested. You have: " . $mod->VERSION;
93 }
94  
95 40 return @warn;
96 }
97  
98 24 1;
99  
100 __END__
« blib/lib/Test2/IPC/Driver/Files.pm ↑ Summary blib/lib/Test/Builder.pm »