Branch Coverage

blib/lib/Test/Valgrind/Session.pm
Criterion Covered Total %
branch 68 118 57.6


line true false branch
113 9 7 if (defined $vg and not ref $vg) { }
116 1 6 if defined $vg and ref $vg eq 'ARRAY'
118 5 2 unless defined $dirs
120 7 0 if defined $Config::Config{'exe_ext'}
121 7 0 if ref $dirs eq 'ARRAY'
124 1 15 unless @paths
127 8 7 if (defined $min_version)
133 36 10 unless defined $path and 'MM'->maybe_command($path)
139 10 0 if (defined $ver)
140 2 8 if defined $min_version and $ver < $min_version
146 7 8 unless defined $valgrind
150 8 0 unless $extra_supps and ref $extra_supps eq 'ARRAY'
151 0 0 if defined $_ and -f $_
213 0 6 unless $_[0]{'extra_supps'}
235 0 18 unless &Scalar::Util::blessed($value) and $value->isa($base)
241 0 6 if ($cmd->isa('Test::Valgrind::Command::Aggregate'))
256 0 6 if ($self->do_suppressions) { }
259 0 6 unless ($self->no_def_supp)
262 0 0 if ($self->regen_def_supp and -e $def_supp)
266 0 0 if (defined $def_supp and not -e $def_supp)
267 0 0 $forced ? :
276 0 0 unless -e $def_supp
283 0 0 if -e $_
285 0 6 if (@supp_files > 1) { }
0 6 elsif (@supp_files) { }
4 2 elsif ($self->allow_no_supp) { }
307 0 4 unless pipe my $vrdr, my $vwtr
314 0 4 unless pipe my $erdr, my $ewtr
322 0 4 unless defined $pid
324 2 2 if ($pid == 0)
330 0 2 unless close $erdr
334 0 2 unless close $vrdr
336 0 2 unless fcntl $vwtr, 2, 0
366 0 2 unless close $vwtr
367 0 2 unless close $ewtr
374 1 3 if @ready == 1 and fileno $ready[0] == fileno $vrdr
378 0 3 if (not defined $bytes_read) { }
1 2 elsif ($bytes_read) { }
381 1 0 unless $child_err
385 1 1 if $child_err
392 0 1 if ($aborted)
398 1 1 unless (eval { do { local $SIG{'INT'} = sub { die 'valgrind analysis was interrupted'; } ; $self->_croak("close(\$vwtr): $!") unless close $vwtr; $self->_croak("close(\$ewtr): $!") unless close $ewtr; SEL: { my $sel = 'IO::Select'->new($vrdr, $erdr); my $child_err; while (my(@ready) = $sel->can_read) { do { last SEL if @ready == 1 and fileno $ready[0] == fileno $vrdr; my $buf; my $bytes_read = sysread($erdr, $buf, 4096); if (not defined $bytes_read) { $self->_croak("sysread(\$erdr): $!"); } elsif ($bytes_read) { $sel->remove($vrdr) unless $child_err; $child_err .= $buf; } else { $sel->remove($erdr); die $child_err if $child_err; } }; } ; } ; my $aborted = $self->parser->parse($self, $vrdr); if ($aborted) { $self->report($self->report_class->new_diag('valgrind has aborted')); return 0; } ; 1 } })
400 1 0 if kill 0, $pid
408 1 0 waitpid($pid, 0) == $pid ? :
410 0 1 unless close $erdr
411 0 1 unless close $vrdr
416 1 0 if $error
447 32 8 @_ <= 1 ? :
24 8 @_ <= 1 ? :
5 6 @_ <= 1 ? :
32 8 @_ <= 1 ? :
448 0 32 if $@
489 0 0 unless defined $tool_tag
492 0 0 unless defined $cmd_tag
519 0 6 unless ($self->no_def_supp)
521 0 0 if defined $def_supp
574 0 10 unless defined $report
578 0 20 unless defined $report
603 0 2 defined $status ? :