1Test::RunValgrind(3pm)User Contributed Perl DocumentationTest::RunValgrind(3pm)
2
3
4
6 Test::RunValgrind - tests that an external program is valgrind-clean.
7
9 version 0.2.2
10
12 use Test::More tests => 1;
13 use Test::RunValgrind;
14
15 # TEST
16 Test::RunValgrind->new( {} )->run(
17 {
18 log_fn => './expr--valgrind-log.txt',
19 prog => '/usr/bin/expr',
20 argv => [qw/5 + 6/],
21 blurb => 'valgrind likes /usr/bin/expr',
22 }
23 );
24
26 valgrind is an open source and convenient memory debugger that runs on
27 some platforms. This module runs valgrind
28 (<http://en.wikipedia.org/wiki/Valgrind>) on an executable and makes
29 sure that valgrind did not find any faults in it.
30
31 It originated from some code used to test the Freecell Solver
32 executables using valgrind, and was extracted into its own CPAN module
33 to allow for reuse by other projects, including fortune-mod
34 (<https://github.com/shlomif/fortune-mod>).
35
37 my $obj = Test::RunValgrind->new({})
38 The constructor - currently accepts a single hash reference and if its
39 'supress_stderr' key's value is true, supresses outputting STDERR if on
40 successful subsequent tests (starting from version 0.0.2). Furthermore
41 if 'ignore_leaks' is true, then reported memory leaks are ignored and
42 their presence will still allow the tests to pass (starting from
43 version 0.2.0, and see
44 <https://rt.cpan.org/Public/Bug/Display.html?id=119988> ).
45
46 'valgrind_args' may point to an array reference of extra command line
47 arguments to valgrind. See
48 <https://github.com/shlomif/perl-Test-RunValgrind/issues/4> ; since
49 version 0.2.0.
50
51 $obj->run({ ... })
52 Runs valgrind.
53
54 Accepts a hash ref with the following keys:
55
56 • blurb
57
58 The Test::More test assertion blurb.
59
60 • log_fn
61
62 The path to write the log file to (and read from it). Make sure it
63 is secured.
64
65 • prog
66
67 The path to the executable to run.
68
69 • argv
70
71 An array reference contains strings with command line arguments to
72 the executable.
73
74 See the synopsis for an example.
75
77 Test::Valgrind - seems to be only for running perl itself under
78 valgrind.
79
80 Devel::Valgrind::Client
81
82 <http://en.wikipedia.org/wiki/Valgrind> - wikipedia page.
83
84 <http://github.com/shlomif/fc-solve/blob/master/fc-solve/source/t/t/lib/FC_Solve/Test/Valgrind.pm>
85 - original code using Test::RunValgrind in Freecell Solver
86
88 Websites
89 The following websites have more information about this module, and may
90 be of help to you. As always, in addition to those websites please use
91 your favorite search engine to discover more resources.
92
93 • MetaCPAN
94
95 A modern, open-source CPAN search engine, useful to view POD in
96 HTML format.
97
98 <https://metacpan.org/release/Test-RunValgrind>
99
100 • RT: CPAN's Bug Tracker
101
102 The RT ( Request Tracker ) website is the default bug/issue
103 tracking system for CPAN.
104
105 <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-RunValgrind>
106
107 • CPANTS
108
109 The CPANTS is a website that analyzes the Kwalitee ( code metrics )
110 of a distribution.
111
112 <http://cpants.cpanauthors.org/dist/Test-RunValgrind>
113
114 • CPAN Testers
115
116 The CPAN Testers is a network of smoke testers who run automated
117 tests on uploaded CPAN distributions.
118
119 <http://www.cpantesters.org/distro/T/Test-RunValgrind>
120
121 • CPAN Testers Matrix
122
123 The CPAN Testers Matrix is a website that provides a visual
124 overview of the test results for a distribution on various
125 Perls/platforms.
126
127 <http://matrix.cpantesters.org/?dist=Test-RunValgrind>
128
129 • CPAN Testers Dependencies
130
131 The CPAN Testers Dependencies is a website that shows a chart of
132 the test results of all dependencies for a distribution.
133
134 <http://deps.cpantesters.org/?module=Test::RunValgrind>
135
136 Bugs / Feature Requests
137 Please report any bugs or feature requests by email to
138 "bug-test-runvalgrind at rt.cpan.org", or through the web interface at
139 <https://rt.cpan.org/Public/Bug/Report.html?Queue=Test-RunValgrind>.
140 You will be automatically notified of any progress on the request by
141 the system.
142
143 Source Code
144 The code is open to the world, and available for you to hack on. Please
145 feel free to browse it and play with it, or whatever. If you want to
146 contribute patches, please send me a diff or prod me to pull from your
147 repository :)
148
149 <https://github.com/shlomif/perl-Test-RunValgrind>
150
151 git clone git://github.com/shlomif/perl-Test-RunValgrind.git
152
154 Shlomi Fish <shlomif@cpan.org>
155
157 Please report any bugs or feature requests on the bugtracker website
158 <https://github.com/shlomif/perl-Test-RunValgrind/issues>
159
160 When submitting a bug or request, please include a test-file or a patch
161 to an existing test-file that illustrates the bug or desired feature.
162
164 This software is Copyright (c) 2016 by Shlomi Fish.
165
166 This is free software, licensed under:
167
168 The MIT (X11) License
169
170
171
172perl v5.38.0 2023-07-21 Test::RunValgrind(3pm)