Branch Coverage

blib/lib/App/Device/Chip/sensor.pm
Criterion Covered Total %
branch 28 40 70.0


line true false branch
173 1 0 if ($opts =~ s/^-C:(.*?)=(.*)(?:$|,)//u) { }
0 0 elsif ($opts =~ s/^-M:(.*?)=(.*)(?:$|,)//u) { }
186 0 11 unless &GetOptionsFromArray($argv, %optspec, "adapter|A=s", sub { $ADAPTERDESC = $_[1]; undef $adapter; } , "<>", sub { my($chiptype, $opts) = split(/:/u, $_[0], 2); $adapter //= "Device::Chip::Adapter"->new_from_description($ADAPTERDESC); my(%config) = ("type", $chiptype, "adapter", $adapter); while (length $opts) { if ($opts =~ s/^-C:(.*?)=(.*)(?:$|,)//u) { $config{'config'}{$1} = $2; } elsif ($opts =~ s/^-M:(.*?)=(.*)(?:$|,)//u) { $config{'mountopts'}{$1} = $2; } else { croak("Unable to parse chip configuration options '${opts}' for ${chiptype}'"); } ; } ; $self->add_chip(%config); } )
245 9 7 if $_chips
258 0 7 if $chipconfig->{'mountopts'}
262 0 7 if ($chipconfig->{'config'})
268 1 6 if ($chip->can("initialize_sensors"))
296 2 7 if $_sensors
338 8 0 if $chips[0]
388 1 6 if $sensor->type ne "gauge"
390 3 3 if (not length $_filter or $_filter eq 'null') { }
2 1 elsif ($_filter =~ /^mid(\d+)$/u) { }
1 0 elsif ($_filter =~ /^ravg(\d+)$/u) { }
415 0 2 unless defined $value
419 2 0 $filter ? :
433 0 2 if defined $units
436 0 2 if (not defined $value) { }
1 1 elsif ($sensor->type eq 'gauge') { }
601 6 6 unless @readings == $n and &all(sub { defined $_; } , @readings)
623 1 3 unless defined $prev