Test::...algrind(3pm)

๐Ÿ“ฆ
version 0.2.2 ยท 2 versions
, in fedora 43

๐ŸŒธ 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 outputting STDERR if on successful subsequent tests (starting from version 0.0.2). (yes the key is spelled supress_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 version 0.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 version 0.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 ๐Ÿ‘€


๐Ÿซถ 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")


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