]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blob - lib/Test/Valgrind/Suppressions.pm
Importing Test-Valgrind-0.01.tar.gz
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind / Suppressions.pm
1 package Test::Valgrind::Suppressions;
2
3 use strict;
4 use warnings;
5
6 =head1 NAME
7
8 Test::Valgrind::Suppressions - Placeholder for architecture-dependant perl suppressions.
9
10 =head1 VERSION
11
12 Version 0.01
13
14 =cut
15
16 our $VERSION = '0.01';
17
18 =head1 DESCRIPTION
19
20 L<Test::Valgrind> needs suppressions so that perl's errors aren't reported. However, these suppressions depend widely on the architecture, perl's version and the features it has been build with (e.g. threads). The goal of this module is hence to be installed together with the suppression file generated when the Test-Valgrind distribution was built, and to handle back to L<Test::Valgrind> the path to the suppression file.
21
22 =head1 FUNCTIONS
23
24 =head2 C<supppath>
25
26 Returns the path to the suppression file that applies to the current running perl, or C<undef> when no such file is available.
27
28 =cut
29
30 sub supppath {
31  my $pkg = __PACKAGE__;
32  $pkg =~ s!::!/!g;
33  $pkg .= '.pm';
34  return if not $INC{$pkg};
35  my $supp = $INC{$pkg};
36  $supp =~ s![^/]*$!perlTestValgrind.supp!;
37  return (-f $supp) ? $supp : undef;
38 }
39
40 =head1 EXPORT
41
42 This module exports the L</supppath> function only on demand, either by giving its name, or by the C<:funcs> or C<:all> tags.
43
44 =cut
45
46 use base qw/Exporter/;
47
48 our @EXPORT         = ();
49 our %EXPORT_TAGS    = ( 'funcs' =>  [ qw/supppath/ ] );
50 our @EXPORT_OK      = map { @$_ } values %EXPORT_TAGS;
51 $EXPORT_TAGS{'all'} = [ @EXPORT_OK ];
52
53 =head1 SEE ALSO
54
55 L<Test::Valgrind>.
56
57 =head1 AUTHOR
58
59 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
60
61 You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).
62
63 =head1 BUGS
64
65 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>.  I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
66
67 =head1 SUPPORT
68
69 You can find documentation for this module with the perldoc command.
70
71     perldoc Test::Valgrind::Suppressions
72
73 =head1 COPYRIGHT & LICENSE
74
75 Copyright 2008 Vincent Pit, all rights reserved.
76
77 This program is free software; you can redistribute it and/or modify it
78 under the same terms as Perl itself.
79
80 =cut
81
82 1; # End of Test::Valgrind::Suppressions