Branch Coverage

blib/lib/System/CPU.pm
Criterion Covered Total %
branch 101 108 93.5


line true false branch
146 9 44 if $^O =~ /linux|android/i
147 7 37 if $^O =~ /bsd|darwin|dragonfly/i
148 6 31 if $^O =~ /osf|solaris|sunos|svr5|sco/i
149 10 21 if $^O =~ /aix/i
150 4 17 if $^O =~ /gnu/i
151 4 13 if $^O =~ /haiku/i
152 4 9 if $^O =~ /hp-?ux/i
153 4 5 if $^O =~ /irix/i
155 4 1 if $^O =~ /mswin|mingw|msys|cygwin/i
168 4 15 if ($^O =~ /linux|android/i) { }
4 11 elsif ($^O =~ /bsd|darwin|dragonfly/i) { }
1 10 elsif ($^O =~ /mswin|mingw|msys|cygwin/i) { }
2 8 elsif ($^O =~ /aix/i) { }
2 6 elsif ($^O =~ /irix/i) { }
2 4 elsif ($^O =~ /haiku/i) { }
2 2 elsif ($^O =~ /hp-?ux/i) { }
1 1 elsif ($^O =~ /osf|solaris|sunos|svr5|sco/i) { }
172 2 2 unless $name
177 1 1 if $out =~ /:\s*(.*)/
180 1 1 if @out and $out[0] =~ /CPU:\s*(.*)/i
183 2 0 if $out =~ /:\s*(?:")?(.*?)(?:")?\s*$/m
186 1 1 if ($out =~ /processor model:\s*\d*\s*(.+?)$/im) { }
1 0 elsif ($out =~ /\s*\d*\s*(.+(?:MHz|GHz).+)$/m) { }
193 1 0 if $out =~ /:brand\s*(.*)$/m
198 17 1 unless ($opt{'raw'})
199 12 5 if $name
200 12 5 if $name
207 3 4 if $^O =~ /linux|android|bsd|darwin|dragonfly|gnu|osf|solaris|sunos|svr5|sco|hp-?ux/i
208 1 3 if $^O =~ /aix|irix/i
209 1 2 if $^O =~ /haiku/i
210 1 1 if $^O =~ /mswin|mingw|msys|cygwin/i
217 0 6 if (-x '/usr/sbin/psrinfo') { }
219 0 0 if $count
222 2 4 if @output
229 5 2 $prof ? :
230 2 5 if $prof and $prof =~ /Number of (?:Processors|CPUs): (\d+)/i
232 4 3 unless $cpus
233 2 5 unless $cpus
247 4 6 if (@output)
249 2 2 if $1
251 8 2 unless ($ncpu)
253 4 4 if (@output) { }
257 2 2 if @output
266 2 2 if @output
278 2 2 if @out
285 2 2 if @output
291 10 3 if (-f "/proc/cpuinfo" and open my $fh, "<", "/proc/cpuinfo")
293 50 923 if /^processor\s*:/i
294 41 932 if /^physical id\s*:\s*(\d+)/i
295 45 928 if /^cpu cores\s*:\s*(\d+)/i
296 33 940 if /^model name\s*:\s*(.*)/i
298 2 8 if not @physical and @cores
299 3 5 unless @cores
302 41 0 $_ < scalar @cores ? :