Test::...algrind(3pm)
๐ธ NAME ๐ธ
hiii bestie!! okay so this is Test::RunValgrind ๐ and what it does is tests that an external program is valgrind-clean โจ no cap, that's the whole job.
(side quest: this page is one of the User Contributed Perl Documentation pages, and the header up top got cropped into Test::...algrind(3pm) which is honestly so dramatic of it ๐
iykyk)
โจ VERSION โจ
version 0.2.2 ๐ that's the era we're living in, periodt.
๐ฆ SYNOPSIS ๐ฆ
use Test::More tests => 1;
use Test::RunValgrind;
# TEST
Test::RunValgrind->new( {} )->run(
{
log_fn => './expr--valgrind-log.txt',
prog => '/usr/bin/expr',
argv => [qw/5 + 6/],
blurb => 'valgrind likes /usr/bin/expr',
}
);
look at her go ๐ซถ so clean, so iconic.
๐ DESCRIPTION ๐
okay so valgrind is an open source and convenient memory debugger that runs on some platforms ๐ง this module runs valgrind (link: http://en.wikipedia.org/wiki/Valgrind) on an executable and makes sure that valgrind did not find any faults in it. the vibe check is: no faults = slay, faults = ๐ญ.
where did she come from?? she originated from some code that was used to test the Freecell Solver executables using valgrind, and then got extracted into her own CPAN module so other projects could reuse her too โ including fortune-mod (https://github.com/shlomif/fortune-mod) ๐
๐ง METHODS ๐ง
๐ง the constructor: my $obj = Test::RunValgrind->new({})
The constructor โ currently she accepts a single hash reference ๐ and check it:
- if its
'supress_stderr'key's value is true, she supresses outputtingSTDERRif on successful subsequent tests (starting from version0.0.2). (yes the key is spelledsupress_stderr, we do not fix her spelling, we respect her ๐ ) - if
'ignore_leaks'is true, then reported memory leaks are ignored and their presence will still allow the tests to pass (starting from version0.2.0, and see https://rt.cpan.org/Public/Bug/Display.html?id=119988) ๐ฉต 'valgrind_args'may point to an array reference of extra command line arguments to valgrind. See https://github.com/shlomif/perl-Test-RunValgrind/issues/4 ; since version0.2.0. ๐ฅ
โญ $obj->run({ ... })
Runs valgrind. that's it, that's the method ๐ซก
She accepts a hash ref with the following keys:
blurbโ the Test::More test assertion blurb ๐log_fnโ the path to write the log file to (and read from it). make sure it is secured ๐ (fr fr, secure it)progโ the path to the executable to run ๐argvโ an array reference contains strings with command line arguments to the executable ๐
see the synopsis for an example ๐ she showed you already.
๐ SEE ALSO ๐
- Test::Valgrind โ seems to be only for running perl itself under valgrind ๐ช
- Devel::Valgrind::Client ๐ซ
- http://en.wikipedia.org/wiki/Valgrind โ wikipedia page ๐
- http://github.com/shlomif/fc-solve/blob/master/fc-solve/source/t/t/lib/FC_Solve/Test/Valgrind.pm โ original code using Test::RunValgrind in Freecell Solver ๐
๐ซถ SUPPORT ๐ซถ
๐ Websites
the following websites have more information about this module, and may be of help to you. as always, in addition to those websites please use your favorite search engine to discover more resources ๐ (bestie, googling is free)
- MetaCPAN โ a modern, open-source CPAN search engine, useful to view POD in HTML format โจ
https://metacpan.org/release/Test-RunValgrind
- RT: CPAN's Bug Tracker โ the RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN ๐
https://rt.cpan.org/Public/Dist/Display.html?Name=Test-RunValgrind
- CPANTS โ the CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution ๐
http://cpants.cpanauthors.org/dist/Test-RunValgrind
- CPAN Testers โ the CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions ๐จ
http://www.cpantesters.org/distro/T/Test-RunValgrind
- CPAN Testers Matrix โ the CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms ๐งฎ
http://matrix.cpantesters.org/?dist=Test-RunValgrind
- CPAN Testers Dependencies โ the CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution ๐
http://deps.cpantesters.org/?module=Test::RunValgrind
๐ Bugs / Feature Requests
please report any bugs or feature requests by email to "bug-test-runvalgrind at rt.cpan.org", or through the web interface at https://rt.cpan.org/Public/Bug/Report.html?Queue=Test-RunValgrind ๐ฌ you will be automatically notified of any progress on the request by the system. auto-updates?? we love that for you ๐
๐ป Source Code
the code is open to the world, and available for you to hack on. please feel free to browse it and play with it, or whatever ๐ฎ if you want to contribute patches, please send me a diff or prod me to pull from your repository :)
https://github.com/shlomif/perl-Test-RunValgrind
git clone git://github.com/shlomif/perl-Test-RunValgrind.git
go clone her, she's right there ๐ซถ
๐ AUTHOR ๐
Shlomi Fish <shlomif@cpan.org> ๐
๐ BUGS ๐
please report any bugs or feature requests on the bugtracker website https://github.com/shlomif/perl-Test-RunValgrind/issues ๐
when submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature ๐ (yes this is required, no you cannot just say "it's broken bestie")
๐ COPYRIGHT AND LICENSE ๐
This software is Copyright (c) 2016 by Shlomi Fish.
This is free software, licensed under:
The MIT (X11) License
okay that's the whole page, you made it to the end, main character energy fr ๐ and just so you know, the little footer down there said perl v5.42.0, dated 2025-07-25, filed under Test::...algrind(3pm) โ so that's the tea, go write some valgrind-clean code, mwah ๐
๐
๐ฆ where this page comes from
- fedora 43: perl-Test-RunValgrind 0.2.2-14.fc43 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms