]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind/Tool/memcheck.pm
This is 1.10
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind / Tool / memcheck.pm
index e75f0c0dd0dda9492d35666052f1d588dbd952f5..fef177a5f5c296e0abfcf95585c1efd60d7dc911 100644 (file)
@@ -9,11 +9,11 @@ Test::Valgrind::Tool::memcheck - Run an analysis through the memcheck tool.
 
 =head1 VERSION
 
-Version 1.02
+Version 1.10
 
 =cut
 
-our $VERSION = '1.02';
+our $VERSION = '1.10';
 
 =head1 DESCRIPTION
 
@@ -73,13 +73,37 @@ sub callers { $_[0]->{callers} }
 
 sub suppressions_tag { 'memcheck-' . $_[1]->version }
 
-=head2 C<report_class_analysis $session>
+=head2 C<parser_class $session>
+
+This tool uses a C<Test::Valgrind::Parser::XML::Twig> parser in analysis mode, and a C<Test::Valgrind::Parser::Suppressions::Text> parser in suppressions mode.
+
+=cut
+
+sub parser_class {
+ my ($self, $session) = @_;
+
+ my $class = $session->do_suppressions
+           ? 'Test::Valgrind::Parser::Suppressions::Text'
+           : 'Test::Valgrind::Parser::XML::Twig';
+
+ local $@;
+ eval "require $class";
+
+ return $class;
+}
+
+=head2 C<report_class $session>
 
 This tool emits C<Test::Valgrind::Tool::memcheck::Report> 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;
@@ -141,7 +165,7 @@ package Test::Valgrind::Tool::memcheck::Report;
 
 use base qw/Test::Valgrind::Report/;
 
-our $VERSION = '1.02';
+our $VERSION = '1.10';
 
 my @kinds = qw/
  InvalidFree