X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FValgrind%2FReport.pm;h=9ecaff32ccd7a51ab01b35f89699b7672df5c908;hb=b34179155630f5f4cbea1749af4054a746ded9a4;hp=9c31ca96caed59249fb746adebee0a7178596260;hpb=abe419ac02d109283a1fe5615f5ab9d0a9a5572f;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/lib/Test/Valgrind/Report.pm b/lib/Test/Valgrind/Report.pm index 9c31ca9..9ecaff3 100644 --- a/lib/Test/Valgrind/Report.pm +++ b/lib/Test/Valgrind/Report.pm @@ -9,15 +9,31 @@ Test::Valgrind::Report - Base class for Test::Valgrind error reports. =head1 VERSION -Version 1.01 +Version 1.17 =cut -our $VERSION = '1.01'; +our $VERSION = '1.17'; -use base qw/Test::Valgrind::Carp/; +=head1 DESCRIPTION -=head2 C<< new kind => $kind, id => $id, data => $data >> +This class provides a generic API for messages (the so-called I) generated by the parser, filtered by the tool and the command, and handled by the action. +The tool has authority for deciding in which subclass of this one reports should be blessed. + +Reports are classified by I. +The C kind is reserved for diagnostics. + +=cut + +use base qw; + +=head2 C + + my $tvr = Test::Valgrind::Report->new( + kind => $kind, + id => $id, + data => $data, + ); Your usual constructor. @@ -63,9 +79,11 @@ sub new { }, $class; } -=head2 C<< new_diag $data >> +=head2 C + + my $diag_report = Test::Valgrind::Report->new_diag($data); -Constructs an object with kind C<'Diag'>, an auto-incremented identifier and the given C<$data>. +Constructs a report with kind C<'Diag'>, an auto-incremented identifier and the given C<$data>. =cut @@ -75,6 +93,8 @@ sub new_diag { shift->new(kind => 'Diag', id => ++$diag_id, data => $_[0]) } =head2 C + my $kind = $tvr->kind; + Read-only accessor for the C option. =cut @@ -83,6 +103,8 @@ sub kind { $_[0]->{kind} } =head2 C + my $id = $tvr->id; + Read-only accessor for the C option. =cut @@ -91,6 +113,8 @@ sub id { $_[0]->{id} } =head2 C + my $data = $tvr->data; + Read-only accessor for the C option. =cut @@ -99,6 +123,8 @@ sub data { $_[0]->{data} } =head2 C + $tvr->is_diag; + Tells if a report has the C<'Diag'> kind, i.e. is a diagnostic. =cut @@ -107,6 +133,8 @@ sub is_diag { $_[0]->kind eq 'Diag' } =head2 C + my @kinds = $tvr->kinds; + Returns the list of valid kinds for this report class. Defaults to C<'Diag'>. @@ -115,7 +143,9 @@ Defaults to C<'Diag'>. sub kinds { 'Diag' } -=head2 C +=head2 C + + $tvr->valid_kind($kind); Tells whether C<$kind> is a valid kind for this report class. @@ -148,7 +178,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2009 Vincent Pit, all rights reserved. +Copyright 2009,2010,2011,2013,2015 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.