=head1 VERSION
-Version 1.01
+Version 1.02
=cut
-our $VERSION = '1.01';
+our $VERSION = '1.02';
=head1 DESCRIPTION
=cut
-use base qw/Test::Valgrind::Carp/;
+use base qw/Test::Valgrind::Component Test::Valgrind::Carp/;
=head1 METHODS
return $tool->new(%args);
}
- bless { }, $class;
+ $class->SUPER::new(@_);
}
=head2 C<new_trainer>
=head2 C<report_class $session>
-Wraps around either L</report_class_suppressions> or L</report_class_analysis> depending on the running mode of the C<$session>.
-
-=cut
-
-sub report_class {
- my ($self, $sess) = @_;
-
- if ($sess->do_suppressions) {
- $self->report_class_suppressions($sess);
- } else {
- $self->report_class_analysis($sess);
- }
-}
-
-=head2 C<report_class_suppressions $session>
-
Returns the class in which suppression reports generated by this tool will be blessed.
This method must be implemented when subclassing.
=cut
-sub report_class_suppression;
-
-=head2 C<report_class_analysis $session>
-
-Returns the class in which error reports generated by this tool will be blessed.
-
-This method must be implemented when subclassing.
-
-=cut
-
-sub report_class_analysis;
+sub report_class;
=head2 C<args $session>
=cut
-sub args { }
+sub args { }
=head2 C<suppressions_tag $session>
Called when the C<$session> starts.
-Defaults to void.
-
-=cut
-
-sub start { }
+Defaults to set L<Test::Valgrind::Component/started>.
=head2 C<parse $session, $fh>
Wraps around either L</parse_suppressions> or L</parse_analysis> 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;
+
if ($sess->do_suppressions) {
$self->parse_suppressions($sess, $fh);
} else {
=head2 C<parse_suppressions $sesssion, $fh>
-Parse the suppression reports sent by the C<valgrind> process attached to the session C<$session> through the filehandle C<$fh>.
+Parse the suppression reports that the C<valgrind> process attached to the session C<$session> send through the filehandle C<$fh>.
This method must be implemented when subclassing.
Called when the C<$session> finishes.
-Defaults to void.
-
-=cut
-
-sub finish { }
+Defaults to clear L<Test::Valgrind::Component/started>.
=head1 SEE ALSO
-L<Test::Valgrind>, L<Test::Valgrind::Session>.
+L<Test::Valgrind>, L<Test::Valgrind::Component>, L<Test::Valgrind::Session>.
=head1 AUTHOR