X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FValgrind%2FSession.pm;h=bbafa5620500c137a9280b6fb0913d0ada8577ce;hb=b62067c81672ff40a3fcda54cb498feae33b752f;hp=7964761af446495c0c8d9bbfdb243e812d3671f1;hpb=d83358595540f8645467c2d1a2f658fa74b14c72;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/lib/Test/Valgrind/Session.pm b/lib/Test/Valgrind/Session.pm index 7964761..bbafa56 100644 --- a/lib/Test/Valgrind/Session.pm +++ b/lib/Test/Valgrind/Session.pm @@ -9,11 +9,11 @@ Test::Valgrind::Session - Test::Valgrind session object. =head1 VERSION -Version 1.13 +Version 1.14 =cut -our $VERSION = '1.13'; +our $VERSION = '1.14'; =head1 DESCRIPTION @@ -37,12 +37,13 @@ use base qw; =head2 C 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 : @@ -71,7 +72,13 @@ Defaults to none. =item * -If C<$no_def_supp> is false, C 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 won't read the default suppression file associated with the tool and the command. Defaults to false. @@ -130,10 +137,11 @@ sub new { @$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; } @@ -160,6 +168,14 @@ sub version { return $version; } +=head2 C + + my $regen_def_supp = $tvs->regen_def_supp; + +Read-only accessor for the C option. + +=cut + =head2 C my $no_def_supp = $tvs->no_def_supp; @@ -168,7 +184,7 @@ Read-only accessor for the C option. =cut -eval "sub $_ { \$_[0]->{$_} }" for qw; +eval "sub $_ { \$_[0]->{$_} }" for qw; =head2 C @@ -226,9 +242,14 @@ sub _run { 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( @@ -532,7 +553,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2009,2010,2011 Vincent Pit, all rights reserved. +Copyright 2009,2010,2011,2013 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.