Branch Coverage

blib/lib/Log/Agent/File/Rotate.pm
Criterion Covered Total %
branch 67 120 55.8


line true false branch
117 10 55 if (defined $fd and not $cf->is_alone)
119 0 8 if (not $st or $st->dev != $self->dev or $st->ino != $self->ino)
129 34 31 unless (defined $fd)
131 0 34 unless defined $fd
138 0 65 unless syswrite $fd, $str, length $str
145 65 0 if ($cf->max_size)
146 47 18 if ($cf->is_alone) { }
150 18 0 if ($st) { }
156 31 34 if ($self->size > $cf->max_size)
167 0 34 if ($cf->max_write)
169 0 0 if ($self->written > $cf->max_write)
179 0 34 if ($cf->max_time)
180 0 0 if (time - $self->opened > $cf->max_time)
202 0 34 if $DEBUG
204 0 34 unless (sysopen $fd, $path, $mode, $perm)
212 0 0 unless $self->warned->{$path}++
221 34 0 $st ? :
236 5 34 unless defined $fd
237 0 34 if $DEBUG
250 0 31 if $self->rotating
254 31 0 unless (@errors)
264 0 0 @errors == 1 ? :
268 0 0 if $DEBUG
293 0 31 unless defined $lock
302 0 31 unless $dir
305 0 31 unless (opendir DIR, $dir)
307 0 0 if defined $lock
326 0 31 if $DEBUG
329 310 110 unless substr($f, 0, length $lookfor) eq $lookfor
331 0 110 if $DEBUG
332 31 79 unless defined $idx
333 79 0 if $f =~ /^(.*)$/
334 8 71 if ($idx >= $unlink_at) { }
341 0 31 if ($DEBUG)
351 0 8 unless unlink "$dir/$f"
374 0 31 if $DEBUG
381 72 27 unless defined $logfiles[$i]
384 0 27 if $DEBUG
385 24 3 if ($old =~ /\.gz$/) { }
386 0 24 unless rename $old, $new
391 0 3 if defined $err
399 14 17 if ($gz_limit > 0 and defined $logfiles[$gz_limit - 1])
402 0 14 if $DEBUG
403 13 1 if (not $old =~ /\.gz$/) { }
405 0 13 if defined $err
408 0 1 unless rename $old, $new
418 9 30 unless defined $logfiles[$i]
421 0 30 if $DEBUG
422 4 26 if $old =~ /\.gz$/
423 0 30 unless rename $old, $new
439 31 0 if ($gz_limit) { }
440 0 31 unless rename $path, "$path.0"
444 0 0 if defined $err
451 31 0 if defined $lock
452 0 31 if @errors
468 0 16 unless (defined $st and CORE::open FILE, $old)
472 0 16 unless (defined $gz)
480 0 48 unless ($gz->gzwrite($_))
489 0 16 unless (unlink $old)
491 0 16 if defined $error