Branch Coverage

lib/Slaughter/Info/linux.pm
Criterion Covered Total %
branch 38 64 59.3


line true false branch
112 1 0 if (-e '/etc/hostname') { }
114 0 1 unless open my $file, '<', '/etc/hostname'
132 0 0 unless ($$ref{'fqdn'} =~ /\./)
143 0 1 if ($$ref{'fqdn'} =~ /^([^.]+)\.(.*)$/) { }
166 0 1 if -d '/proc/xen/capabilities'
171 1 0 if (open my $cpu, '<', '/proc/cpuinfo')
178 16 400 if $line =~ /model/ and $line =~ /qemu/i
180 16 400 if ($line =~ /model name\s+: (.*)$/)
184 16 400 if ($line =~ /processor\s+: (\d+)/)
186 16 0 if $$ref{'cpu_count'} < $1
188 16 400 if ($line =~ /flags\s+:(.*)/)
191 16 0 if ($flags =~ /lm/) { }
213 0 1 unless ($$ref{'arch'})
216 0 0 if ($type =~ /64-bit/i) { }
232 0 1 if (-e '/proc/mdstat' and -x '/sbin/mdadm')
235 0 0 if (open my $mdstat, '<', '/proc/mdstat')
239 0 0 if ($line =~ /^md([0-9]+)/ and $line =~ /active/i)
254 1 0 if (open my $mem, '<', '/proc/meminfo')
259 1 41 if ($line =~ /MemTotal:\s+(\d+) kB/)
263 1 41 if ($line =~ /MemFree:\s+(\d+) kB/)
284 1 0 if -x '/sbin/ip'
285 1 0 if -x '/bin/ip'
288 1 0 if (defined $ip)
305 1 1 if $cmd =~ /inet6/i
309 0 1 unless defined $line and length $line
321 1 0 if ($line =~ /(inet|inet6)[ \t]+([^ \t+]+)[ \t]+/)
339 2 0 if ($count > 0)
352 1 0 if (-x '/usr/bin/lsb_release')
358 1 3 if ($line =~ /Distributor ID:\s*(.*)/)
362 1 3 if ($line =~ /Release:\s*(.*)/)
366 1 3 if ($line =~ /Codename:\s*(.*)/)
390 1 0 if ($uptime =~ /load average:[ \t]*(.*)/)