=head1 VERSION
-Version 1.02
+Version 1.10
=cut
-our $VERSION = '1.02';
+our $VERSION = '1.10';
=head1 DESCRIPTION
$self->{callers} = $callers;
- $self->{twig} = Test::Valgrind::Tool::memcheck::Twig->new(tool => $self);
-
$self;
}
sub callers { $_[0]->{callers} }
-=head2 C<twig>
+sub suppressions_tag { 'memcheck-' . $_[1]->version }
+
+=head2 C<parser_class $session>
-Read-only accessor for the underlying L<XML::Twig> parser.
+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 twig { $_[0]->{twig} }
+sub parser_class {
+ my ($self, $session) = @_;
-sub suppressions_tag { 'memcheck-' . $_[1]->version }
+ 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_analysis $session>
+=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;
return @args;
}
-# We must store the session in ourselves because it's only possible to pass
-# arguments to XML::Twig objects by a global stash.
-
-sub _session { @_ <= 1 ? $_[0]->{_session} : ($_[0]->{_session} = $_[1]) }
-
-sub start {
- my ($self, $sess) = @_;
-
- $self->SUPER::start($sess);
- $self->_session($sess);
-
- return;
-}
-
-sub parse_analysis {
- my ($self, $sess, $fh) = @_;
-
- my $twig = $self->twig;
- $twig->parse($fh);
- $twig->purge;
-
- return;
-}
-
-sub finish {
- my ($self, $sess) = @_;
-
- $self->_session(undef);
- $self->SUPER::finish($sess);
-
- return;
-}
-
=head1 SEE ALSO
L<Test::Valgrind>, L<Test::Valgrind::Tool>.
use base qw/Test::Valgrind::Report/;
-our $VERSION = '1.02';
+our $VERSION = '1.10';
my @kinds = qw/
InvalidFree