X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FValgrind%2FTool.pm;h=304cf721216c59fed9ce5c97eee5c56c2842a0e0;hb=cea977523ce9c4be865b97a0813a5e14cce873f9;hp=077fc09257ce71dbc1be397fff912b61cd766cfe;hpb=270aacc7f116b97928f9d70ce7936dd9d0a78ce0;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/lib/Test/Valgrind/Tool.pm b/lib/Test/Valgrind/Tool.pm index 077fc09..304cf72 100644 --- a/lib/Test/Valgrind/Tool.pm +++ b/lib/Test/Valgrind/Tool.pm @@ -9,11 +9,11 @@ Test::Valgrind::Tool - Base class for Test::Valgrind tools. =head1 VERSION -Version 1.02 +Version 1.13 =cut -our $VERSION = '1.02'; +our $VERSION = '1.13'; =head1 DESCRIPTION @@ -24,7 +24,7 @@ They are expected to function both in suppressions generation and in analysis mo =cut -use base qw/Test::Valgrind::Component Test::Valgrind::Carp/; +use base qw; =head1 METHODS @@ -118,44 +118,16 @@ Called when the C<$session> starts. Defaults to set L. -=head2 C +=head2 C -Wraps around either L or L depending on the running mode of the C<$session>. -Croaks if the tool isn't started. +The C<$session> calls this method after receiving a report from the parser and before letting the command filter it. +You can either return a mangled C<$report> (which does not need to be a clone of the original) or C if you want the action to ignore it completely. -=cut - -sub parse { - my ($self, $sess, $fh) = @_; - - $self->_croak('Tool isn\'t started') unless $self->started; - - if ($sess->do_suppressions) { - $self->parse_suppressions($sess, $fh); - } else { - $self->parse_analysis($sess, $fh); - } -} - -=head2 C - -Parse the suppression reports that the C process attached to the session C<$session> send through the filehandle C<$fh>. - -This method must be implemented when subclassing. - -=cut - -sub parse_suppressions; - -=head2 C - -Parse the error reports sent by the C process attached to the session C<$session> through the filehandle C<$fh>. - -This method must be implemented when subclassing. +Defaults to the identity function. =cut -sub parse_analysis; +sub filter { $_[2] } =head2 C @@ -186,7 +158,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2009 Vincent Pit, all rights reserved. +Copyright 2009,2010,2011 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.