+ my $tvt = Test::Valgrind::Tool->new(tool => $tool);
Creates a new tool object of type C<$tool> by requiring and redispatching the method call to the module named C<$tool> if it contains C<'::'> or to C<Test::Valgrind::Tool::$tool> otherwise.
The class represented by C<$tool> must inherit this class.
Creates a new tool object of type C<$tool> by requiring and redispatching the method call to the module named C<$tool> if it contains C<'::'> or to C<Test::Valgrind::Tool::$tool> otherwise.
The class represented by C<$tool> must inherit this class.
Returns a identifier that will be used to pick up the right suppressions for running the tool, or C<undef> to indicate that no special suppressions are needed.
Returns a identifier that will be used to pick up the right suppressions for running the tool, or C<undef> to indicate that no special suppressions are needed.
@@ -128,65+128,38 @@ This method must be implemented when subclassing.
sub suppressions_tag;
sub suppressions_tag;
-=head2 C<start $session>
-
-Called when the C<$session> starts.
+=head2 C<start>
-Defaults to void.
+ $tvt->start($session);
-=cut
-
-sub start { }
-
-=head2 C<parse $session, $fh>
-
-Wraps around either L</parse_suppressions> or L</parse_analysis> depending on the running mode of the C<$session>.
-
-=cut
+Called when the C<$session> starts.
-sub parse {
- my ($self, $sess, $fh) = @_;
+Defaults to set L<Test::Valgrind::Component/started>.
- if ($sess->do_suppressions) {
- $self->parse_suppressions($sess, $fh);
- } else {
- $self->parse_analysis($sess, $fh);
- }
-}
+=head2 C<filter>
-=head2 C<parse_suppressions $sesssion, $fh>
+ my $filtered_report = $tvt->filter($session, $report);
-Parse the suppression reports sent by the C<valgrind> process attached to the session C<$session> through the filehandle C<$fh>.
+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<undef> if you want the action to ignore it completely.
-This method must be implemented when subclassing.
+Defaults to the identity function.
=cut
=cut
-sub parse_suppressions;
+sub filter { $_[2] }
-=head2 C<parse_analysis $sesssion, $fh>
+=head2 C<finish>
-Parse the error reports sent by the C<valgrind> process attached to the session C<$session> through the filehandle C<$fh>.
-
-This method must be implemented when subclassing.
-
-=cut
-
-sub parse_analysis;
-
-=head2 C<finish $session>
+ $tvt->finish($session);
Called when the C<$session> finishes.
Called when the C<$session> finishes.
-Defaults to void.
-
-=cut
-
-sub finish { }
+Defaults to clear L<Test::Valgrind::Component/started>.