Branch Coverage

blib/lib/System/Info/Linux.pm
Criterion Covered Total %
branch 96 140 68.5


line true false branch
26 0 134 unless $self->prepare_proc_cpuinfo
29 3 131 if (/arm/)
30 0 131 if (/aarch64/)
31 1 130 if (/ppc/)
32 0 130 if (/sparc/)
33 2 128 if (/s390x/)
48 0 544 unless open my $fh, "<", $file
50 12 2416 if /^\s*[;#]/
52 184 2232 unless /\S/
55 1738 494 if (my($k, $v) = /^\s*(.*\S)\s*=\s*(\S.*?)\s*$/)
57 12 1726 if defined $os->{$k}
60 39 1687 if $v =~ /^["(]?undef(?:ined)?[")]$/i
64 3 491 if /^[12][0-9]{3}(?:,\s*[12][0-9]{3})*(?:\s*,\s*)*$/
65 1 490 if /^[12][0-9]{3}(?:,\s*[12][0-9]{3})*.*All rights reserved/i
66 390 100 unless exists $os->{$_}
74 119 15 if $ENV{'SMOKE_USE_ETC'}
77 0 0 unless $os->{'DISTRIB_ID'} or $os->{'DISTRIB_RELEASE'} or $os->{'DISTRIB_CODENAME'}
80 15 0 unless open my $ch, "lsb_release -a 2>&1 |"
90 0 0 unless /^\s*(\S.*?)\s*:\s*(.*?)\s*$/
91 0 0 unless $2 eq "n/a"
99 721 404 if -f $_
100 22 952 if (-d $_) { }
109 134 410 unless (defined $distro or $df =~ /\blsb-/)
117 0 134 unless keys %os
121 390 1726 unless defined $os{$key}
122 99 1627 unless exists $os{$KEY}
125 28 106 if ($os{'DISTRIB_DESCRIPTION'}) { }
1 105 elsif ($os{'DISTRIBVER'} and defined $os{'NETBSD_OFFICIAL_RELEASE'}) { }
74 31 elsif ($os{'PRETTY_NAME'}) { }
0 31 elsif ($os{'VERSION'} and $os{'NAME'}) { }
1 30 elsif ($os{'VERSION'} and $os{'CODENAME'}) { }
11 19 elsif ($os{'MAJORVERSION'} and defined $os{'MINORVERSION'}) { }
2 17 elsif ($os{'DISTRIBVER'} and exists $os{'NETBSDSRCDIR'}) { }
127 24 4 if $os{'DISTRIB_CODENAME'} and not $distro =~ /\b$os{'DISTRIB_CODENAME'}\b/i
129 1 27 if ($os{'VERSION_ID'} and not $distro =~ /\b$os{'VERSION_ID'}\b/i) { }
0 27 elsif ($os{'DISTRIB_RELEASE'} and not $distro =~ /\b$os{'DISTRIB_RELEASE'}\b/i) { }
138 1 0 @k == 1 ? :
142 73 1 if (my $vid = $os{'VERSION_ID'})
144 14 59 if (@rv = grep(/^$vid\./, sort(keys %os)))
146 14 0 if $rv[0] =~ /^[0-9]+\.\w+$/
149 13 46 if (not @rv and defined $os{'NAME'} and @rv = grep(/^$os{'NAME'} (?:(?:release|version)\s+)?$vid\./, sort(keys %os)))
151 13 0 if ($rv[0] =~ /\s($vid\.[-.\w]+)/)
160 4 70 if $os{'VERSION_ID'} and not $distro =~ /\b$os{'VERSION_ID'}\b/i
167 1 0 if (my(@welcome) = grep(s/^\s*Welcome\s+to\s+(\S*$distro\S*)\b.*/$1/i, keys %os))
171 1 0 unless $distro =~ /\b$os{'CODENAME'}\b/
175 11 0 if -d "/usr/syno" or join($", @dist_file) =~ m[^\S*/VERSION$]
177 11 0 if $os{'BUILDNUMBER'}
178 7 4 if $os{'SMALLFIXNUMBER'}
223 3 14 if (my(@welcome) = grep(s/^\s*Welcome\s+to\s+//i, @key)) { }
12 2 elsif (my(@rel) = grep(/\brelease\b/i, @key)) { }
2 0 elsif (my(@lnx) = grep(/\bLinux\b/i, @key)) { }
0 0 elsif ($distro and @vsn) { }
227 1 0 if @rel > 1 and $rel[0] =~ /^Enterprise Linux Enterprise/ and $rel[1] =~ /^Oracle Linux/
246 134 0 if ($distro =~ s/^\s*(.*\S)\s*$/$1/)
287 0 128 unless (defined $info{$tags[0]})
291 128 0 if $info{$tags[2]}
293 128 0 if ($info{$tags[0]}) { }
303 127 1 if ($n_phys_id)
305 4 123 if $n_processor > $n_phys_id
308 0 1 if ($n_core_id)
310 0 0 if $n_processor > $n_core_id
318 0 0 unless my($tag, $count) = $cores =~ /^(.*\S)\s*:\s*(\d+)/
319 0 0 if ($tag eq 'core id') { }
328 0 1 if $n_cores > $n_cpu
357 3 0 if $mhz
388 1 0 if ($info{'detected'} = $self->from_cpuinfo("detected as"))
421 0 0 if $info{'Cpu0ClkTck'}
452 2 0 if $mhz
465 134 0 if (open my $pci, "<", "/proc/cpuinfo")
510 0 399 unless defined $first