Branch Coverage

blib/lib/Linux/Bootloader.pm
Criterion Covered Total %
branch 45 182 24.7


line true false branch
128 0 1 if (defined $class and $class eq 'Linux::Bootloader')
130 0 0 unless (defined $detected_bootloader)
136 1 0 unless (defined $$self{'config_file'})
155 0 3 if $self->debug > 1
157 1 2 unless open CONFIG, "$config_file"
162 0 2 if $self->debug > 4
163 0 2 if $self->debug > 2
175 0 3 unless $self->_check_config
177 0 3 if $self->debug > 1
178 0 3 if $self->debug > 4
180 3 0 if (-w $config_file) { }
182 0 3 if ($? != 0) { }
189 0 3 unless open CONFIG, ">$config_file"
195 0 0 if $self->debug > 2
207 0 0 unless $self->_check_config
224 0 0 if ($_ =~ /^\s*(image|other)[\s+\=]+(\S+)/i)
229 0 0 if ($_ =~ /$matches{$key}/i)
231 0 0 if $key eq 'args'
237 0 0 if (not defined $sections[0]{'default'}) { }
0 0 elsif (not $sections[0]{'default'} =~ /^\d+$/) { }
243 0 0 if ($sections[$index]{'title'} eq $sections[0]{'default'})
251 0 0 unless ($sections[0]{'default'} =~ /^\d+$/)
265 0 3 if $self->debug > 1
266 0 3 unless $self->_check_config
270 3 0 if ($default =~ /^\d+$/)
283 0 0 if $self->debug > 1
285 0 0 unless defined $newdefault
286 0 0 unless $self->_check_config
292 0 0 unless ($newdefault =~ /^\d+$/)
297 0 0 if (not defined $newdefault or $newdefault < 0 or $newdefault > $kcount)
306 0 0 if ($config[$index] =~ /^\s*default/i)
321 0 0 if $self->debug > 1
323 0 0 if (not defined $param{'add-kernel'} and defined $param{'kernel'}) { }
0 0 elsif (not defined $param{'add-kernel'} && defined $param{'title'}) { }
0 0 elsif (not -f "$param{'add-kernel'}") { }
0 0 elsif (defined $param{'initrd'} and not -f "$param{'initrd'}") { }
336 0 0 unless $self->_check_config
340 0 0 if length $param{'title'} > 15
345 0 0 if (defined $self->_lookup($param{'title'}))
347 0 0 if (defined $param{'force'}) { }
362 0 0 unless (defined $param{$p})
368 0 0 unless ($sections[$default]{'kernel'} =~ m[^/boot])
370 0 0 if defined $param{'initrd'}
375 0 0 if defined $param{'args'}
376 0 0 if defined $param{'initrd'}
377 0 0 if defined $param{'root'}
380 0 0 unless (defined $param{'position'} and $param{'position'} =~ /end|\d+/)
385 0 0 if ($param{'position'} =~ /end/ or $param{'position'} >= $#sections) { }
388 0 0 if ($newconfig[$#newconfig] =~ /\S/)
395 0 0 if ($_ =~ /^\s*(image|other)/i)
396 0 0 if ($index == $param{'position'})
407 0 0 if (defined $param{'make-default'})
419 0 0 if $self->debug > 1
421 0 0 unless (defined $params{'update-kernel'} and defined $params{'args'} || defined $params{'remove-args'})
426 0 0 unless $self->_check_config
432 0 0 unless ($params{'update-kernel'} =~ /^\d+$/)
437 0 0 if (not $params{'update-kernel'} =~ /^\d+$/ or $params{'update-kernel'} < 0 or $params{'update-kernel'} > $kcount)
444 0 0 if ($_ =~ /^\s*(image|other)/i)
447 0 0 if ($index == $params{'update-kernel'})
448 0 0 if ($_ =~ /(^\s*append[\s\=]+)(.*)\n/i)
452 0 0 if defined $params{'remove-args'}
453 0 0 if defined $params{'args'}
454 0 0 if ($_ eq qq[$append"$args"\n]) { }
475 0 3 unless defined $position
476 0 3 unless $self->_check_config
481 0 3 if ($position =~ /^end$/i) { }
0 3 elsif ($position =~ /^start$/i) { }
487 0 3 if $self->debug > 1
490 1 2 if (not $position =~ /^\d+$/) { }
2 0 elsif ($position =~ /^\d+$/) { }
493 0 3 if (defined $sections[$index]{'title'} and $position eq $sections[$index]{'title'})
494 0 0 if $self->remove($index - 1)
497 1 0 if (not $removed)
505 1 1 if ($position < 0 or $position > $#sections)
512 3 16 if ($_ =~ /^\s*(image|other|title)/i)
516 15 4 if ($index != $position or $_ =~ /^#/)
524 1 0 if $position == $sections[0]{'default'}
543 0 3 unless defined $info
544 0 3 unless $self->_check_config
546 0 3 if $self->debug > 1
552 0 3 if ($info =~ /default/i) { }
0 3 elsif ($info =~ /all/i) { }
0 3 elsif ($info =~ /^\d+/) { }
563 0 0 if ($start < 0 or $end > $#sections - 1)
582 0 69 if (@_)
593 0 0 unless ($entry =~ /^\d+$/)
599 0 0 if (defined $sections[$index]{'title'}) { }
615 0 41 if $self->debug > 3
617 0 41 if ($#{$$self{'config'};} < 5)
631 0 4 unless (defined $title)
637 1 9 if (defined $tmp and $title eq $tmp)