]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blob - lib/Test/Valgrind/Suppressions.pm
This is 0.06
[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.06
13
14 =cut
15
16 our $VERSION = '0.06';
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<supp_path>
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 supp_path {
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 CONSTANTS
41
42 =head2 C<VG_PATH>
43
44 The path to the valgrind binary from which the suppressions were generated.
45
46 =cut
47
48 use constant VG_PATH => undef;
49
50 =head1 EXPORT
51
52 This module exports the L</supp_path> function and the L</VG_PATH> constants only on demand, either by giving their name explicitely or by the C<:funcs>, C<:consts> or C<:all> tags.
53
54 =cut
55
56 use base qw/Exporter/;
57
58 our @EXPORT         = ();
59 our %EXPORT_TAGS    = (
60  'funcs'  => [ qw/supp_path/ ],
61  'consts' => [ qw/VG_PATH/ ]
62 );
63 our @EXPORT_OK      = map { @$_ } values %EXPORT_TAGS;
64 $EXPORT_TAGS{'all'} = [ @EXPORT_OK ];
65
66 =head1 SEE ALSO
67
68 L<Test::Valgrind>.
69
70 =head1 AUTHOR
71
72 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
73
74 You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).
75
76 =head1 BUGS
77
78 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.
79
80 =head1 SUPPORT
81
82 You can find documentation for this module with the perldoc command.
83
84     perldoc Test::Valgrind::Suppressions
85
86 =head1 COPYRIGHT & LICENSE
87
88 Copyright 2008 Vincent Pit, all rights reserved.
89
90 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
91
92 =cut
93
94 1; # End of Test::Valgrind::Suppressions