| 1 | package CPAN::Testers::ParseReport; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Compress::Zlib ('$gzerrno'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 5 | my $LOADED = eval { require DateTime::Format::Strptime; 1; }; # uses Params::Util which may cause loading warnings with perl 5.8.9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 5 | ▶ | die $@ if !$LOADED and $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $LOADED and $@
MC/DC0%0/2
not $LOADED and $@
not $LOADED
$@
Truth table33%1/3
not(A) and B
A= not $LOADEDB= $@
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 5 | ▶ | use File::Basename qw(basename); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use File::Path qw(mkpath); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 5 | ▶ | use File::ReadBackwards; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 5 | ▶ | use HTML::Entities qw(decode_entities); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use JSON::XS (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 5 | ▶ | use LWP::UserAgent; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 5 | ▶ | use List::AllUtils qw(uniq max min sum); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 5 | ▶ | use MIME::QuotedPrint (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 5 | ▶ | use Time::Local (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 5 | ▶ | use Time::HiRes; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 5 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 5 | our $default_distrotransport = "ctjson"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 5 | our $default_transport = "http_cpantesters"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 5 | our $default_cturl = "https://api.cpantesters.org"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 5 | our $Signal = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | =encoding utf-8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | CPAN::Testers::ParseReport - parse reports to www.cpantesters.org from various sources | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 5 | ▶ | use version; our $VERSION = qv('0.6.0'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | The documentation in here is normally not needed because the code is | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | meant to be run from the standalone program C<ctgetreports>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | ctgetreports --q mod:Moose Devel-Events | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | This is the core module for CPAN::Testers::ParseReport. If you're not | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | looking to extend or alter the behaviour of this module, you probably | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | want to look at L<ctgetreports> instead. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | =head1 OPTIONS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | Options are described in the L<ctgetreports> manpage and are passed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | through to the functions unaltered. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | =head1 FUNCTIONS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | =head2 parse_distro($distro,%options) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | reads the cpantesters JSON file or the local database for the distro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | and loops through the reports for the specified or most recent version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | of that distro found in these data. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | parse_distro() intentionally has no meaningful return value, different | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | options would require different ones. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | =head2 $extract = parse_single_report($report,$dumpvars,%options) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | mirrors and reads this report. $report is of the form | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | { guid => <guid>, } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | $dumpvar is a hashreference that gets filled with data. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | $extract is the result of parse_report() described below. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | # A mapping of v3 API osname to a user-friendly label for the OS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | # to use in reporting. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | # TODO: This should probably be done by the API instead of here... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 5 | my %OSNAME = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | aix => 'AIX', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | bsdos => 'BSD/OS', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | cygwin => "Windows (Cygwin)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | darwin => "Mac OS X", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | dec_osf => "Tru64", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | dragonfly => "Dragonfly BSD", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | freebsd => "FreeBSD", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | gnu => "GNU Hurd", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | haiku => "Haiku", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | hpux => "HP-UX", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | irix => "IRIX", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | linux => "GNU/Linux", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | macos => "Mac OS classic", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | midnightbsd => "MidnightBSD", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | mirbsd => "MirOS BSD", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | mswin32 => "Windows (Win32)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | netbsd => "NetBSD", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | openbsd => "OpenBSD", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | os2 => "OS/2", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | os390 => "OS390/zOS", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | gnukfreebsd => "Debian GNU/kFreeBSD", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | sco => "SCO", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | solaris => "SunOS/Solaris", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | vms => "VMS", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | beos => "BeOS", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | interix => "Interix", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | nto => "QNX Neutrino", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | minix => "MINIX", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | bitrig => "BITRIG", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | Mac => "MAC", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 5 | my $ua; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | sub _ua { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_ua: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | return $ua if $ua; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | $ua = LWP::UserAgent->new | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | keep_alive => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | env_proxy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | timeout => 900, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | $ua->parse_head(0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | $ua; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 5 | my $ua; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | ▶ | sub _ua_gzip { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_ua_gzip: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | return $ua if $ua; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | $ua = LWP::UserAgent->new | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | keep_alive => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | env_proxy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | $ua->parse_head(0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | $ua->default_header('Accept-Encoding' => scalar HTTP::Message::decodable()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | $ua; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | # we called it yaml because it was yaml; now it is json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 5 | my $j = JSON::XS->new->ascii->pretty; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 9 | ▶ | sub _slurp { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_slurp: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 9 | my($file) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 9 | local $/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 9 | ▶ | open my $fh, $file or die "Could not open '$file': $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 9 | <$fh>; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 9 | ▶ | sub _yaml_loadfile { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_yaml_loadfile: called CC=2 SCAR=9.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 9 | my $file = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 9 | my $content = _slurp $file; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | # $DB::single = 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 9 | ▶ | if ($file =~ /\.ndjson$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | $content =~ s/}$/},/gm; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | $content =~ s/,\s*\z//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | $content =~ s/^/\[/s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | $content =~ s/\z/\]/s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 9 | $j->decode($content); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 5 | ▶ | sub _yaml_dump { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_yaml_dump: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 5 | $j->encode(shift); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 5 | ▶ | sub _download_overview { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_download_overview: called CC=41 SCAR=71.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 5 | my($cts_dir, $distro, %Opt) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 5 | ▶ | my $cturl = $Opt{cturl} ||= $default_cturl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$Opt{"cturl"} ||= $CPAN::Testers::ParseReport::default_cturl
MC/DC0%0/2
$Opt{"cturl"} ||= $CPAN::Testers::ParseReport::default_cturl
$Opt{"cturl"}
$CPAN::Testers::ParseReport::default_cturl
Truth table33%1/3
A ||= B
A= $Opt{"cturl"}B= $CPAN::Testers::ParseReport::default_cturl
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 5 | ▶ | $Opt{distrotransport} ||= $default_distrotransport; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$Opt{"distrotransport"} ||= $CPAN::Testers::ParseReport::default_distrotransport
MC/DC0%0/2
$Opt{"distrotransport"} ||= $CPAN::Testers::ParseReport::default_distrotransport
$Opt{"distrotransport"}
$CPAN::Testers::ParseReport::default_distrotransport
Truth table33%1/3
A ||= B
A= $Opt{"distrotransport"}B= $CPAN::Testers::ParseReport::default_distrotransport
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 5 | ▶ | my $extension = $Opt{distrotransport} eq "ndjson" ? "ndjson" : "json"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 5 | my $ctarget = "$cts_dir/$distro.$extension"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 5 | my $cheaders = "$cts_dir/$distro.headers"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 5 | ▶ | if ($Opt{local}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 5 | ▶ | unless (-e $ctarget) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | die "Alert: No local file '$ctarget' found, cannot continue\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | if (0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | } elsif ($Opt{distrotransport} eq "ctjson") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | if (! -e $ctarget or -M $ctarget > .25) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not -e $ctarget or -M $ctarget > "0.25"
MC/DC0%0/2
not -e $ctarget or -M $ctarget > "0.25"
not -e $ctarget
-M $ctarget > "0.25"
Truth table0%0/3
not(A) or B
A= not -e $ctargetB= -M $ctarget > "0.25"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | ▶ | if (-e $ctarget && $Opt{verbose}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-e $ctarget and $Opt{"verbose"}
MC/DC0%0/2
-e $ctarget and $Opt{"verbose"}
-e $ctarget
$Opt{"verbose"}
Truth table0%0/3
A and B
A= -e $ctargetB= $Opt{"verbose"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | my(@stat) = stat _; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | my $timestamp = gmtime $stat[9]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | print STDERR "(timestamp $timestamp GMT)\n" unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | my $uri = "$cturl/v3/summary/$distro"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | ▶ | print STDERR "Fetching $ctarget ($uri)...\n" if $Opt{verbose} && !$Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$Opt{"verbose"} and not $Opt{"quiet"}
MC/DC0%0/2
$Opt{"verbose"} and not $Opt{"quiet"}
$Opt{"verbose"}
not $Opt{"quiet"}
Truth table0%0/3
A and not(B)
A= $Opt{"verbose"}B= not $Opt{"quiet"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | my $resp = _ua->mirror($uri,$ctarget); # should most probably be _ua_gip, but then we need to deal with uncompressing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | if ($resp->is_success) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | ▶ | print STDERR "DONE\n" if $Opt{verbose} && !$Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$Opt{"verbose"} and not $Opt{"quiet"}
MC/DC0%0/2
$Opt{"verbose"} and not $Opt{"quiet"}
$Opt{"verbose"}
not $Opt{"quiet"}
Truth table0%0/3
A and not(B)
A= $Opt{"verbose"}B= not $Opt{"quiet"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | open my $fh, ">", $cheaders or die; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | for ($resp->headers->as_string) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | print $fh $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | if ($Opt{verbose} && $Opt{verbose}>1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$Opt{"verbose"} and $Opt{"verbose"} > 1
MC/DC0%0/2
$Opt{"verbose"} and $Opt{"verbose"} > 1
$Opt{"verbose"}
$Opt{"verbose"} > 1
Truth table0%0/3
A and B
A= $Opt{"verbose"}B= $Opt{"verbose"} > 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | print STDERR $_ unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } elsif (304 == $resp->code) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | print STDERR "DONE (not modified)\n" if $Opt{verbose} && !$Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$Opt{"verbose"} and not $Opt{"quiet"}
MC/DC0%0/2
$Opt{"verbose"} and not $Opt{"quiet"}
$Opt{"verbose"}
not $Opt{"quiet"}
Truth table0%0/3
A and not(B)
A= $Opt{"verbose"}B= not $Opt{"quiet"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | my $atime = my $mtime = time; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | utime $atime, $mtime, $cheaders; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | die sprintf | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | "No success downloading %s: %s", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | $uri, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | $resp->status_line, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | } elsif ($Opt{distrotransport} eq "ndjson") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | ▶ | my $ndjsonurl = $Opt{ndjsonurl} or die "missing option --ndjsonurl"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | my($uri); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | if ( -e $ctarget ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | ▶ | my $bw = File::ReadBackwards->new( $ctarget ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | or die "can't read '$ctarget': $!" ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | my($log_line, $highestguid); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | my $j = JSON::XS->new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | BW: while( defined( $log_line = $bw->readline ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | my $h = $j->decode($log_line); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | ▶ | if ($highestguid = $h->{guid}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | last BW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | ▶ | if ($highestguid) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | $uri = "$ndjsonurl?dist=$distro&after=$highestguid"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | $uri = "$ndjsonurl?dist=$distro"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | $uri = "$ndjsonurl?dist=$distro"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | my $resp = _ua->get($uri); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | ▶ | if ($resp->is_success) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | ▶ | print STDERR "DONE\n" if $Opt{verbose} && !$Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$Opt{"verbose"} and not $Opt{"quiet"}
MC/DC0%0/2
$Opt{"verbose"} and not $Opt{"quiet"}
$Opt{"verbose"}
not $Opt{"quiet"}
Truth table0%0/3
A and not(B)
A= $Opt{"verbose"}B= not $Opt{"quiet"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | ▶ | open my $fh, ">", $cheaders or die; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | for ($resp->headers->as_string) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | print $fh $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | ▶ | if ($Opt{verbose} && $Opt{verbose}>1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$Opt{"verbose"} and $Opt{"verbose"} > 1
MC/DC0%0/2
$Opt{"verbose"} and $Opt{"verbose"} > 1
$Opt{"verbose"}
$Opt{"verbose"} > 1
Truth table0%0/3
A and B
A= $Opt{"verbose"}B= $Opt{"verbose"} > 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | ▶ | print STDERR $_ unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | open $fh, ">>", $ctarget or die "could not open >>'$ctarget': $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | print $fh $resp->content; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | die sprintf | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | "No success downloading %s: %s", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | $uri, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | $resp->status_line, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | die {severity=>0, text=>"Unknown distrotransport '$Opt{distrotransport}'"}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 5 | return $ctarget; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 5 | ▶ | sub _parse_yaml { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_parse_yaml: called CC=10 SCAR=26.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 5 | my($ctarget, %Opt) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 5 | my $arr = _yaml_loadfile($ctarget); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 5 | my($selected_release_ul,$selected_release_distrov,$excuse_string); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 5 | ▶ | if ($Opt{vdistro}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | $excuse_string = "selected distro '$Opt{vdistro}'"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | ▶ | $arr = [grep { ($_->{distversion}||=join("-",$_->{dist},$_->{version})) eq $Opt{vdistro} } @$arr]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$_->{"distversion"} ||= join("-", $_->{"dist"}, $_->{"version"})
MC/DC0%0/2
$_->{"distversion"} ||= join("-", $_->{"dist"}, $_->{"version"})
$_->{"distversion"}
join("-", $_->{"dist"}, $_->{"version"})
Truth table0%0/3
A ||= B
A= $_->{"distversion"}B= join("-", $_->{"dist"}, $_->{"version"})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 0 | ($selected_release_distrov) = $arr->[0]{distversion}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | # To find the "latest" version of the dist, we used to sort by the report's numeric ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | # and use the last newly-seen dist-version. The new API does not have the numeric ID, but it | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | # does have an ISO-8601 date/time string... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 5 | $excuse_string = "any distro"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 5 | my $last_addition; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | my %seen; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 5 | for my $report (sort { $a->{date} cmp $b->{date} } @$arr) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 1745 | ▶ | $report->{distversion}||=join("-",$report->{dist},$report->{version}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$report->{"distversion"} ||= join("-", $report->{"dist"}, $report->{"version"})
MC/DC0%0/2
$report->{"distversion"} ||= join("-", $report->{"dist"}, $report->{"version"})
$report->{"distversion"}
join("-", $report->{"dist"}, $report->{"version"})
Truth table33%1/3
A ||= B
A= $report->{"distversion"}B= join("-", $report->{"dist"}, $report->{"version"})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 1745 | ▶ | unless ($seen{$report->{distversion}}++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 95 | $last_addition = $report->{distversion}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 5 | $arr = [grep {$_->{distversion} eq $last_addition} @$arr]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 5 | ($selected_release_distrov) = $last_addition; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 5 | ▶ | unless ($selected_release_distrov) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | warn "Warning: could not find $excuse_string in '$ctarget'"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 5 | ▶ | print STDERR "SELECTED: $selected_release_distrov\n" unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 5 | my @all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 5 | for my $test (@$arr) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | push @all, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | guid => $test->{guid}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 650 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 650 | ▶ | return if $Signal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 5 | @all = sort { $b->{guid} cmp $a->{guid} } @all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 5 | return \@all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 495 | ▶ | sub parse_single_report { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_single_report: called CC=44 SCAR=73.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 495 | my($report, $dumpvars, %Opt) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 495 | my($guid) = $report->{guid}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 495 | ▶ | $Opt{cachedir} ||= "$ENV{HOME}/var/cpantesters"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$Opt{"cachedir"} ||= qq[$ENV{"HOME"}/var/cpantesters]
MC/DC0%0/1
$Opt{"cachedir"} ||= qq[$ENV{"HOME"}/var/cpantesters]
$Opt{"cachedir"}
Truth table50%1/2
A
A= $Opt{"cachedir"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 495 | ▶ | my $cturl = $Opt{cturl} ||= $default_cturl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$Opt{"cturl"} ||= $CPAN::Testers::ParseReport::default_cturl
MC/DC0%0/2
$Opt{"cturl"} ||= $CPAN::Testers::ParseReport::default_cturl
$Opt{"cturl"}
$CPAN::Testers::ParseReport::default_cturl
Truth table33%1/3
A ||= B
A= $Opt{"cturl"}B= $CPAN::Testers::ParseReport::default_cturl
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | # the name nntp-testers was picked because originally the reports | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | # were available from an NNTP server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 495 | my $nnt_dir = "$Opt{cachedir}/nntp-testers"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 495 | mkpath $nnt_dir; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 495 | my $target = "$nnt_dir/$guid"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 495 | ▶ | if ($Opt{local}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 495 | ▶ | unless (-e $target) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | die {severity=>0,text=>"Warning: No local file '$target' found, skipping\n"}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | ▶ | $Opt{transport} ||= $default_transport; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$Opt{"transport"} ||= $CPAN::Testers::ParseReport::default_transport
MC/DC0%0/2
$Opt{"transport"} ||= $CPAN::Testers::ParseReport::default_transport
$Opt{"transport"}
$CPAN::Testers::ParseReport::default_transport
Truth table0%0/3
A ||= B
A= $Opt{"transport"}B= $CPAN::Testers::ParseReport::default_transport
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | my $ttarget; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | ▶ | if (-e $target) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | $ttarget = $target; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | } elsif (-e "$target.gz") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | $ttarget = "$target.gz"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 0 | ▶ | if ($ttarget) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | my $raw_report; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | 0 | ▶ | open my $fh, $ttarget or die "Could not open '$ttarget': $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | ▶ | if (0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | } elsif ($Opt{transport} eq "http_cpantesters") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | local $/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | $raw_report = <$fh>; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | } elsif ($Opt{transport} eq "http_cpantesters_gzip") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | my $gz = Compress::Zlib::gzopen($fh, "rb"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | $raw_report = ""; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 0 | my $buffer; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | ▶ | while (my $bytesread = $gz->gzread($buffer)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 0 | $raw_report .= $buffer; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | ▶ | if ($raw_report =~ m{<title>.*(Report not found|Error).*</title>}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | ▶ | unlink $ttarget or die "Could not unlink '$ttarget': $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | ▶ | if (! -e $target) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | ▶ | print STDERR "Fetching $target..." if $Opt{verbose} && !$Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$Opt{"verbose"} and not $Opt{"quiet"}
MC/DC0%0/2
$Opt{"verbose"} and not $Opt{"quiet"}
$Opt{"verbose"}
not $Opt{"quiet"}
Truth table0%0/3
A and not(B)
A= $Opt{"verbose"}B= not $Opt{"quiet"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | ▶ | if (0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | } elsif ($Opt{transport} eq "http_cpantesters") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | my $mustfetch = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | ▶ | if ($Opt{"prefer-local-reports"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | 0 | ▶ | unless (-e $target) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | $mustfetch = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | $mustfetch = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 0 | ▶ | if ($mustfetch) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | # The API server returns a JSON structure containing both the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | # raw output and details parsed from that output. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 0 | my $uri = "$cturl/v3/report/$guid"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | my $resp = _ua->get($uri); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | 0 | ▶ | if ($resp->is_success) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 0 | my $json = $resp->decoded_content; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 0 | my $report; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 0 | local $@; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 0 | eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | $report = JSON::XS::decode_json($json); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 0 | ▶ | if (my $e = $@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | die {severity=>0, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | text=>sprintf "Failed to parse JSON for report guid[%s]: %s", $guid, $e}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 0 | ▶ | open my $fh, ">", $target or die {severity=>0,text=>"Could not open >$target: $!"}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | # The v3 report format keeps metadata in the JSON structure, but later | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | # when we're parsing the report, we expect to see the same NNTP/SMTP-style | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | # headers. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | # TODO: We should probably have this module use the JSON natively. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | printf $fh "From: %s <%s>\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | $report->{reporter}{name}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | $report->{reporter}{email}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 0 | ; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 0 | my $x = $OSNAME{ $report->{environment}{system}{osname} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 0 | ▶ | $x = $report->{environment}{system}{osname} unless defined $x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | printf $fh "Subject: %s %s-%s perl-%s %s\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | uc $report->{result}{grade}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | $report->{distribution}{name}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | $report->{distribution}{version}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | $report->{environment}{language}{version}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | 0 | $x, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | printf $fh "Date: %s\n\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | $report->{created}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 0 | ; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | # The v3 report format allows for separating output into phases | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | # (in order: configure, build, install, test), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | # though no client currently (2026-01-10) does so it all ends up | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | # in "uncategorized"... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 0 | print $fh grep defined, @{$report->{result}{output}}{qw(configure build install test uncategorized)}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 0 | close $fh; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 0 | ▶ | if ($Opt{verbose}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | 0 | my(@stat) = stat $target; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 0 | my $timestamp = gmtime $stat[9]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | 0 | ▶ | print STDERR "(timestamp $timestamp GMT)\n" unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 0 | ▶ | if ($Opt{verbose} > 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 0 | ▶ | print STDERR $resp->headers->as_string unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 0 | my $headers = "$target.headers"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | 0 | ▶ | open $fh, ">", $headers or die {severity=>1,text=>"Could not open >$headers: $!"}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | print $fh $resp->headers->as_string; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | die { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | severity => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | text => sprintf("HTTP Server Error[%s] for guid[%s]", $resp->status_line, $guid), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | uri => $uri, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | } elsif ($Opt{transport} eq "http_cpantesters_gzip") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 0 | my $mustfetch = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 0 | ▶ | if ($Opt{"prefer-local-reports"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | 0 | ▶ | unless (-e "$target.gz") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | 0 | $mustfetch = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | $mustfetch = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | ▶ | if ($mustfetch) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | # The API server returns a JSON structure containing both the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | # raw output and details parsed from that output. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | 0 | my $resp = _ua_gzip->get("$cturl/v3/report/$guid"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | 0 | ▶ | if ($resp->is_success) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | 0 | my $json = $resp->decoded_content; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 0 | my $report; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 0 | local $@; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | 0 | eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | 0 | $report = JSON::XS::decode_json($json); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | 0 | ▶ | if (my $e = $@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 0 | die {severity=>0, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | text=>sprintf "Failed to parse JSON for report guid[%s]: %s", $guid, $e}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 0 | ▶ | my $gz = Compress::Zlib::gzopen("$target.gz", "wb") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | or die {severity=>0,text=>"Could not open >$target.gz: $gzerrno"}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | # The v3 report format keeps metadata in the JSON structure, but later | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | # when we're parsing the report, we expect to see the same NNTP/SMTP-style | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | # headers. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | # TODO: We should probably have this module use the JSON natively. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | $gz->gzwrite(sprintf "From: %s <%s>\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | $report->{reporter}{name}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | $report->{reporter}{email}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | 0 | my $x = $OSNAME{ $report->{environment}{system}{osname} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 0 | ▶ | $x = $report->{environment}{system}{osname} unless defined $x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | $gz->gzwrite(sprintf "Subject: %s %s-%s perl-%s %s\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | uc $report->{result}{grade}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | $report->{distribution}{name}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | $report->{distribution}{version}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | $report->{environment}{language}{version}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | 0 | $x, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 0 | $gz->gzwrite(sprintf "Date: %s\n\n", $report->{created}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | # The v3 report format allows for separating output into phases | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | # (in order: configure, build, install, test), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | # though no client currently (2026-01-10) does so it all ends up | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | # in "uncategorized"... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | 0 | $gz->gzwrite(join "\n", grep defined, @{$report->{result}{output}}{qw(configure build install test uncategorized)}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | $gz->gzclose; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | 0 | ▶ | if ($Opt{verbose}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | 0 | my(@stat) = stat "$target.gz"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | 0 | my $timestamp = gmtime $stat[9]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 0 | ▶ | print STDERR "(timestamp $timestamp GMT)\n" unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | 0 | ▶ | if ($Opt{verbose} > 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 0 | ▶ | print STDERR $resp->headers->as_string unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 0 | my $headers = "$target.headers"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | 0 | ▶ | open my $fh, ">", $headers or die {severity=>1,text=>"Could not open >$headers: $!"}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | 0 | print $fh $resp->headers->as_string; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | 0 | die {severity=>0, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | text=>sprintf "HTTP Server Error[%s] for guid[%s]", $resp->status_line, $guid}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | 0 | die {severity=>1,text=>"Illegal value for --transport: '$Opt{transport}'"}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | 495 | parse_report($target, $dumpvars, %Opt); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | 5 | ▶ | sub parse_distro { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_distro: called CC=34 SCAR=45.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | 5 | my($distro,%Opt) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | 5 | my %dumpvars; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | 5 | ▶ | $Opt{cachedir} ||= "$ENV{HOME}/var/cpantesters"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$Opt{"cachedir"} ||= qq[$ENV{"HOME"}/var/cpantesters]
MC/DC0%0/1
$Opt{"cachedir"} ||= qq[$ENV{"HOME"}/var/cpantesters]
$Opt{"cachedir"}
Truth table50%1/2
A
A= $Opt{"cachedir"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | # the name cpantesters-show was picked because originally | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | # http://www.cpantesters.org/show/ contained html file that we had | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | # to parse. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | 5 | my $cts_dir = "$Opt{cachedir}/cpantesters-show"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | 5 | mkpath $cts_dir; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | 5 | ▶ | if ($Opt{solve}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | 1 | require Statistics::Regression; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | 1 | ▶ | $Opt{dumpvars} = "." unless defined $Opt{dumpvars}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | 5 | ▶ | if (!$Opt{vdistro} && $distro =~ /^(.+)-(?i:v?\d+)(?:\.\d+)*\w*$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $Opt{"vdistro"} and $distro =~ /^(.+)-(?i:v?\d+)(?:\.\d+)*\w*$/
MC/DC0%0/2
not $Opt{"vdistro"} and $distro =~ /^(.+)-(?i:v?\d+)(?:\.\d+)*\w*$/
not $Opt{"vdistro"}
$distro =~ /^(.+)-(?i:v?\d+)(?:\.\d+)*\w*$/
Truth table33%1/3
not(A) and B
A= not $Opt{"vdistro"}B= $distro =~ /^(.+)-(?i:v?\d+)(?:\.\d+)*\w*$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | 0 | $Opt{vdistro} = $distro; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | 0 | $distro = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | 5 | my $reports; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | 5 | ▶ | if (my $ctdb = $Opt{ctdb}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | 0 | require CPAN::WWW::Testers::Generator::Database; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | 0 | require CPAN::DistnameInfo; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | 0 | ▶ | my $dbi = CPAN::WWW::Testers::Generator::Database->new(database=>$ctdb) or die "Alert: unknown error while opening database '$ctdb'"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 0 | ▶ | unless ($Opt{vdistro}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | 0 | my $sql = "select version from cpanstats where dist=? order by id"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | 0 | my @rows = $dbi->get_query($sql,$distro); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | 0 | my($newest,%seen); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | 0 | for my $row (@rows) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | 0 | ▶ | $newest = $row->[0] unless $seen{$row->[0]}++; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | 0 | $Opt{vdistro} = "$distro-$newest"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | 0 | my $d = CPAN::DistnameInfo->new("FOO/$Opt{vdistro}.tgz"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | 0 | my $dist = $d->dist; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | 0 | my $version = $d->version; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | 0 | my $sql = "select guid from cpanstats where dist=? and version=? order by id desc"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | 0 | my @rows = $dbi->get_query($sql,$dist,$version); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | 0 | my @all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 0 | for my $row (@rows) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | 0 | push @all, { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | guid => $row->[0], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | 0 | $reports = \@all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | 5 | my $ctarget = _download_overview($cts_dir, $distro, %Opt); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | 5 | $reports = _parse_yaml($ctarget,%Opt); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | 5 | ▶ | return unless $reports; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | 5 | my $sampled = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | 5 | ▶ | my $samplesize = $Opt{sample} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$Opt{'sample'} || 0
MC/DC100%1/1
$Opt{'sample'} || 0
$Opt{'sample'}
Truth table100%2/2
A
A= $Opt{'sample'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | 5 | ▶ | $samplesize = 0 if $samplesize && $samplesize >= @$reports; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$samplesize and $samplesize >= @$reports
MC/DC100%2/2
$samplesize and $samplesize >= @$reports
$samplesize
$samplesize >= @$reports
Truth table100%3/3
A and B
A= $samplesizeB= $samplesize >= @$reports
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | REPEATER: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | 5 | my $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | 13 | my %taken; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | 13 | REPORT: for my $report (@$reports) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | 1286 | $i++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 1286 | ▶ | if ($samplesize) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | 896 | my $need = $samplesize - $sampled; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | 896 | ▶ | next REPORT unless $need; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | 785 | my $left = @$reports - $i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | # warn sprintf "tot %d i %d sampled %d need %d left %d\n", scalar @$reports, $i, $sampled, $need, $left; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | 785 | my $want_this = (rand(1) <= ($need/$left)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | 785 | ▶ | next REPORT unless $want_this; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | 495 | eval {parse_single_report($report, \%dumpvars, %Opt)}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | 495 | ▶ | if ($@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | 0 | ▶ | if (ref $@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | 0 | ▶ | if ($@->{severity}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | 0 | die $@->{text}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | 0 | my $j = JSON::XS->new->ascii->canonical; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | 0 | warn sprintf "%s (%s)", $@->{text}, $j->encode({%{$@}, line => __LINE__, file => __FILE__}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | 0 | die $@; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | 495 | $sampled++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | 495 | $taken{$i-1}=undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 495 | ▶ | last REPEATER if $Signal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | 13 | ▶ | if ($samplesize) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | 10 | PASSFAIL: for my $pf ("pass","fail") { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | 20 | ▶ | my $minx = $Opt{"min".$pf} or next PASSFAIL; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | 9 | my $x = $dumpvars{"meta:ok"}{uc $pf}{uc $pf}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | 9 | ▶ | if ($x < $minx) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | # bump samplesize, remove already sampled reports from array, redo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | 8 | my $bump = int($samplesize * 0.05)+1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | 8 | $samplesize += $bump; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | 8 | for my $k (sort {$b <=> $a} keys %taken) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | 61 | splice @$reports, $k, 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | 8 | redo REPEATER; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | 5 | ▶ | if ($Opt{dumpvars}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | 5 | ▶ | my $dumpfile = $Opt{dumpfile} || "ctgetreports.out"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$Opt{'dumpfile'} || 'ctgetreports.out'
MC/DC0%0/1
$Opt{'dumpfile'} || 'ctgetreports.out'
$Opt{'dumpfile'}
Truth table50%1/2
A
A= $Opt{'dumpfile'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | 5 | ▶ | open my $fh, ">", $dumpfile or die "Could not open '$dumpfile' for writing: $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | 5 | print $fh _yaml_dump(\%dumpvars); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | 5 | ▶ | close $fh or die "Could not close '$dumpfile': $!" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | 5 | ▶ | if ($Opt{solve}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | 1 | solve(\%dumpvars,%Opt); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | =head2 $bool = _looks_like_qp($raw_report) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | We had to acknowledge the fact that some MTAs swallow the MIME-Version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | header while passing MIME through. So we introduce fallback heuristics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | that try to determine if a report is written in quoted printable. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | Note that this subroutine is internal, just documented to have the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | internals documented. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | The current implementation counts the number of QP escaped spaces and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | equal signs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | 14 | ▶ | sub _looks_like_qp { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_looks_like_qp: called CC=4 SCAR=14.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | 14 | my($report) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | 14 | my $count_space = () = $report =~ /=20/g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | 14 | ▶ | return 1 if $count_space > 12; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | 13 | my $count_equal = () = $report =~ /=3D/g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | 13 | ▶ | return 1 if $count_equal > 12; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | 13 | ▶ | return 1 if $count_space+$count_equal > 24; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | 13 | return 0; # waiting for a counter example | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | =head2 $extract = parse_report($target,$dumpvars,%Opt) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | Reads one report. $target is the local filename to read (but see below | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | for option 'article'). $dumpvars is a hashref which gets filled with | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | descriptive stats about PASS/FAIL/etc. %Opt are the options as | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 630 | described in the C<ctgetreports> manpage. $extract is a hashref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 631 | containing the found variables. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 632 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 633 | Note: this parsing is a bit dirty but as it seems good enough I'm not | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 634 | inclined to change it. We parse HTML with regexps only, not an HTML | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | parser. Only the entities are decoded. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | In %Opt you can use | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | article => $some_full_article_as_scalar | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | to use this function to parse one full article as text. When this is | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | given, the argument $target is not read, but its basename is taken to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | be the guid of the article. (OMG, hackers!) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | 517 | ▶ | sub parse_report { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_report: called CC=163 SCAR=54.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 647 | 517 | my($target,$dumpvars,%Opt) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 648 | 517 | our @q; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 649 | 517 | my $guid = basename($target); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 650 | # warn "DEBUG: guid[$guid]"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 651 | 517 | my($ok,$about); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | 517 | my(%extract); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 655 | 517 | my($report,$isHTML) = _get_cooked_report($target, \%Opt); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 656 | 517 | my @qr = map /^qr:(.+)/, @{$Opt{q}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 657 | 517 | ▶ | if ($Opt{raw} || @qr) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$Opt{"raw"} or @qr
MC/DC50%1/2
$Opt{"raw"} or @qr
$Opt{"raw"}
@qr
Truth table66%2/3
A or B
A= $Opt{"raw"}B= @qr
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 658 | 131 | for my $qr (@qr) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | 131 | my $cqr = eval "qr{$qr}"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | 131 | ▶ | die "Could not compile regular expression '$qr': $@" if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | 131 | my(@matches) = $report =~ $cqr; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | 131 | my $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 663 | 131 | ▶ | if (@matches) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 664 | 2 | ▶ | if (@matches==1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 665 | 2 | $v = $matches[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 666 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 667 | 0 | $v = join "", map {"($_)"} @matches; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 668 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 669 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 670 | 129 | $v = ""; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 671 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 672 | 131 | $extract{"qr:$qr"} = $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 673 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 674 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 675 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 676 | 517 | my $report_writer; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 677 | 517 | my $moduleunpack = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 678 | 517 | my $expect_prereq = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 679 | 517 | my $expect_toolchain = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | 517 | my $expecting_toolchain_soon = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 681 | 517 | my $expect_module_versions_report = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 682 | 517 | my $expect_characteristics_libperl = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 683 | 517 | my $fallback_p5 = ""; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 684 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 685 | 517 | my $in_summary = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 686 | 517 | my $in_summary_seen_platform = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 687 | 517 | my $in_prg_output = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 688 | 517 | my $in_env_context = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 689 | 517 | my $in_test_summary = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 690 | 517 | my $in_characteristics = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 691 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 692 | 517 | my $current_headline; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 693 | 517 | my @previous_line = ""; # so we can neutralize line breaks | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 694 | 517 | my @rlines = split /\r?\n/, $report; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 695 | 517 | LINE: for (@rlines) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 696 | 3882 | ▶ | next LINE unless ($isHTML ? m/<title>((\S+)\s+(\S+))/ : m/^Subject:\s*((\S+)\s+(\S+))/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
$isHTML ? /<title>((\S+)\s+(\S+))/ : /^Subject:\s*((\S+)\s+(\S+))/ or /^Subject:\s*<strong>((\S+)\s+(\S+))/
MC/DC100%2/2
$isHTML ? /<title>((\S+)\s+(\S+))/ : /^Subject:\s*((\S+)\s+(\S+))/ or /^Subject:\s*<strong>((\S+)\s+(\S+))/
$isHTML ? /<title>((\S+)\s+(\S+))/ : /^Subject:\s*((\S+)\s+(\S+))/
/^Subject:\s*<strong>((\S+)\s+(\S+))/
Truth table100%3/3
A or B
A= $isHTML ? /<title>((\S+)\s+(\S+))/ : /^Subject:\s*((\S+)\s+(\S+))/B= /^Subject:\s*<strong>((\S+)\s+(\S+))/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 697 | || m{^Subject:\s*<strong>((\S+)\s+(\S+))}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 698 | 517 | my $s = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 699 | 517 | ▶ | $s = $1 if $s =~ m{<strong>(.+)}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 700 | 517 | ▶ | if ($s =~ /(\S+)\s+(\S+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 701 | 517 | $ok = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 702 | 517 | $about = $2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 703 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 704 | 517 | $extract{"meta:ok"} = $ok; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 705 | 517 | $extract{"meta:about"} = $about; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 706 | 517 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 707 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 708 | 517 | ▶ | unless ($extract{"meta:about"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 709 | 0 | $extract{"meta:about"} = $Opt{vdistro}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 710 | 0 | ▶ | unless ($extract{"meta:ok"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 711 | 0 | warn "Warning: could not determine state of report"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 712 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 713 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 714 | 517 | ▶ | LINE: while (@rlines) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 715 | 141965 | $_ = shift @rlines; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 716 | 141965 | ▶ | while (/!$/ and @rlines) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
/!$/ and @rlines
MC/DC50%1/2
/!$/ and @rlines
/!$/
@rlines
Truth table66%2/3
A and B
A= /!$/B= @rlines
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 717 | 345 | my $followupline = shift @rlines; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 718 | 345 | $followupline =~ s/^\s+//; # remo leading space | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 719 | 345 | $_ .= $followupline; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 720 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 721 | 141965 | ▶ | if (/^--------/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 722 | 4106 | ▶ | if ($previous_line[-2] && $previous_line[-2] =~ /^--------/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
$previous_line[-2] and $previous_line[-2] =~ /^--------/
MC/DC100%2/2
$previous_line[-2] and $previous_line[-2] =~ /^--------/
$previous_line[-2]
$previous_line[-2] =~ /^--------/
Truth table100%3/3
A and B
A= $previous_line[-2]B= $previous_line[-2] =~ /^--------/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 723 | 1933 | $current_headline = $previous_line[-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 724 | 1933 | ▶ | if ($current_headline =~ /PROGRAM OUTPUT/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 725 | 475 | $in_prg_output = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 726 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 727 | 1458 | $in_prg_output = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 728 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 729 | 1933 | ▶ | if ($current_headline =~ /ENVIRONMENT AND OTHER CONTEXT/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 730 | 512 | $in_env_context = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 731 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 732 | 1421 | $in_env_context = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 733 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 734 | ▶ | } elsif ($previous_line[-1] && $previous_line[-1] =~ /Test Summary Report/) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$previous_line[-1] and $previous_line[-1] =~ /Test Summary Report/
MC/DC100%2/2
$previous_line[-1] and $previous_line[-1] =~ /Test Summary Report/
$previous_line[-1]
$previous_line[-1] =~ /Test Summary Report/
Truth table100%3/3
A and B
A= $previous_line[-1]B= $previous_line[-1] =~ /Test Summary Report/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 735 | 176 | $in_test_summary = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 736 | 176 | $in_prg_output = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 737 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 738 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 739 | 141965 | ▶ | if ($extract{"meta:perl"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 740 | 60922 | ▶ | if ( $in_summary | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$in_summary and not $extract{"conf:git_commit_id"} and /Commit id:\s*([[:xdigit:]]+)/
$in_summary and not $extract{"conf:git_commit_id"}
MC/DC66%2/3
$in_summary and not $extract{"conf:git_commit_id"} and /Commit id:\s*([[:xdigit:]]+)/
$in_summary
not $extract{"conf:git_commit_id"}
/Commit id:\s*([[:xdigit:]]+)/
Truth table75%3/4
A and not(B) and C
A= $in_summaryB= not $extract{"conf:git_commit_id"}C= /Commit id:\s*([[:xdigit:]]+)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 741 | and !$extract{"conf:git_commit_id"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 742 | and /Commit id:\s*([[:xdigit:]]+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 743 | 2 | $extract{"conf:git_commit_id"} = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 744 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 745 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 746 | 81043 | my $p5; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 747 | 81043 | ▶ | if (0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 748 | 0 | } elsif (/Summary of my perl5 \((.+)\) configuration:/) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 749 | 516 | $p5 = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 750 | 516 | $in_summary = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 751 | 516 | $in_env_context = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 752 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 753 | 81043 | ▶ | if ($p5) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 754 | 516 | my($r,$v,$s,$p); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 755 | 516 | ▶ | if (($r,$v,$s,$p) = $p5 =~ /revision (\S+) version (\S+) subversion (\S+) patch (\S+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 756 | 293 | $r =~ s/\.0//; # 5.0 6 2! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 757 | 293 | $extract{"meta:perl"} = "$r.$v.$s\@$p"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 758 | } elsif (($r,$v,$s) = $p5 =~ /revision (\S+) version (\S+) subversion (\S+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 759 | 214 | $r =~ s/\.0//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 760 | 214 | $extract{"meta:perl"} = "$r.$v.$s"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 761 | } elsif (($r,$v,$s) = $p5 =~ /(\d+\S*) patchlevel (\S+) subversion (\S+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 762 | 9 | $r =~ s/\.0//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 763 | 9 | $extract{"meta:perl"} = "$r.$v.$s"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 764 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 765 | 0 | $extract{"meta:perl"} = $p5; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 766 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 767 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 768 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 769 | 141965 | ▶ | unless ($extract{"meta:from"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 770 | 17692 | ▶ | if (0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 771 | 0 | ▶ | } elsif ($isHTML ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
($isHTML ? m[<div class="h_name">From:</div> <b>(.+?)</b><br/>] : /^From:\s*(.+)/) || /^From:\s*(.+)/
MC/DC100%2/2
($isHTML ? m[<div class="h_name">From:</div> <b>(.+?)</b><br/>] : /^From:\s*(.+)/) || /^From:\s*(.+)/
($isHTML ? m[<div class="h_name">From:</div> <b>(.+?)</b><br/>] : /^From:\s*(.+)/)
/^From:\s*(.+)/
Truth table100%3/3
A || B
A= ($isHTML ? m[<div class="h_name">From:</div> <b>(.+?)</b><br/>] : /^From:\s*(.+)/)B= /^From:\s*(.+)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 772 | m|<div class="h_name">From:</div> <b>(.+?)</b><br/>| : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 773 | m|^From:\s*(.+)| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 774 | or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 775 | m|^From:\s*(.+)| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 776 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 777 | 517 | my $f = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 778 | 517 | ▶ | $f = $1 if $f =~ m{<strong>(.+)</strong>}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 779 | 517 | $extract{"meta:from"} = $f; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 780 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 781 | 17692 | ▶ | $extract{"meta:from"} =~ s/\.$// if $extract{"meta:from"}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 782 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 783 | 141965 | ▶ | unless ($extract{"meta:date"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 784 | 18079 | ▶ | if (0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 785 | 0 | ▶ | } elsif ($isHTML ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
($isHTML ? m[<div class="h_name">Date:</div> (.+?)<br/>] : /^Date:\s*(.+)/) || /^Date:\s*(.+)/
MC/DC100%2/2
($isHTML ? m[<div class="h_name">Date:</div> (.+?)<br/>] : /^Date:\s*(.+)/) || /^Date:\s*(.+)/
($isHTML ? m[<div class="h_name">Date:</div> (.+?)<br/>] : /^Date:\s*(.+)/)
/^Date:\s*(.+)/
Truth table100%3/3
A || B
A= ($isHTML ? m[<div class="h_name">Date:</div> (.+?)<br/>] : /^Date:\s*(.+)/)B= /^Date:\s*(.+)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 786 | m|<div class="h_name">Date:</div> (.+?)<br/>| : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 787 | m|^Date:\s*(.+)| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 788 | or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 789 | m|^Date:\s*(.+)| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 790 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 791 | 517 | my $date = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 792 | 517 | ▶ | $date = $1 if $date =~ m{<strong>(.+)</strong>}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 793 | 517 | my($dt); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 794 | 517 | DATEFMT: for my $pat ("%Y-%m-%dT%TZ", # 2010-07-07T14:01:40Z | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 795 | "%a, %d %b %Y %T %z", # Sun, 28 Sep 2008 12:23:12 +0100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 796 | "%b %d, %Y %R", # July 10,... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 797 | "%b %d, %Y %R", # July 4,... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 798 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 799 | 1521 | $dt = eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 800 | 1521 | my $p = DateTime::Format::Strptime->new | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 801 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 802 | locale => "en", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 803 | time_zone => "UTC", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 804 | pattern => $pat, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 805 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 806 | 1521 | $p->parse_datetime($date) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 807 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 808 | 1521 | ▶ | last DATEFMT if $dt; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 809 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 810 | 517 | ▶ | unless ($dt) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 811 | 0 | warn "Could not parse date[$date], setting to epoch 0"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 812 | 0 | $dt = DateTime->from_epoch( epoch => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 813 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 814 | 517 | $extract{"meta:date"} = $dt->datetime; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 815 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 816 | 18079 | ▶ | $extract{"meta:date"} =~ s/\.$// if $extract{"meta:date"}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 817 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 818 | 141965 | ▶ | unless ($extract{"meta:writer"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 819 | 25634 | for ("$previous_line[-1] $_") { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 820 | 25634 | ▶ | if (0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 821 | } elsif (/CPANPLUS, version (\S+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 822 | 10 | $extract{"meta:writer"} = "CPANPLUS $1"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 823 | } elsif (/created by (App::cpanminus::reporter \S+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 824 | 0 | $extract{"meta:writer"} = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 825 | } elsif (/created (?:automatically )?by (\S+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 826 | 472 | $extract{"meta:writer"} = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 827 | 472 | ▶ | if (/\s+on\s+perl\s+([^,]+),/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 828 | 472 | $fallback_p5 = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 829 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 830 | } elsif (/This report was machine-generated by (\S+) (\S+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 831 | 35 | $extract{"meta:writer"} = "$1 $2"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 832 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 833 | 25634 | ▶ | $extract{"meta:writer"} =~ s/[\.,]$// if $extract{"meta:writer"}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 834 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 835 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 836 | 141965 | ▶ | if ($in_summary) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 837 | # we do that first three lines a bit too often | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 838 | 61438 | ▶ | my $qr = $Opt{dumpvars} || ""; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$Opt{'dumpvars'} || ''
MC/DC100%1/1
$Opt{'dumpvars'} || ''
$Opt{'dumpvars'}
Truth table100%2/2
A
A= $Opt{'dumpvars'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 839 | 61438 | ▶ | $qr = qr/$qr/ if $qr; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 840 | 61438 | ▶ | unless (@q) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 841 | 2 | ▶ | @q = @{$Opt{q}||[]}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$Opt{'q'} || []
MC/DC0%0/1
$Opt{'q'} || []
$Opt{'q'}
Truth table50%1/2
A
A= $Opt{'q'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 842 | 2 | ▶ | @q = qw(meta:perl conf:archname conf:usethreads conf:optimize meta:writer meta:from) unless @q; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 843 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 844 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 845 | 61438 | my %conf_vars = map {($_ => 1)} grep { /^conf:/ } @q; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 846 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 847 | 61438 | ▶ | if (/^\s+Platform:$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 848 | 516 | $in_summary_seen_platform=1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 849 | ▶ | } elsif (/^\s*$/ || m|</pre>|) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
/^\s*$/ or m[</pre>]
MC/DC100%2/2
/^\s*$/ or m[</pre>]
/^\s*$/
m[</pre>]
Truth table100%3/3
A or B
A= /^\s*$/B= m[</pre>]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 850 | # if not html, we have reached the end now | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 851 | 23646 | ▶ | if ($in_characteristics) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 852 | 1 | $in_summary = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 853 | } elsif ($in_summary_seen_platform) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 854 | # some perls have an empty line after the summary line | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 855 | 23636 | $expect_characteristics_libperl = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 856 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 857 | } elsif ($in_characteristics) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 858 | 242 | ▶ | if (my($date) = /Compiled at (.+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 859 | 7 | $date =~ s/\s+\z//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 860 | # find: Apr 10 2013 16:59:47 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 861 | # want: 2016-07-05T11:03:04 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 862 | 7 | my($dt); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 863 | 7 | DATEFMT: for my $pat ("%b %d %Y %T") { # Sep 28 2008 12:23:12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 864 | 7 | $dt = eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 865 | 7 | my $p = DateTime::Format::Strptime->new | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 866 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 867 | locale => "en", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 868 | time_zone => "UTC", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 869 | pattern => $pat, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 870 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 871 | 7 | $p->parse_datetime($date) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 872 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 873 | 7 | ▶ | last DATEFMT if $dt; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 874 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 875 | 7 | ▶ | unless ($dt) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 876 | 0 | warn "Could not parse date[$date], setting to epoch 0"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 877 | 0 | $dt = DateTime->from_epoch( epoch => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 878 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 879 | 7 | $extract{"meta:perl_compiled_at"} = $dt->datetime; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 880 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 881 | ▶ | } elsif ($expect_characteristics_libperl && /Characteristics of this/) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$expect_characteristics_libperl and /Characteristics of this/
MC/DC100%2/2
$expect_characteristics_libperl and /Characteristics of this/
$expect_characteristics_libperl
/Characteristics of this/
Truth table100%3/3
A and B
A= $expect_characteristics_libperlB= /Characteristics of this/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 882 | 7 | $in_characteristics = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 883 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 884 | 37027 | my(%kv) = m!\G,?\s*([^=]+)= # left hand side and equal sign | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 885 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 886 | [^',\s]+(?=.+=) # use64bitint=define use64bitall=define uselongdouble=undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 887 | # (lookahead needed for left-over equal sign) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 888 | | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 889 | [^',]+$ # libpth=/usr/lib /usr/local/lib | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 890 | | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 891 | '[^']+?' # cccdlflags='-DPIC -fPIC' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 892 | | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 893 | \S+ # useshrplib=false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 894 | )!xgc; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 895 | 37027 | ▶ | while (my($k,$v) = each %kv) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 896 | 43197 | my $ck = "conf:$k"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 897 | 43197 | $ck =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 898 | 43197 | $v =~ s/,$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 899 | 43197 | ▶ | if ($v =~ /^'(.*)'$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 900 | 9209 | $v = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 901 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 902 | 43197 | $v =~ s/^\s+//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 903 | 43197 | $v =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 904 | 43197 | ▶ | if ($qr && $ck =~ $qr) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
$qr and $ck =~ /$qr/
MC/DC50%1/2
$qr and $ck =~ /$qr/
$qr
$ck =~ /$qr/
Truth table66%2/3
A and B
A= $qrB= $ck =~ /$qr/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 905 | 43079 | $extract{$ck} = $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 906 | } elsif ($conf_vars{$ck}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 907 | 4 | $extract{$ck} = $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 908 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 909 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 910 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 911 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 912 | 141965 | ▶ | if ($in_prg_output) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 913 | 11677 | ▶ | unless ($extract{"meta:output_from"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 914 | 1416 | ▶ | if (/Output from (.+):$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 915 | 472 | $extract{"meta:output_from"} = $1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 916 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 917 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 918 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 919 | # Parsing of Module::Versions::Report text in test output | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 920 | 11677 | ▶ | if (/Modules in memory:/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 921 | 1 | $expect_module_versions_report = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 922 | 1 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 923 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 924 | elsif ($expect_module_versions_report) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 925 | 8 | ▶ | if (/\s+(\S+)(?:\s+(v\d\S+?))?;/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 926 | 7 | ▶ | $extract{"mod:$1"} = defined $2 ? $2 : 'undef'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 927 | 7 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 928 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 929 | elsif (/\[at .+?\]/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 930 | # trailing timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 931 | 1 | $expect_module_versions_report = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 932 | 1 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 933 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 934 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 935 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 936 | 141956 | ▶ | if ($in_env_context) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 937 | 12025 | ▶ | if ($extract{"meta:writer"} =~ /^CPANPLUS\b/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$extract{"meta:writer"} =~ /^CPANPLUS\b/ or exists $extract{"env:PERL5_CPANPLUS_IS_VERSION"}
MC/DC100%2/2
$extract{"meta:writer"} =~ /^CPANPLUS\b/ or exists $extract{"env:PERL5_CPANPLUS_IS_VERSION"}
$extract{"meta:writer"} =~ /^CPANPLUS\b/
exists $extract{"env:PERL5_CPANPLUS_IS_VERSION"}
Truth table100%3/3
A or B
A= $extract{"meta:writer"} =~ /^CPANPLUS\b/B= exists $extract{"env:PERL5_CPANPLUS_IS_VERSION"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 938 | || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 939 | exists $extract{"env:PERL5_CPANPLUS_IS_VERSION"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 940 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 941 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 942 | 862 | ▶ | s/Perl:\s+\$\^X/\$^X/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
s/Perl:\s+\$\^X/\$^X/ or s/EUID:\s+\$>/\$EUID/ or s/UID:\s+\$</\$UID/ or s/EGID:\s+\$\)/\$EGID/
s/Perl:\s+\$\^X/\$^X/ or s/EUID:\s+\$>/\$EUID/ or s/UID:\s+\$</\$UID/
s/Perl:\s+\$\^X/\$^X/ or s/EUID:\s+\$>/\$EUID/
MC/DC100%4/4
s/Perl:\s+\$\^X/\$^X/ or s/EUID:\s+\$>/\$EUID/ or s/UID:\s+\$</\$UID/ or s/EGID:\s+\$\)/\$EGID/
s/Perl:\s+\$\^X/\$^X/
s/EUID:\s+\$>/\$EUID/
s/UID:\s+\$</\$UID/
s/EGID:\s+\$\)/\$EGID/
Truth table100%5/5
A or B or C or D
A= s/Perl:\s+\$\^X/\$^X/B= s/EUID:\s+\$>/\$EUID/C= s/UID:\s+\$</\$UID/D= s/EGID:\s+\$\)/\$EGID/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 943 | || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 944 | s/EUID:\s+\$>/\$EUID/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 945 | || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 946 | s/UID:\s+\$</\$UID/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 947 | || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 948 | s/EGID:\s+\$\)/\$EGID/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 949 | || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 950 | s/GID:\s+\$\(/\$GID/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 951 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 952 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 953 | 12025 | ▶ | if (my($left,$right) = /^\s{4}(\S+)\s*=\s*(.*)$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 954 | 7137 | ▶ | if ($left eq '$UID/$EUID') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 955 | 471 | my($uid,$euid) = split m{\s*/\s*}, $right; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 956 | 471 | $extract{'env:$UID'} = $uid; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 957 | 471 | $extract{'env:$EUID'} = $euid; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 958 | } elsif ($left =~ /GID/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 959 | 1024 | for my $xgid (uniq split " ", $right) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 960 | 3030 | $extract{"env:$left∋$xgid"} = "true"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 961 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 962 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 963 | 5642 | $extract{"env:$left"} = $right; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 964 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 965 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 966 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 967 | 141956 | ▶ | if ($in_test_summary) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 968 | 980 | ▶ | if (/^(?:Result:|Files=\d)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 969 | 176 | $in_test_summary = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 970 | } elsif (/^(\S+)\s+\(Wstat:.+?Tests:.+?Failed:\s*(\d+)\)$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 971 | 208 | my $in_test_summary_current_test = $1; # t/globtest.t or t\globtest.t | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 972 | 208 | my $in_test_summary_current_failed = $2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 973 | 208 | $in_test_summary_current_test =~ s|\\|/|g; # only t/globtest.t | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 974 | 208 | $extract{"fail:$in_test_summary_current_test"} = $in_test_summary_current_failed; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 975 | } elsif (/^\s+Failed tests?:/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 976 | # ignoring the exact combination of tests for now, seems like overkill | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 977 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 978 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 979 | 141956 | push @previous_line, $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 980 | 141956 | ▶ | if ($expect_prereq || $expect_toolchain) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$expect_prereq or $expect_toolchain
MC/DC100%2/2
$expect_prereq or $expect_toolchain
$expect_prereq
$expect_toolchain
Truth table100%3/3
A or B
A= $expect_prereqB= $expect_toolchain
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 981 | 14624 | ▶ | if (/Perl module toolchain versions installed/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 982 | # first time discovered in CPANPLUS 0.89_06 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 983 | 13 | $expecting_toolchain_soon = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 984 | 13 | $expect_prereq=0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 985 | 13 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 986 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 987 | 14611 | ▶ | if (exists $moduleunpack->{type}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 988 | 11048 | my($module,$v,$needwant); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 989 | # type 1 and 2 are about prereqs, type three about toolchain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 990 | 11048 | ▶ | if ($moduleunpack->{type} == 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 991 | 2366 | (my $leader,$module,$needwant,$v) = eval { unpack $moduleunpack->{tpl}, $_; }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 992 | 2366 | ▶ | next LINE if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 993 | 2366 | ▶ | if ($leader =~ /^-/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 994 | 465 | $moduleunpack = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 995 | 465 | $expect_prereq = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 996 | 465 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 997 | } elsif ($leader =~ /^( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 998 | buil # build_requires: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 999 | |conf # configure_requires: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1000 | )/x) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1001 | 5 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1002 | } elsif ($module =~ /^( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1003 | - # line drawing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1004 | )/x) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1005 | 470 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1006 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1007 | } elsif ($moduleunpack->{type} == 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1008 | 90 | (my $leader,$module,$v,$needwant) = eval { unpack $moduleunpack->{tpl}, $_; }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1009 | 90 | ▶ | next LINE if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1010 | 90 | for ($module,$v,$needwant) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1011 | 270 | s/^\s+//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1012 | 270 | s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1013 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1014 | 90 | ▶ | if ($leader =~ /^\*/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1015 | 0 | $moduleunpack = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1016 | 0 | $expect_prereq = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1017 | 0 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1018 | ▶ | } elsif (!defined $v | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%6/9
not defined $v && defined $needwant or $v =~ /\s/ or $needwant =~ /\s/
not defined $v && defined $needwant or $v =~ /\s/
defined $v && defined $needwant
MC/DC50%2/4
not defined $v && defined $needwant or $v =~ /\s/ or $needwant =~ /\s/
defined $v
defined $needwant
$v =~ /\s/
$needwant =~ /\s/
Truth table60%3/5
not(A && B) or C or D
A= defined $vB= defined $needwantC= $v =~ /\s/D= $needwant =~ /\s/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1019 | or !defined $needwant | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1020 | or $v =~ /\s/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1021 | or $needwant =~ /\s/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1022 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1023 | 4 | ($module,$v,$needwant) = split " ", $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1024 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1025 | } elsif ($moduleunpack->{type} == 3) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1026 | 8592 | (my $leader,$module,$v) = eval { unpack $moduleunpack->{tpl}, $_; }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1027 | 8592 | ▶ | next LINE if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1028 | 8592 | ▶ | if (!$module) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1029 | 478 | $moduleunpack = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1030 | 478 | $expect_toolchain = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1031 | 478 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1032 | } elsif ($module =~ /^-/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1033 | 471 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1034 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1035 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1036 | 9159 | $module =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1037 | 9159 | ▶ | if ($module) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1038 | 8671 | $v =~ s/^\s+//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1039 | 8671 | $v =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1040 | 8671 | my($modulename,$versionlead) = split " ", $module; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1041 | 8671 | ▶ | if (defined $modulename and defined $versionlead) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $modulename and defined $versionlead
MC/DC50%1/2
defined $modulename and defined $versionlead
defined $modulename
defined $versionlead
Truth table66%2/3
A and B
A= defined $modulenameB= defined $versionlead
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1042 | 26 | $module = $modulename; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1043 | 26 | $v = "$versionlead$v"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1044 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1045 | 8671 | ▶ | if ($v eq "Have") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1046 | 5 | next LINE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1047 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1048 | 8666 | $extract{"mod:$module"} = $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1049 | 8666 | ▶ | if (defined $needwant) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1050 | 1023 | $needwant =~ s/^\s+//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1051 | 1023 | $needwant =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1052 | 1023 | $extract{"prereq:$module"} = $needwant; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1053 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1054 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1055 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1056 | 12717 | ▶ | if (/(\s+)(Module\s+)(Need\s+)Have/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1057 | 465 | $in_env_context = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1058 | 465 | $moduleunpack = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1059 | tpl => 'a'.length($1).'a'.length($2).'a'.length($3).'a*', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1060 | type => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1061 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1062 | } elsif (/(\s+)(Module Name\s+)(Have)(\s+)Want/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1063 | 7 | $in_env_context = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1064 | 7 | my $adjust_1 = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1065 | 7 | my $adjust_2 = -length($4); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1066 | 7 | my $adjust_3 = length($4); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1067 | # I think they do not really try to align, usually we | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1068 | # get away with split | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1069 | 7 | $moduleunpack = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1070 | tpl => 'a'.length($1).'a'.(length($2)+$adjust_2).'a'.(length($3)+$adjust_3).'a*', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1071 | type => 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1072 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1073 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1074 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1075 | 140049 | ▶ | if (/PREREQUISITES|Prerequisite modules loaded/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1076 | 953 | $in_env_context = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1077 | 953 | $expect_prereq=1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1078 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1079 | 140049 | ▶ | if ($expecting_toolchain_soon) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1080 | 949 | ▶ | if (/(\s+)(Module(?:\sName)?\s+) Have/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1081 | 478 | $in_env_context = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1082 | 478 | $expect_toolchain=1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1083 | 478 | $expecting_toolchain_soon=0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1084 | 478 | $moduleunpack = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1085 | tpl => 'a'.length($1).'a'.length($2).'a*', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1086 | type => 3, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1087 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1088 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1089 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1090 | 140049 | ▶ | if (/toolchain versions installed/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1091 | 465 | $in_env_context = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1092 | 465 | $expecting_toolchain_soon=1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1093 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1094 | } # LINE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1095 | 517 | ▶ | if (! $extract{"mod:CPANPLUS"} && $extract{"meta:writer"} =~ /^CPANPLUS\s(\d+(\.\d+))$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not $extract{"mod:CPANPLUS"} and $extract{"meta:writer"} =~ /^CPANPLUS\s(\d+(\.\d+))$/
MC/DC100%2/2
not $extract{"mod:CPANPLUS"} and $extract{"meta:writer"} =~ /^CPANPLUS\s(\d+(\.\d+))$/
not $extract{"mod:CPANPLUS"}
$extract{"meta:writer"} =~ /^CPANPLUS\s(\d+(\.\d+))$/
Truth table100%3/3
not(A) and B
A= not $extract{"mod:CPANPLUS"}B= $extract{"meta:writer"} =~ /^CPANPLUS\s(\d+(\.\d+))$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1096 | 1 | $extract{"mod:CPANPLUS"} = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1097 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1098 | 517 | ▶ | if (! $extract{"meta:perl"} && $fallback_p5) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not $extract{"meta:perl"} and $fallback_p5
MC/DC50%1/2
not $extract{"meta:perl"} and $fallback_p5
not $extract{"meta:perl"}
$fallback_p5
Truth table66%2/3
not(A) and B
A= not $extract{"meta:perl"}B= $fallback_p5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1099 | 1 | my($p5,$patch) = split /\s+patch\s+/, $fallback_p5; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1100 | 1 | $extract{"meta:perl"} = $p5; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1101 | 1 | ▶ | $extract{"conf:git_describe"} = $patch if defined $patch; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1102 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1103 | 517 | $extract{guid} = $guid; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1104 | 517 | ▶ | if (my $filtercbbody = $Opt{filtercb}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1105 | 0 | my $filtercb = eval('sub {'.$filtercbbody.'}'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1106 | 0 | $filtercb->(\%extract); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1107 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1108 | 517 | ▶ | if ($Opt{solve}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1109 | 131 | ▶ | if ($extract{"conf:osvers"} && $extract{"conf:archname"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$extract{"conf:osvers"} and $extract{"conf:archname"}
MC/DC50%1/2
$extract{"conf:osvers"} and $extract{"conf:archname"}
$extract{"conf:osvers"}
$extract{"conf:archname"}
Truth table66%2/3
A and B
A= $extract{"conf:osvers"}B= $extract{"conf:archname"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1110 | 130 | $extract{"conf:archname+osvers"} = join " ", @extract{"conf:archname","conf:osvers"}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1112 | 131 | ▶ | if ($extract{"meta:perl"} && $extract{"conf:osname"}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$extract{"meta:perl"} and $extract{"conf:osname"}
MC/DC50%1/2
$extract{"meta:perl"} and $extract{"conf:osname"}
$extract{"meta:perl"}
$extract{"conf:osname"}
Truth table66%2/3
A and B
A= $extract{"meta:perl"}B= $extract{"conf:osname"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1113 | 130 | $extract{"meta:osname+perl"} = join " ", @extract{"conf:osname","meta:perl"}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1114 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1115 | 131 | ▶ | my $data = $dumpvars->{"==DATA=="} ||= []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$dumpvars->{"==DATA=="} ||= []
MC/DC100%1/1
$dumpvars->{"==DATA=="} ||= []
$dumpvars->{"==DATA=="}
Truth table100%2/2
A
A= $dumpvars->{"==DATA=="}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1116 | 131 | push @$data, \%extract; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1118 | # ---- %extract finished ---- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1119 | 517 | my $diag = ""; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1120 | 517 | ▶ | if (my $qr = $Opt{dumpvars}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1121 | 515 | $qr = qr/$qr/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1122 | 515 | ▶ | while (my($k,$v) = each %extract) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1123 | 65382 | ▶ | if ($k =~ $qr) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1124 | 65382 | $dumpvars->{$k}{$v}{$extract{"meta:ok"}}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1125 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1126 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1128 | 517 | for my $want (@q) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1129 | 3102 | ▶ | my $have = $extract{$want} || ""; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$extract{$want} || ''
MC/DC100%1/1
$extract{$want} || ''
$extract{$want}
Truth table100%2/2
A
A= $extract{$want}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1130 | 3102 | $diag .= " $want\[$have]"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1131 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1132 | 517 | binmode \*STDERR, ":encoding(UTF-8)"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1133 | 517 | ▶ | printf STDERR " %-4s %36s%s\n", $extract{"meta:ok"}, $guid, $diag unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1134 | 517 | ▶ | if ($Opt{raw}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1135 | 0 | $report =~ s/\s+\z//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1136 | 0 | ▶ | print STDERR $report, "\n================\n" unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1137 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1138 | 517 | ▶ | if ($Opt{interactive}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1139 | 0 | ▶ | eval { require IO::Prompt; 1; } or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1140 | die "Option '--interactive' requires IO::Prompt installed"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1141 | 0 | local @ARGV; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1142 | 0 | local $ARGV; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1143 | 0 | my $ans = IO::Prompt::prompt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1144 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1145 | -p => "View $guid? [onechar: ynq] ", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1146 | -d => "y", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1147 | -u => qr/[ynq]/, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1148 | -onechar, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1149 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1150 | 0 | ▶ | print STDERR "\n" unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1151 | 0 | ▶ | if ($ans eq "y") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1152 | 0 | my($report) = _get_cooked_report($target, \%Opt); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1153 | 0 | ▶ | $Opt{pager} ||= "less"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$Opt{"pager"} ||= "less"
MC/DC0%0/1
$Opt{"pager"} ||= "less"
$Opt{"pager"}
Truth table0%0/2
A
A= $Opt{"pager"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1154 | 0 | ▶ | open my $lfh, "|-", $Opt{pager} or die "Could not fork '$Opt{pager}': $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1155 | 0 | local $/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1156 | 0 | print {$lfh} $report; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1157 | 0 | ▶ | close $lfh or die "Could not close pager: $!" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1158 | } elsif ($ans eq "q") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1159 | 0 | $Signal++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1160 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1161 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1163 | 517 | return \%extract; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1164 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1166 | 517 | ▶ | sub _get_cooked_report { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_cooked_report: called CC=17 SCAR=29.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1167 | 517 | my($target, $Opt_ref) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1168 | 517 | my($report, $isHTML); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1169 | 517 | ▶ | if ($report = $Opt_ref->{article}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1170 | 1 | $isHTML = $report =~ /^</; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1171 | 1 | undef $target; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1172 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1173 | 517 | ▶ | if ($target) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1174 | 516 | local $/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1175 | 516 | my $raw_report; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1176 | 516 | ▶ | if (0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1177 | } elsif (-e $target) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1178 | 513 | ▶ | open my $fh, '<', $target or die "Could not open '$target': $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1179 | 513 | $raw_report = <$fh>; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1180 | } elsif (-e "$target.gz") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1181 | 3 | ▶ | open my $fh, "<", "$target.gz" or die "Could not open '$target.gz': $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1182 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1183 | # Opens a gzip (.gz) file for reading or writing. The mode parameter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1184 | # is as in fopen ("rb" or "wb") but can also include a compression level | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1185 | # ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1186 | # Huffman only compression as in "wb1h", or 'R' for run-length encoding | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1187 | # as in "wb1R". (See the description of deflateInit2 for more information | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1188 | # about the strategy parameter.) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1190 | 3 | my $gz = Compress::Zlib::gzopen($fh, "rb"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1191 | 3 | $raw_report = ""; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1192 | 3 | my $buffer; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1193 | 3 | ▶ | while (my $bytesread = $gz->gzread($buffer)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1194 | 23 | $raw_report .= $buffer; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1195 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1196 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1197 | 0 | die "Could not find '$target' or '$target.gz'"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1198 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1199 | 516 | $isHTML = $raw_report =~ /^</; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1200 | 516 | ▶ | if ($isHTML) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1201 | 500 | ▶ | if ($raw_report =~ m{^<\?.+?<html.+?<head.+?<body.+?<pre[^>]*>(.+)</pre>.*</body>.*</html>}s) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1202 | 5 | $raw_report = decode_entities($1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1203 | 5 | $isHTML = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1204 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1205 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1206 | 516 | ▶ | if ($isHTML) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1207 | 495 | $report = decode_entities($raw_report); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1208 | ▶ | } elsif ($raw_report =~ /^MIME-Version: 1.0$/m | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$raw_report =~ /^MIME-Version: 1.0$/m or _looks_like_qp($raw_report)
MC/DC100%2/2
$raw_report =~ /^MIME-Version: 1.0$/m or _looks_like_qp($raw_report)
$raw_report =~ /^MIME-Version: 1.0$/m
_looks_like_qp($raw_report)
Truth table100%3/3
A or B
A= $raw_report =~ /^MIME-Version: 1.0$/mB= _looks_like_qp($raw_report)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1209 | || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1210 | _looks_like_qp($raw_report) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1211 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1212 | # note(1): minimizing MIME effort; don't know about reports in other formats | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1213 | # note(2): Net-Generatus-0.40 had an offending report | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1214 | 8 | $report = eval { MIME::QuotedPrint::decode_qp($raw_report) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1215 | 8 | ▶ | if (!$report || $@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $report or $@
MC/DC0%0/2
not $report or $@
not $report
$@
Truth table33%1/3
not(A) or B
A= not $reportB= $@
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1216 | 0 | warn "WARNING: report '$target' could not be parsed as qp, giving up"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1217 | 0 | ▶ | if ($raw_report =~ /Subject:.+Dear.+Perl.+Summary/s) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1218 | 0 | $report = $raw_report; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1219 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1220 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1221 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1222 | 13 | $report = $raw_report; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1223 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1224 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1225 | 517 | ▶ | if ($report =~ /\r\n/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1226 | 1 | my @rlines = split /\r?\n/, $report; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1227 | 1 | $report = join "\n", @rlines; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1228 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1229 | 517 | ($report, $isHTML); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1230 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1231 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1232 | =head2 solve | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1233 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1234 | Feeds a couple of potentially interesting data to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1235 | Statistics::Regression and sorts the result by R^2 descending. Do not | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1236 | confuse this with a prove, rather take it as a useful hint. It can | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1237 | save you minutes of staring at data and provide a quick overview where | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1238 | one should look closer. Displays the N top candidates, where N | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1239 | defaults to 3 and can be set with the C<$Opt{solvetop}> variable. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1240 | Regressions results with an R^2 of 1.00 are displayed in any case. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1241 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1242 | The function is called when the option C<-solve> is given on the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1243 | commandline. Several extra config variables are calculated, see source | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1244 | code for details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1245 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1246 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1247 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1248 | 5 | my %never_solve_on = map {($_ => 1)} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1249 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1250 | 'conf:ccflags', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1251 | 'conf:config_args', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1252 | 'conf:cppflags', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1253 | 'conf:lddlflags', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1254 | 'conf:uname', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1255 | 'conf:osvers', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1256 | 'env:$^X', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1257 | 'env:PATH', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1258 | 'env:PERL', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1259 | 'env:PERL5LIB', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1260 | 'env:PERL5OPT', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1261 | 'env:PERL5_CPANPLUS_IS_RUNNING', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1262 | 'env:PERL5_CPAN_IS_RUNNING', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1263 | 'env:PERL5_CPAN_IS_RUNNING_IN_RECURSION', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1264 | 'env:PERL5_YACSMOKE_BASE', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1265 | 'env:PERLBREW_MANPATH', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1266 | 'env:PERLBREW_PATH', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1267 | 'env:PERLBREW_PERL', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1268 | 'env:PERL_CPAN_REPORTER_CONFIG', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1269 | 'env:PERL_CPAN_REPORTER_DIR', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1270 | 'meta:ok', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1271 | 'meta:perl_compiled_at', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1272 | 'guid', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1273 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1274 | 5 | my %normalize_numeric = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1275 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1276 | # here we were treating date as numeric; current | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1277 | # implementation requires to decide for one normalization, so | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1278 | # we decided 2012-02 for a sampling focussing on recentness; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1279 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1280 | #'meta:date' => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1281 | # my $v = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1282 | # my($Y,$M,$D,$h,$m,$s) = $v =~ /(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1283 | # unless (defined $M) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1284 | # die "illegal value[$v] for a date"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1285 | # } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1286 | # Time::Local::timegm($s,$m,$h,$D,$M-1,$Y); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1287 | #}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1288 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1289 | my %normalize_value = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1290 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1291 | 1357 | ▶ | 'meta:perl' => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1292 | 1357 | my($perlatpatchlevel) = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1293 | 1357 | my $perl = $perlatpatchlevel; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1294 | 1357 | $perl =~ s/\@.*//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1295 | 1357 | $perl; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1296 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1297 | 250 | ▶ | 'meta:date' => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=7 SCAR=31.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1298 | 250 | my $v = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1299 | 250 | my($Y,$M,$D,$h,$m,$s) = $v =~ /(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1300 | 250 | ▶ | unless (defined $M) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1301 | 0 | die "illegal value[$v] for a date"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1302 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1303 | 250 | my $epoch = Time::Local::timegm($s,$m,$h,$D,$M-1,$Y); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1304 | 250 | my $Y_epoch = time - 2*365.25*86400; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1305 | 250 | my $ret; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1306 | 250 | ▶ | if ($epoch < $Y_epoch) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1307 | 250 | $ret = $Y; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1308 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1309 | 0 | my @gmtime = gmtime $Y_epoch; $gmtime[5] += 1900; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1310 | 0 | ▶ | if ($Y == $gmtime[5]) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1311 | 0 | $ret = $Y; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1312 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1313 | 0 | my $M_epoch = time - 9*7*86400; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1314 | 0 | ▶ | if ($epoch < $M_epoch) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1315 | 0 | $ret = "$Y-$M"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1316 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1317 | 0 | my @gmtime = gmtime $M_epoch; $gmtime[5] += 1900; $gmtime[4]++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1318 | 0 | ▶ | if ($Y == $gmtime[5] && $M == $gmtime[4]) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$Y == $gmtime[5] and $M == $gmtime[4]
MC/DC0%0/2
$Y == $gmtime[5] and $M == $gmtime[4]
$Y == $gmtime[5]
$M == $gmtime[4]
Truth table0%0/3
A and B
A= $Y == $gmtime[5]B= $M == $gmtime[4]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1319 | 0 | $ret = "$Y-$M"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1320 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1321 | 0 | $ret = "$Y-$M-$D"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1322 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1323 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1324 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1325 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1326 | 250 | return $ret; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1327 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1328 | 5 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1329 | 1 | ▶ | sub solve { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
solve: called CC=40 SCAR=38.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1330 | 1 | my($V,%Opt) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1331 | 1 | require Statistics::Regression; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1332 | 1 | my @regression; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1333 | my $ycb; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1334 | 1 | ▶ | if (my $ycbbody = $Opt{ycb}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1335 | 0 | $ycb = eval('sub {'.$ycbbody.'}'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1336 | 0 | ▶ | die if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1337 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1338 | 41210 | ▶ | $ycb = sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1339 | 41210 | my $rec = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1340 | 41210 | my $y; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1341 | 41210 | ▶ | if ($rec->{"meta:ok"} eq "PASS") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1342 | 25043 | $y = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1343 | } elsif ($rec->{"meta:ok"} eq "FAIL") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1344 | 15533 | $y = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1345 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1346 | 41210 | return $y | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1347 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1348 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1349 | 1 | VAR: for my $variable (sort keys %$V) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1350 | 341 | ▶ | next if $variable eq "==DATA=="; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1351 | 340 | ▶ | if ($never_solve_on{$variable}){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1352 | 17 | ▶ | warn "Skipping '$variable'\n" unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1353 | 17 | next VAR; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1354 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1355 | 323 | my $value_distribution = $V->{$variable}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1356 | 323 | my $keys = keys %$value_distribution; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1357 | 323 | my @X = qw(const); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1358 | 323 | ▶ | if ($normalize_numeric{$variable}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1359 | 0 | push @X, "n_$variable"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1360 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1361 | 323 | my %seen = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1362 | 323 | for my $value (sort keys %$value_distribution) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1363 | 1038 | my $pf = $value_distribution->{$value}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1364 | 1038 | ▶ | $pf->{PASS} ||= 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$pf->{"PASS"} ||= 0
MC/DC100%1/1
$pf->{"PASS"} ||= 0
$pf->{"PASS"}
Truth table100%2/2
A
A= $pf->{"PASS"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1365 | 1038 | ▶ | $pf->{FAIL} ||= 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$pf->{"FAIL"} ||= 0
MC/DC100%1/1
$pf->{"FAIL"} ||= 0
$pf->{"FAIL"}
Truth table100%2/2
A
A= $pf->{"FAIL"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1366 | 1038 | ▶ | if ($pf->{PASS} || $pf->{FAIL}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$pf->{"PASS"} or $pf->{"FAIL"}
MC/DC100%2/2
$pf->{"PASS"} or $pf->{"FAIL"}
$pf->{"PASS"}
$pf->{"FAIL"}
Truth table100%3/3
A or B
A= $pf->{"PASS"}B= $pf->{"FAIL"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1367 | my $Xele = sprintf "eq_%s", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1368 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1369 | $normalize_value{$variable} ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1370 | 1025 | ▶ | $normalize_value{$variable}->($value) : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1371 | $value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1372 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1373 | 1025 | ▶ | push @X, $Xele unless $seen{$Xele}++; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1374 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1375 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1376 | 1038 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%4/4
$pf->{"PASS"} xor $pf->{"FAIL"}
MC/DC100%2/2
$pf->{"PASS"} xor $pf->{"FAIL"}
$pf->{"PASS"}
$pf->{"FAIL"}
Truth table100%4/4
A xor B
A= $pf->{"PASS"}B= $pf->{"FAIL"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1377 | $pf->{PASS} xor $pf->{FAIL} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1378 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1379 | 744 | my $vl = 40; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1380 | 744 | ▶ | substr($value,$vl) = "..." if length $value > 3+$vl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1381 | 744 | my $poor_mans_freehand_estimation = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1382 | 744 | ▶ | if ($poor_mans_freehand_estimation) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1383 | warn sprintf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1384 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1385 | "%4d %4d %-23s | %s\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1386 | $pf->{PASS}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1387 | $pf->{FAIL}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1388 | 0 | $variable, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1389 | $value, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1390 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1391 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1392 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1393 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1394 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1395 | 323 | ▶ | warn "variable[$variable]keys[$keys]X[@X]\n" unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1396 | 323 | ▶ | next VAR unless @X > 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1397 | 317 | my %regdata = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1398 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1399 | X => \@X, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1400 | data => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1401 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1402 | 317 | RECORD: for my $rec (@{$V->{"==DATA=="}}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1403 | 41210 | my $y = $ycb->($rec); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1404 | 41210 | ▶ | next RECORD unless defined $y; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1405 | 40576 | my %obs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1406 | 40576 | $obs{Y} = $y; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1407 | 40576 | @obs{@X} = (0) x @X; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1408 | 40576 | $obs{const} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1409 | 40576 | for my $x (@X) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1410 | 147712 | ▶ | if ($x =~ /^eq_(.+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1411 | 106240 | my $read_v = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1412 | 106240 | ▶ | if (exists $rec->{$variable} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $rec->{$variable} and defined $rec->{$variable}
MC/DC50%1/2
exists $rec->{$variable} and defined $rec->{$variable}
exists $rec->{$variable}
defined $rec->{$variable}
Truth table66%2/3
A and B
A= exists $rec->{$variable}B= defined $rec->{$variable}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1413 | && defined $rec->{$variable} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1414 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1415 | my $use_v = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1416 | $normalize_value{$variable} ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1417 | $normalize_value{$variable}->($rec->{$variable}) : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1418 | 74030 | ▶ | $rec->{$variable} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1419 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1420 | 74030 | ▶ | if ($use_v eq $read_v) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1421 | 14466 | $obs{$x} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1422 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1423 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1424 | # warn "DEBUG: y[$y]x[$x]obs[$obs{$x}]\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1425 | } elsif ($x =~ /^n_(.+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1426 | 0 | my $v = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1427 | 0 | $obs{$x} = eval { $normalize_numeric{$v}->($rec->{$v}); }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1428 | 0 | ▶ | if ($@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1429 | 0 | warn "Warning: error during parsing v[$v] in record[$rec->{guid}]: $@; continuing with undef value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1430 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1431 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1432 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1433 | 40576 | push @{$regdata{data}}, \%obs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1434 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1435 | 317 | my $start = Time::HiRes::time; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1436 | 317 | _run_regression ($variable, \%regdata, \@regression, \%Opt); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1437 | 317 | my $end = Time::HiRes::time; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1438 | warn sprintf "regressiontimings[%s]start[%s]end[%s]diff[%s]\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1439 | 317 | ▶ | $variable, $start, $end, $end-$start unless $Opt{quiet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1440 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1441 | 1 | ▶ | my $top = min ($Opt{solvetop} || 3, scalar @regression); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$Opt{'solvetop'} || 3
MC/DC0%0/1
$Opt{'solvetop'} || 3
$Opt{'solvetop'}
Truth table50%1/2
A
A= $Opt{'solvetop'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1442 | 1 | ▶ | my $max_rsq = sum map {1==$_->rsq ? 1 : 0} @regression; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1443 | 1 | ▶ | $top = $max_rsq if $max_rsq && $max_rsq > $top; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$max_rsq and $max_rsq > $top
MC/DC0%0/2
$max_rsq and $max_rsq > $top
$max_rsq
$max_rsq > $top
Truth table33%1/3
A and B
A= $max_rsqB= $max_rsq > $top
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1444 | 1 | my $score = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1445 | 1 | printf | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1446 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1447 | "State after regression testing: %d results, showing top %d\n\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1448 | scalar @regression, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1449 | $top, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1450 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1451 | 1 | for my $reg (sort { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1452 | 1969 | ▶ | $b->rsq <=> $a->rsq | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$b->rsq <=> $a->rsq || $a->k <=> $b->k
MC/DC100%2/2
$b->rsq <=> $a->rsq || $a->k <=> $b->k
$b->rsq <=> $a->rsq
$a->k <=> $b->k
Truth table100%3/3
A || B
A= $b->rsq <=> $a->rsqB= $a->k <=> $b->k
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1453 | || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1454 | $a->k <=> $b->k | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1455 | } @regression) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1456 | 3 | printf "(%d)\n", ++$score; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1457 | 3 | eval { $reg->print; }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1458 | 3 | ▶ | if ($@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1459 | 0 | printf "\n\nOops, Statistics::Regression died during ->print() with error message[$@]\n\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1460 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1461 | 3 | ▶ | last if --$top <= 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1462 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1463 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1464 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1465 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1466 | # $variable is the name we pass through to S:R constructor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1467 | # $regdata is hash and has the arrays "X" and "data" (observations) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1468 | # X goes to S:R constructor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1469 | # each observation has a Y which we pass to S:R in an include() call | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1470 | # $regression is the collector array of results | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1471 | # $opt are the options from outside, used to see if we are "verbose" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1472 | 5 | ▶ | sub _run_regression { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_run_regression: called CC=7 SCAR=19.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1473 | 317 | my($variable,$regdata,$regression,$opt) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1474 | 317 | my @X = @{$regdata->{X}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1475 | # my $splo = $regdata->{"spliced-out"} = []; # maybe can be used to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1476 | # hold the reference | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1477 | # group | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1478 | 317 | ▶ | while (@X > 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1479 | 362 | my $reg = Statistics::Regression->new($variable,\@X); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1480 | 362 | for my $obs (@{$regdata->{data}}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1481 | 46336 | my $y = delete $obs->{Y}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1482 | 46336 | $reg->include($y, $obs); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1483 | 46336 | $obs->{Y} = $y; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1484 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1485 | 362 | eval {$reg->theta; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1486 | 362 | my @e = $reg->standarderrors; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1487 | 303 | ▶ | die "found standarderrors == 0" if grep { 0 == $_ } @e; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1488 | 303 | $reg->rsq;}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1489 | 362 | ▶ | if ($@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1490 | 59 | ▶ | if ($opt->{verbose} && $opt->{verbose}>=2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$opt->{"verbose"} and $opt->{"verbose"} >= 2
MC/DC0%0/2
$opt->{"verbose"} and $opt->{"verbose"} >= 2
$opt->{"verbose"}
$opt->{"verbose"} >= 2
Truth table33%1/3
A and B
A= $opt->{"verbose"}B= $opt->{"verbose"} >= 2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1491 | warn _yaml_dump | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1492 | ({error=>"could not determine some regression parameters", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1493 | variable=>$variable, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1494 | k=>$reg->k, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1495 | n=>$reg->n, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1496 | 0 | X=>$regdata->{"X"}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1497 | errorstr => $@, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1498 | }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1499 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1500 | # reduce k in case that linear dependencies disturbed us; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1501 | # often called reference group; I'm tempted to collect and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1502 | # make visible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1503 | 59 | splice @X, 1, 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1504 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1505 | # $reg->print; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1506 | 303 | push @$regression, $reg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1507 | 303 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1508 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1509 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1510 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1511 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1512 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1513 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1514 | Andreas König | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1515 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1516 | =head1 BUGS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1517 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1518 | Please report any bugs or feature requests through the web | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1519 | interface at | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1520 | L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CPAN-Testers-ParseReport>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1521 | I will be notified, and then you'll automatically be notified of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1522 | progress on your bug as I make changes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1523 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1524 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1525 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1526 | You can find documentation for this module with the perldoc command. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1527 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1528 | perldoc CPAN::Testers::ParseReport | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1529 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1530 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1531 | You can also look for information at: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1532 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1533 | =over 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1534 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1535 | =item * RT: CPAN's request tracker | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1536 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1537 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=CPAN-Testers-ParseReport> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1538 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1539 | =item * AnnoCPAN: Annotated CPAN documentation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1540 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1541 | L<http://annocpan.org/dist/CPAN-Testers-ParseReport> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1542 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1543 | =item * CPAN Ratings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1544 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1545 | L<http://cpanratings.perl.org/d/CPAN-Testers-ParseReport> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1546 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1547 | =item * Search CPAN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1548 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1549 | L<http://search.cpan.org/dist/CPAN-Testers-ParseReport> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1550 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1551 | =back | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1552 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1553 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1554 | =head1 ACKNOWLEDGEMENTS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1555 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1556 | Thanks to RJBS for module-starter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1557 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1558 | =head1 COPYRIGHT & LICENSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1559 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1560 | Copyright 2008,2009,2010,2011,2012,2013,2014,2015,2016 Andreas König. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1561 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1562 | This program is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1563 | under the same terms as Perl itself. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1564 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1565 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1566 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1567 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1568 | 5 | 1; # End of CPAN::Testers::ParseReport | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||