Branch Coverage

blib/lib/Test/Collectd/Plugins.pm
Criterion Covered Total %
branch 43 74 58.1


line true false branch
35 0 4 @$list == 1 ? :
37 0 4 unless ref $args and ref $args eq 'HASH'
40 0 0 if (/^typesdb$/i) { }
101 0 22 unless my $plugin = shift()
103 4 18 if (defined $init) { }
108 0 4 if ($@) { }
116 0 4 unless my $plugin = shift()
118 4 0 if (defined $reader) { }
129 4 4 if (exists $Test::Collectd::Plugins::FakeCollectd{$plugin}{'Values'})
136 0 4 unless my $plugin = shift()
137 4 0 if (exists $Test::Collectd::Plugins::FakeCollectd{$plugin}{'Values'}) { }
145 0 4 unless my $plugin = shift()
146 0 4 unless my $cfg = shift()
149 0 4 unless ($cb)
153 0 4 unless my $config = Test::Collectd::Config::parse($cfg)
156 0 4 if ($@) { }
189 0 4 unless $tb->ok(&_load_module($module), 'load plugin module')
190 0 4 unless $tb->ok(&_reset_values($module), 'reset values')
191 0 4 if $@
192 0 4 unless $tb->ok(&_read($plugin), 'read plugin')
194 0 4 unless $tb->ok(@values, 'read callback returned some values')
214 0 15 unless $tb->ok(exists $dispatch{$_}, "mandatory key '${_}' exists")
251 25 0 if (exists $dispatch{$_})
254 25 0 if $dispatch{$_}
263 5 5 if (exists $dispatch{$_})
273 15 0 if (exists $dispatch{$_})
283 10 0 if (exists $dispatch{$_})
312 0 2 unless $tb->ok(&_config($plugin, $config), 'config ok')
346 2 16 if ($config)
360 14 4 unless $reader
363 0 4 if $@
364 4 0 if (exists $Test::Collectd::Plugins::FakeCollectd{$plugin}{'Values'}) { }
373 3 2 if ($typesdb) { }
375 0 3 if ($ref eq 'HASH') { }
0 3 elsif ($ref eq '') { }
388 0 5 unless ($fh)
394 5 372 if ($t eq $type)