X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FValgrind%2FTool.pm;h=077fc09257ce71dbc1be397fff912b61cd766cfe;hb=270aacc7f116b97928f9d70ce7936dd9d0a78ce0;hp=0fc287df309004ae563f9f29a15c4a91c547ae5d;hpb=1fdcbca240b4f4d939304b6e3c002d9ecc4289b4;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/lib/Test/Valgrind/Tool.pm b/lib/Test/Valgrind/Tool.pm index 0fc287d..077fc09 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.01 +Version 1.02 =cut -our $VERSION = '1.01'; +our $VERSION = '1.02'; =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::Carp/; +use base qw/Test::Valgrind::Component Test::Valgrind::Carp/; =head1 METHODS @@ -58,7 +58,7 @@ sub new { return $tool->new(%args); } - bless { }, $class; + $class->SUPER::new(@_); } =head2 C @@ -71,41 +71,25 @@ Defaults to return C, which skips suppression generation. sub new_trainer { } -=head2 C - -Wraps around either L or L depending on the running mode of the C<$session>. - -=cut +=head2 C -sub report_class { - my ($self, $sess) = @_; - - if ($sess->do_suppressions) { - $self->report_class_suppressions($sess); - } else { - $self->report_class_analysis($sess); - } -} - -=head2 C - -Returns the class in which suppression reports generated by this tool will be blessed. +Returns the class from which the parser for this tool output will be instanciated. This method must be implemented when subclassing. =cut -sub report_class_suppression; +sub parser_class; -=head2 C +=head2 C -Returns the class in which error reports generated by this tool will be blessed. +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_analysis; +sub report_class; =head2 C @@ -116,7 +100,7 @@ Defaults to the empty list. =cut -sub args { } +sub args { } =head2 C @@ -132,21 +116,20 @@ sub suppressions_tag; Called when the C<$session> starts. -Defaults to void. - -=cut - -sub start { } +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; + if ($sess->do_suppressions) { $self->parse_suppressions($sess, $fh); } else { @@ -178,15 +161,11 @@ sub parse_analysis; Called when the C<$session> finishes. -Defaults to void. - -=cut - -sub finish { } +Defaults to clear L. =head1 SEE ALSO -L, L. +L, L, L. =head1 AUTHOR