Test::...Session(3pm)
β¨ NAME β¨
Test::Valgrind::Session β the Test::Valgrind session object, bestie π (this is the page from User Contributed Perl Documentation, and yes the title line is being extra with the dots, we love that for it)
πΈ VERSION πΈ
Version 1.19 β that's the one, no cap.
π¦ DESCRIPTION π¦
Okay so picture this: this class is the main character that supervises the execution of the valgrind process. That's the whole job, and honestly? She ate. π
But wait, there's more β she also acts as a dispatcher</> between the different components. Like a group chat admin who actually keeps everyone on topic. Iconic behaviour, fr fr.
π METHODS π
π new π
my $tvs = Test::Valgrind::Session->new(
search_dirs => \@search_dirs,
valgrind => $valgrind, # One candidate
valgrind => \@valgrind, # Several candidates
min_version => $min_version,
regen_def_supp => $regen_def_supp,
no_def_supp => $no_def_supp,
allow_no_supp => $allow_no_supp,
extra_supps => \@extra_supps,
);
The package constructor, aka the birth of the session. She takes several options, and here they all are, one by one, no skipping, I don't do skipping:
- Every single directory from
@search_dirsgetsvalgrindappended to it, which builds up a whole little list of candidates for thevalgrindexecutable. Defaults to the currentPATHenvironment variable. π« - If you pass a simple scalar
$valgrindas the value for'valgrind', then that's the only candidate, periodt.@search_dirswill just be ignored in that case, sorry bestie. If instead you pass an array reference\@valgrind, its values get prepended to the candidate list that came out of@search_dirs. $min_versionsays what the minimalvalgrindversion required is. If the constructor can't find a suitablevalgrindfrom the candidate list and search path you gave her, she will croak. π Defaults to none.- If
$regen_def_suppis true, the default suppression file associated with the tool and the command gets forcefully regenerated. Defaults to false. - If
$no_def_suppis true,valgrindwill not read the default suppression file associated with the tool and the command. Defaults to false. - If
$allow_no_suppis true, the command will always be run intovalgrind, even when no appropriate suppression file is available. Defaults to false. $extra_suppsis a reference to an array of optional suppression files that get passed tovalgrind. Defaults to none.
π valgrind π
my $valgrind_path = $tvs->valgrind;
The path to the valgrind executable that got selected. That's it, that's the method.
π version π
my $valgrind_version = $tvs->version;
The Test::Valgrind::Version object associated with the selected valgrind. Cute little version wrapper, we stan.
π regen_def_supp π
my $regen_def_supp = $tvs->regen_def_supp;
Read-only accessor for the regen_def_supp option. Look, don't touch. π
π§ no_def_supp π§
my $no_def_supp = $tvs->no_def_supp;
Read-only accessor for the no_def_supp option.
β allow_no_supp β
my $allow_no_supp = $tvs->allow_no_supp;
Read-only accessor for the allow_no_supp option.
π extra_supps π
my @extra_supps = $tvs->extra_supps;
Read-only accessor for the extra_supps option.
π₯ run π₯
$tvs->run(
action => $action,
tool => $tool,
command => $command,
);
Runs the command $command through valgrind using the tool $tool, and that tool will report to the action $action. Big moment. Main event energy. π¬
If the command happens to be a Test::Valgrind::Command::Aggregate object, then the action and the tool get initialized once before running all the aggregated commands. Efficiency slay.
π action π
Read-only accessor for the action associated with the current run.
π«Ά tool π«Ά
Read-only accessor for the tool associated with the current run.
π parser π
Read-only accessor for the parser associated with the current tool.
πΈ command πΈ
Read-only accessor for the command associated with the current run.
π¦ do_suppressions π¦
Forwards to ->action->do_suppressions. Just passing the vibe along, iykyk.
π
parser_class π
Calls ->tool->parser_class with the current session object as the unique argument.
π report_class π
Calls ->tool->report_class with the current session object as the unique argument.
π def_supp_file π
Returns an absolute path to the default suppression file associated with the current session.
undef gets returned as soon as any of ->command->suppressions_tag or ->tool->suppressions_tag are also undef. Otherwise, the file part of the name is builded by joining those two together, and the directory part is roughly File::HomeDir->my_home / .perl / Test-Valgrind / suppressions / $VERSION. (Yes, "builded". We're keeping it exactly as written. It's part of the lore now. π)
π suppressions π
my @suppressions = $tvs->suppressions;
Returns the list of all the suppressions that will be passed to valgrind. Honors no_def_supp and extra_supps, like a good listener.
π§ start π§
$tvs->start;
Starts the action and tool associated with the current run. It's automatically called at the beginning of run, so it's kind of self-sufficient like that.
β abort β
$tvs->abort($msg);
Forwards to ->action->abort after unshifting the session object to the argument list. π
π report π
$tvs->report($report);
Forwards to ->action->report after unshifting the session object to the argument list.
π₯ finish π₯
$tvs->finish;
Finishes the action and tool associated with the current run. It's automatically called at the end of run. Closure, we love to see it. π«Ά
π status π
my $status = $tvs->status;
Returns the status code of the last run of the session. The receipts, basically.
π SEE ALSO π
Test::Valgrind, Test::Valgrind::Action, Test::Valgrind::Command, Test::Valgrind::Tool, Test::Valgrind::Parser.
File::HomeDir.
Go read them, they're all connected, it's giving extended universe. π«
π AUTHOR π
Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
You can contact him by mail or on irc.perl.org (vincent). Bestie is reachable, respect. π«‘
π BUGS π
Please report any bugs or feature requests to "bug-test-valgrind at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Valgrind>. He will be notified, and then you'll automatically be notified of progress on your bug as he makes changes. It's giving mutual updates, we love a feedback loop. π
π SUPPORT π
You can find documentation for this module with the perldoc command.
perldoc Test::Valgrind::Session
πΈ COPYRIGHT & LICENSE πΈ
Copyright 2009,2010,2011,2013,2015,2016 Vincent Pit, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
And that's a wrap on Test::...Session(3pm), babes β this page came from perl v5.40.1 and it's dated 2025-04-13, so it's fresh, it's current, it's literally the moment. Stay validating, stay suppressions-having, and go read a manpage for fun sometime. Slay. π
β¨
π¦ where this page comes from
- debian trixie: libtest-valgrind-perl 1.19-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtest-valgrind-perl 1.19-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtest-valgrind-perl 1.19-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms