Branch Coverage

blib/lib/System/Info/Linux.pm
Criterion Covered Total %
branch 91 134 67.9


line true false branch
26 0 118 unless $self->prepare_proc_cpuinfo
29 3 115 if (/arm/)
30 0 115 if (/aarch64/)
31 1 114 if (/ppc/)
32 0 114 if (/sparc/)
33 2 112 if (/s390x/)
48 0 475 unless open my $fh, "<", $file
50 12 1973 if /^\s*[;#]/
52 162 1811 unless /\S/
55 1385 426 if (my($k, $v) = /^(.*\S)\s*=\s*(\S.*)$/)
57 8 1377 if defined $os->{$k}
59 31 1346 if $v =~ /^["(]?undef(?:ined)?[")]$/i
63 2 424 if /^[12][0-9]{3}(?:,\s*[12][0-9]{3})*$/
64 336 88 unless exists $os->{$_}
72 103 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 624 355 if -f $_
98 17 835 -d $_ ? :
107 118 357 unless (defined $distro or $df =~ /\blsb-/)
115 0 118 unless keys %os
119 336 1377 unless defined $os{$key}
120 99 1278 unless exists $os{$KEY}
123 27 91 if ($os{'DISTRIB_DESCRIPTION'}) { }
60 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'}) { }
125 24 3 if $os{'DISTRIB_CODENAME'} and not $distro =~ /\b$os{'DISTRIB_CODENAME'}\b/i
127 1 26 if ($os{'VERSION_ID'} and not $distro =~ /\b$os{'VERSION_ID'}\b/i) { }
0 26 elsif ($os{'DISTRIB_RELEASE'} and not $distro =~ /\b$os{'DISTRIB_RELEASE'}\b/i) { }
136 59 1 if (my $vid = $os{'VERSION_ID'})
138 11 48 if (@rv = grep(/^$vid\./, sort(keys %os)))
140 11 0 if $rv[0] =~ /^[0-9]+\.\w+$/
143 13 35 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 57 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 11 0 if -d "/usr/syno" or join($", @dist_file) =~ m[^\S*/VERSION$]
171 11 0 if $os{'BUILDNUMBER'}
172 7 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 118 0 if ($distro =~ s/^\s*(.*\S)\s*$/$1/)
281 0 112 unless (defined $info{$tags[0]})
285 112 0 if $info{$tags[2]}
287 112 0 if ($info{$tags[0]}) { }
297 111 1 if ($n_phys_id)
299 4 107 if $n_processor > $n_phys_id
302 0 1 if ($n_core_id)
304 0 0 if $n_processor > $n_core_id
312 0 0 unless my($tag, $count) = $cores =~ /^(.*\S)\s*:\s*(\d+)/
313 0 0 if ($tag eq 'core id') { }
322 0 1 if $n_cores > $n_cpu
351 3 0 if $mhz
382 1 0 if ($info{'detected'} = $self->from_cpuinfo("detected as"))
415 0 0 if $info{'Cpu0ClkTck'}
446 2 0 if $mhz
459 118 0 if (open my $pci, "<", "/proc/cpuinfo")
504 0 351 unless defined $first