]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind/Tool/memcheck.pm
Get rid of all pointers to Test::Valgrind::Tool::SuppressionsParser
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind / Tool / memcheck.pm
index 4f1c5a9f422f982f9d4471913acced0f04537e7f..05f77bdf7be145aefefb42f6bae56e1b3ec7f52d 100644 (file)
@@ -21,11 +21,11 @@ This tool parses the XML output of a C<memcheck> run with L<XML::Twig>.
 
 =cut
 
-use base qw/Test::Valgrind::Tool::SuppressionsParser Test::Valgrind::Tool/;
+use base qw/Test::Valgrind::Tool/;
 
 =head1 METHODS
 
-This class inherits L<Test::Valgrind::Tool> and L<Test::Valgrind::Tool::SuppressionsParser>.
+This class inherits L<Test::Valgrind::Tool>.
 
 =head2 C<requires_version>
 
@@ -92,7 +92,8 @@ This tool emits C<Test::Valgrind::Tool::memcheck::Report> object reports in anal
 sub report_class_analysis { 'Test::Valgrind::Tool::memcheck::Report' }
 
 sub args {
- my ($self, $sess) = @_;
+ my $self = shift;
+ my ($sess) = @_;
 
  my @args = (
   '--tool=memcheck',
@@ -108,7 +109,7 @@ sub args {
   push @args, '--xml=yes';
  }
 
- push @args, $self->SUPER::args();
+ push @args, $self->SUPER::args(@_);
 
  return @args;
 }
@@ -121,9 +122,6 @@ sub _session { @_ <= 1 ? $_[0]->{_session} : ($_[0]->{_session} = $_[1]) }
 sub start {
  my ($self, $sess) = @_;
 
- $self->_croak('This memcheck tool can\'t be run in two sessions at once')
-                                                             if $self->_session;
-
  $self->SUPER::start($sess);
  $self->_session($sess);
 
@@ -151,7 +149,7 @@ sub finish {
 
 =head1 SEE ALSO
 
-L<Test::Valgrind>, L<Test::Valgrind::Tool>, L<Test::Valgrind::Tool::SuppressionsParser>.
+L<Test::Valgrind>, L<Test::Valgrind::Tool>.
 
 L<XML::Twig>.
 
@@ -323,13 +321,14 @@ sub handle_error {
                                      $origin->kid('stack')->children('frame') ];
  }
 
- my $report = Test::Valgrind::Tool::memcheck::Report->new(
+ my $tool = $twig->stash->{tool};
+ my $sess = $tool->_session;
+
+ $sess->report($tool->report_class($sess)->new(
   kind => $kind,
   id   => $id,
   data => $data,
- );
-
- $twig->stash->{tool}->_session->report($report);
+ ));
 
  $twig->purge;
 }