X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FValgrind%2FTool.pm;h=7560d52217e64663a11af909a9102c1ac70ae934;hb=08860dad1f820cce06758ec4add9353a4dbc8175;hp=147ee1109b00dc25851b6b8492f1d9d4c3ab50dd;hpb=14b54bdeb3ebea2f465cf5a034c59138b736b982;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/lib/Test/Valgrind/Tool.pm b/lib/Test/Valgrind/Tool.pm index 147ee11..7560d52 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.10 =cut -our $VERSION = '1.02'; +our $VERSION = '1.10'; =head1 DESCRIPTION @@ -71,6 +71,16 @@ Defaults to return C, which skips suppression generation. sub new_trainer { } +=head2 C + +Returns the class from which the parser for this tool output will be instanciated. + +This method must be implemented when subclassing. + +=cut + +sub parser_class; + =head2 C Returns the class in which suppression reports generated by this tool will be blessed. @@ -108,44 +118,16 @@ Called when the C<$session> starts. Defaults to set L. -=head2 C - -Wraps around either L or L depending on the running mode of the C<$session>. -Croaks if the tool isn't started. - -=cut - -sub parse { - my ($self, $sess, $fh) = @_; - - $self->_croak('Tool isn\'t started') unless $self->started; +=head2 C - 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. +The <$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_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