]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blob - README
This is 1.00
[perl/modules/Test-Valgrind.git] / README
1 NAME
2     Test::Valgrind - Test Perl code through valgrind.
3
4 VERSION
5     Version 1.00
6
7 SYNOPSIS
8         # From the command-line
9         perl -MTest::Valgrind leaky.pl
10
11         # In a test file
12         use Test::More;
13         eval 'use Test::Valgrind';
14         plan skip_all => 'Test::Valgrind is required to test your distribution with valgrind' if $@;
15         ...
16
17         # In all the test files of a directory
18         prove --exec 'perl -Iblib/lib -Iblib/arch -MTest::Valgrind' t/*.t
19
20 DESCRIPTION
21     This module is a front-end to the "Test::Valgrind::*" API that lets you
22     run Perl code through the "memcheck" tool of the "valgrind" memory
23     debugger, to test it for memory errors and leaks. If they aren't
24     available yet, it will first generate suppressions for the current
25     "perl" interpreter and store them in the portable flavour of
26     ~/.perl/Test-Valgrind/suppressions/$VERSION. The actual run will then
27     take place, and tests will be passed or failed according to the result
28     of the analysis.
29
30     Due to the nature of perl's memory allocator, this module can't track
31     leaks of Perl objects. This includes non-mortalized scalars and memory
32     cycles. However, it can track leaks of chunks of memory allocated in XS
33     extensions with "Newx" and friends or "malloc". As such, it's
34     complementary to the other very good leak detectors listed in the "SEE
35     ALSO" section.
36
37 CONFIGURATION
38     You can pass parameters to "import" as a list of key / value pairs,
39     where valid keys are :
40
41     *   "tool => $tool"
42
43         The Test::Valgrind::Tool object (or class name) to use.
44
45         Defaults to Test::Valgrind::Tool::memcheck.
46
47     *   "action => $action"
48
49         The Test::Valgrind::Action object (or class name) to use.
50
51         Defaults to Test::Valgrind::Action::Test.
52
53     *   "diag => $bool"
54
55         If true, print the output of the test script as diagnostics.
56
57     *   "callers => $number"
58
59         Specify the maximum stack depth studied when valgrind encounters an
60         error. Raising this number improves granularity.
61
62         Default is 12.
63
64     *   "extra_supps => \@files"
65
66         Also use suppressions from @files besides "perl"'s.
67
68     *   "no_def_supp => $bool"
69
70         If true, do not use the default suppression file.
71
72 CAVEATS
73     You can't use this module to test code given by the "-e" command-line
74     switch.
75
76     Perl 5.8 is notorious for leaking like there's no tomorrow, so the
77     suppressions are very likely not to be very accurate on it. Anyhow,
78     results will most likely be better if your perl is built with debugging
79     enabled. Using the latest "valgrind" available will also help.
80
81     This module is not really secure. It's definitely not taint safe. That
82     shouldn't be a problem for test files.
83
84     What your tests output to "STDOUT" and "STDERR" is eaten unless you pass
85     the "diag" option, in which case it will be reprinted as diagnostics.
86
87 DEPENDENCIES
88     Valgrind 3.1.0 (<http://valgrind.org>).
89
90     XML::Twig, version, File::HomeDir, Env::Sanctify, Perl::Destruct::Level.
91
92 SEE ALSO
93     All the "Test::Valgrind::*" API, including Test::Valgrind::Command,
94     Test::Valgrind::Tool, Test::Valgrind::Action and
95     Test::Valgrind::Session.
96
97     Test::LeakTrace.
98
99     Devel::Leak, Devel::LeakTrace, Devel::LeakTrace::Fast.
100
101 AUTHOR
102     Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
103
104     You can contact me by mail or on "irc.perl.org" (vincent).
105
106 BUGS
107     Please report any bugs or feature requests to "bug-test-valgrind at
108     rt.cpan.org", or through the web interface at
109     <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Valgrind>. I will
110     be notified, and then you'll automatically be notified of progress on
111     your bug as I make changes.
112
113 SUPPORT
114     You can find documentation for this module with the perldoc command.
115
116         perldoc Test::Valgrind
117
118 ACKNOWLEDGEMENTS
119     RafaĆ«l Garcia-Suarez, for writing and instructing me about the
120     existence of Perl::Destruct::Level (Elizabeth Mattijsen is a close
121     second).
122
123     H.Merijn Brand, for daring to test this thing.
124
125     All you people that showed interest in this module, which motivated me
126     into completely rewriting it.
127
128 COPYRIGHT & LICENSE
129     Copyright 2008-2009 Vincent Pit, all rights reserved.
130
131     This program is free software; you can redistribute it and/or modify it
132     under the same terms as Perl itself.
133