Branch Coverage

blib/lib/System/Info/Linux.pm
Criterion Covered Total %
branch 88 128 68.7


line true false branch
26 0 114 unless $self->prepare_proc_cpuinfo
29 3 111 if (/arm/)
30 0 111 if (/aarch64/)
31 1 110 if (/ppc/)
32 0 110 if (/sparc/)
33 2 108 if (/s390x/)
48 0 458 unless open my $fh, "<", $file
50 12 1899 if /^\s*[;#]/
52 159 1740 unless /\S/
55 1327 413 if (my($k, $v) = /^(.*\S)\s*=\s*(\S.*)$/)
57 8 1319 if defined $os->{$k}
59 31 1288 if $v =~ /^["(]?undef(?:ined)?[")]$/i
63 2 411 if /^[12][0-9]{3}(?:,\s*[12][0-9]{3})*$/
64 326 85 unless exists $os->{$_}
72 99 15 if $ENV{'SMOKE_USE_ETC'}
75 0 0 unless $os->{'DISTRIB_ID'} or $os->{'DISTRIB_RELEASE'} or $os->{'DISTRIB_CODENAME'}
78 15 0 unless open my $ch, "lsb_release -a 2>&1 |"
88 0 0 unless /^\s*(\S.*?)\s*:\s*(.*?)\s*$/
89 0 0 unless $2 eq "n/a"
97 607 343 if -f $_
98 17 806 -d $_ ? :
107 114 344 unless (defined $distro or $df =~ /\blsb-/)
115 0 114 unless keys %os
119 326 1319 unless defined $os{$key}
120 85 1234 unless exists $os{$KEY}
123 26 88 if ($os{'DISTRIB_DESCRIPTION'}) { }
58 30 elsif ($os{'PRETTY_NAME'}) { }
0 30 elsif ($os{'VERSION'} and $os{'NAME'}) { }
1 29 elsif ($os{'VERSION'} and $os{'CODENAME'}) { }
10 19 elsif ($os{'MAJORVERSION'} and defined $os{'MINORVERSION'}) { }
2 17 elsif ($os{'DISTRIBVER'} and exists $os{'NETBSDSRCDIR'}) { }
125 23 3 if $os{'DISTRIB_CODENAME'} and not $distro =~ /\b$os{'DISTRIB_CODENAME'}\b/i
127 1 25 if ($os{'VERSION_ID'} and not $distro =~ /\b$os{'VERSION_ID'}\b/i) { }
0 25 elsif ($os{'DISTRIB_RELEASE'} and not $distro =~ /\b$os{'DISTRIB_RELEASE'}\b/i) { }
136 57 1 if (my $vid = $os{'VERSION_ID'})
138 10 47 if (@rv = grep(/^$vid\./, sort(keys %os)))
140 10 0 if $rv[0] =~ /^[0-9]+\.\w+$/
143 13 34 if (not @rv and defined $os{'NAME'} and @rv = grep(/^$os{'NAME'} (?:(?:release|version)\s+)?$vid\./, sort(keys %os)))
145 13 0 if ($rv[0] =~ /\s($vid\.[-.\w]+)/)
154 3 55 if $os{'VERSION_ID'} and not $distro =~ /\b$os{'VERSION_ID'}\b/i
161 1 0 if (my(@welcome) = grep(s/^\s*Welcome\s+to\s+(\S*$distro\S*)\b.*/$1/i, keys %os))
165 1 0 unless $distro =~ /\b$os{'CODENAME'}\b/
169 10 0 if -d "/usr/syno" or join($", @dist_file) =~ m[^\S*/VERSION$]
171 10 0 if $os{'BUILDNUMBER'}
172 6 4 if $os{'SMALLFIXNUMBER'}
217 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) { }
221 1 0 if @rel > 1 and $rel[0] =~ /^Enterprise Linux Enterprise/ and $rel[1] =~ /^Oracle Linux/
240 114 0 if ($distro =~ s/^\s*(.*\S)\s*$/$1/)
283 107 1 if ($n_phys_id)
285 4 103 if $n_processor > $n_phys_id
288 0 1 if ($n_core_id)
290 0 0 if $n_processor > $n_core_id
298 0 0 unless my($tag, $count) = $cores =~ /^(.*\S)\s*:\s*(\d+)/
299 0 0 if ($tag eq 'core id') { }
308 0 1 if $n_cores > $n_cpu
337 3 0 if $mhz
368 1 0 if ($info{'detected'} = $self->from_cpuinfo("detected as"))
401 0 0 if $info{'Cpu0ClkTck'}
432 2 0 if $mhz
445 114 0 if (open my $pci, "<", "/proc/cpuinfo")
490 0 339 unless defined $first