From: Vincent Pit Date: Sat, 19 Sep 2009 22:19:21 +0000 (+0200) Subject: Remove support for report_class_{suppressions,analysis} in tools X-Git-Tag: v1.10~15 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=14b54bdeb3ebea2f465cf5a034c59138b736b982;p=perl%2Fmodules%2FTest-Valgrind.git Remove support for report_class_{suppressions,analysis} in tools And let subclasses handle them by only implementing report_class(). --- diff --git a/lib/Test/Valgrind/Tool.pm b/lib/Test/Valgrind/Tool.pm index a82b95d..147ee11 100644 --- a/lib/Test/Valgrind/Tool.pm +++ b/lib/Test/Valgrind/Tool.pm @@ -73,39 +73,13 @@ sub new_trainer { } =head2 C -Wraps around either L or L 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 - 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 - -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 diff --git a/lib/Test/Valgrind/Tool/memcheck.pm b/lib/Test/Valgrind/Tool/memcheck.pm index e75f0c0..1302efe 100644 --- a/lib/Test/Valgrind/Tool/memcheck.pm +++ b/lib/Test/Valgrind/Tool/memcheck.pm @@ -73,13 +73,18 @@ sub callers { $_[0]->{callers} } sub suppressions_tag { 'memcheck-' . $_[1]->version } -=head2 C +=head2 C This tool emits C object reports in analysis mode. =cut -sub report_class_analysis { 'Test::Valgrind::Tool::memcheck::Report' } +sub report_class { + my ($self, $session) = @_; + + $session->do_suppressions ? 'Test::Valgrind::Report::Suppressions' + : 'Test::Valgrind::Tool::memcheck::Report' +} sub args { my $self = shift;