The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::RunValgrind - tests that an external program is valgrind-clean.

VERSION

version 0.0.1

SYNOPSIS

    use Test::More tests => 1;

    # 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',
        }
    );

DESCRIPTION

valgrind is an open source and convenient memory debugger that runs on some platforms. This module runs valgrind (http://en.wikipedia.org/wiki/Valgrind) on an executable and makes sure that valgrind did not find any faults in it.

It originated from some code used to test the Freecell Solver executables using valgrind, and was extracted into its own CPAN module to allow for reuse by other projects, including fortune-mod (https://github.com/shlomif/fortune-mod).

METHODS

my $obj = Test::RunValgrind->new({})

The constructor - currently accepts a single hash reference and does not use any of its keys.

$obj->run({ ... })

Runs valgrind.

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.

  • 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.

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

AUTHOR

Shlomi Fish <shlomif@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016 by Shlomi Fish.

This is free software, licensed under:

  The MIT (X11) License

BUGS

Please report any bugs or feature requests on the bugtracker website http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-RunValgrind or by email to bug-test-runvalgrind@rt.cpan.org.

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.

SUPPORT

Perldoc

You can find documentation for this module with the perldoc command.

  perldoc Test::RunValgrind

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.

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.

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 https://github.com/shlomif/perl-Test-RunValgrind.git