Test::...::Tool(3pm)

πŸ’– NAME πŸ’–

Test::Valgrind::Tool β€” bestie, this is the base class for all the Test::Valgrind tools. It's the blueprint, the template, the moment πŸ’…


✨ VERSION ✨

Version 1.19 β€” that's the one, no cap 🫢


🌸 DESCRIPTION 🌸

Okay so, this class is literally the base for all the Test::Valgrind tools. It's giving founder energy πŸ‘‘

What do these tools actually do? They wrap around valgrind tools by parsing its output and sending reports to the parent session whenever an error occurs. And they're expected to function both in suppressions generation and in analysis mode β€” versatile icon behavior, we love to see it ✨


πŸŽ€ METHODS πŸŽ€

requires_version

my $required_version = $tvt->requires_version;

The minimum valgrind version you need to run this tool. Defaults to 3.1.0. So if your valgrind is ancient, that's a vibe check fail, sorry bestie 😭

new

my $tvt = Test::Valgrind::Tool->new(tool => $tool);

Makes a shiny new tool object of type $tool by requiring and redispatching the method call to the module named $tool if it contains '::', or to Test::Valgrind::Tool::$tool otherwise. The class that $tool represents must inherit this class β€” family only, periodt πŸ’…

new_trainer

my $tvt_train = Test::Valgrind::Tool->new_trainer;

Creates a new tool object that's suitable for generating suppressions.

Defaults to returning undef, which skips suppression generation entirely. Not me just dipping out πŸ™ˆ

parser_class

my $parser_class = $tvt->parser_class($session);

Returns the class from which the parser for this tool's output is going to be instantiated.

This method must be implemented when subclassing. No skipping, bestie, it's required 🫢

report_class

my $report_class = $tvt->report_class($session);

Returns the class in which suppression reports generated by this tool will be blessed. Fancy ✨

This method must be implemented when subclassing. Again. Required. Periodt.

args

my @args = $tvt->args($session);

Returns the list of tool-specific arguments that get passed to valgrind. Heads up though β€” all the suppression arguments are already handled by the session, so don't you dare duplicate them πŸ’€

Defaults to the empty list.

suppressions_tag

my $tag = $tvt->suppressions_tag($session);

Returns an identifier that's used to pick up the right suppressions for running the tool, or undef to say "nah, no special suppressions needed here." Literally the chill option 😌

This method must be implemented when subclassing. Three for three, you got this πŸŽ€

start

$tvt->start($session);

Called when the $session starts. It's giving opening ceremony 🌈

Defaults to setting started in Test::Valgrind::Component.

filter

my $filtered_report = $tvt->filter($session, $report);

The $session calls this method after receiving a report from the parser and before letting the command filter it. You can either return a mangled $report β€” and ngl it does not need to be a clone of the original, do whatever β€” or return undef if you want the action to ignore it completely. Bye bye report πŸ‘‹

Defaults to the identity function.

finish

$tvt->finish($session);

Called when the $session finishes. Closing credits energy πŸ¦‹

Defaults to clearing started in Test::Valgrind::Component.


πŸ‘€ SEE ALSO πŸ‘€

Test::Valgrind, Test::Valgrind::Component, Test::Valgrind::Session.

The whole squad, fr fr πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.

You can contact me by mail or on irc.perl.org (vincent). Slide into the IRC, iykyk πŸ’¬


πŸ’€ 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>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. Look at that communication, we love a responsive king 🫢


🌈 SUPPORT 🌈

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

perldoc Test::Valgrind::Tool

Go read the docs bestie, it's literally right there πŸ“–βœ¨


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.


Okay that's the whole page, you ate that πŸ’… Generated for perl v5.40.1 on 2025-04-13, straight out of the User Contributed Perl Documentation. Byeee, go write a subclass πŸŽ€βœ¨

πŸ“¦ where this page comes from