=item *
-C<< extra_supps => \@files >>
+C<< regen_def_supp => $bool >>
-Also use suppressions from C<@files> besides C<perl>'s.
+If true, forcefully regenerate the default suppression file.
-Defaults to empty.
+Defaults to false.
=item *
Defaults to false.
+=item *
+
+C<< extra_supps => \@files >>
+
+Also use suppressions from C<@files> besides C<perl>'s.
+
+Defaults to empty.
+
=back
=cut
my $sess = eval {
Test::Valgrind::Session->new(
min_version => $tool->requires_version,
- map { $_ => delete $args{$_} } qw<extra_supps no_def_supp>
+ map { $_ => delete $args{$_} } qw<regen_def_supp no_def_supp extra_supps>
);
};
unless ($sess) {
=head2 C<new>
my $tvs = Test::Valgrind::Session->new(
- search_dirs => \@search_dirs,
- valgrind => $valgrind, # One candidate
- valgrind => \@valgrind, # Several candidates
- min_version => $min_version,
- no_def_supp => $no_def_supp,
- extra_supps => \@extra_supps,
+ search_dirs => \@search_dirs,
+ valgrind => $valgrind, # One candidate
+ valgrind => \@valgrind, # Several candidates
+ min_version => $min_version,
+ regen_def_supp => $regen_def_supp,
+ no_def_supp => $no_def_supp,
+ extra_supps => \@extra_supps,
);
The package constructor, which takes several options :
=item *
-If C<$no_def_supp> is false, C<valgrind> won't read the default suppression file associated with the tool and the command.
+If C<$regen_def_supp> is true, the default suppression file associated with the tool and the command will be forcefully regenerated.
+
+Defaults to false.
+
+=item *
+
+If C<$no_def_supp> is true, C<valgrind> won't read the default suppression file associated with the tool and the command.
Defaults to false.
@$extra_supps = grep { defined && -f $_ && -r _ } @$extra_supps;
bless {
- valgrind => $valgrind,
- version => $version,
- no_def_supp => delete($args{no_def_supp}),
- extra_supps => $extra_supps,
+ valgrind => $valgrind,
+ version => $version,
+ regen_def_supp => delete($args{regen_def_supp}),
+ no_def_supp => delete($args{no_def_supp}),
+ extra_supps => $extra_supps,
}, $class;
}
return $version;
}
+=head2 C<regen_def_supp>
+
+ my $regen_def_supp = $tvs->regen_def_supp;
+
+Read-only accessor for the C<regen_def_supp> option.
+
+=cut
+
=head2 C<no_def_supp>
my $no_def_supp = $tvs->no_def_supp;
=cut
-eval "sub $_ { \$_[0]->{$_} }" for qw<valgrind no_def_supp>;
+eval "sub $_ { \$_[0]->{$_} }" for qw<valgrind regen_def_supp no_def_supp>;
=head2 C<extra_supps>
push @supp_args, '--gen-suppressions=all';
} elsif (not $self->no_def_supp) {
my $def_supp = $self->def_supp_file;
+ my $forced;
+ if ($self->regen_def_supp and -e $def_supp) {
+ 1 while unlink $def_supp;
+ $forced = 1;
+ }
if (defined $def_supp and not -e $def_supp) {
$self->report($self->report_class->new_diag(
- "Generating suppressions..."
+ 'Generating suppressions' . ($forced ? ' (forced)' : '') . '...'
));
require Test::Valgrind::Suppressions;
Test::Valgrind::Suppressions->generate(