1 package Test::Valgrind::Suppressions;
8 Test::Valgrind::Suppressions - Generate suppressions for given tool and command.
16 our $VERSION = '1.01';
20 This module is an helper for generating suppressions.
24 use base qw/Test::Valgrind::Carp/;
28 =head2 C<< generate tool => $tool, command => $command, target => $target >>
30 Generates suppressions for the command C<< $command->new_trainer >> and the tool C<< $tool->new_trainer >>, and writes them in the file specified by C<$target>.
31 The action used behind the scenes is L<Test::Valgrind::Action::Suppressions>.
33 Returns the status code.
42 my $cmd = delete $args{command};
44 require Test::Valgrind::Command;
45 $cmd = Test::Valgrind::Command->new(
50 $cmd = $cmd->new_trainer;
51 return unless defined $cmd;
53 my $tool = delete $args{tool};
55 require Test::Valgrind::Tool;
56 $tool = Test::Valgrind::Tool->new(tool => $tool);
58 $tool = $tool->new_trainer;
59 return unless defined $tool;
61 my $target = delete $args{target};
62 $self->_croak('Invalid target') unless $target and not ref $target;
64 require Test::Valgrind::Action;
65 my $action = Test::Valgrind::Action->new(
66 action => 'Suppressions',
68 name => 'PerlSuppression',
71 require Test::Valgrind::Session;
72 my $sess = Test::Valgrind::Session->new(
73 min_version => $tool->requires_version,
83 $self->_croak($@) if $@;
85 my $status = $sess->status;
86 $status = 255 unless defined $status;
93 L<Test::Valgrind>, L<Test::Valgrind::Command>, L<Test::Valgrind::Tool>, L<Test::Valgrind::Action::Suppressions>.
97 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
99 You can contact me by mail or on C<irc.perl.org> (vincent).
103 Please report any bugs or feature requests to C<bug-test-valgrind-suppressions at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Valgrind>.
104 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
108 You can find documentation for this module with the perldoc command.
110 perldoc Test::Valgrind::Suppressions
112 =head1 COPYRIGHT & LICENSE
114 Copyright 2008-2009 Vincent Pit, all rights reserved.
116 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
120 1; # End of Test::Valgrind::Suppressions