Branch Coverage

blib/lib/App/Device/Chip/sensor.pm
Criterion Covered Total %
branch 18 24 75.0


line true false branch
157 1 0 if ($opts =~ s/^-C:(.*?)=(.*)(?:$|,)//u) { }
167 0 8 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; } else { croak("Unable to parse chip configuration options '${opts}' for ${chiptype}'"); } ; } ; push @_CHIPCONFIGS, $config; } )
185 5 4 if $_chips
198 0 4 if ($chipconfig->{'config'})
204 1 3 if ($chip->can("initialize_sensors"))
232 1 4 if $_sensors
297 3 5 if ($_mid3)
302 0 3 unless $sensor->type eq "gauge"
310 1 2 if (@$readings == 3 and &all(sub { ; } , @$readings))
343 0 2 if defined $units
346 0 2 if (not defined $value) { }
1 1 elsif ($sensor->type eq 'gauge') { }