1Test::Valgrind::CommandU(s3e)r Contributed Perl DocumentaTteisotn::Valgrind::Command(3)
2
3
4
6 Test::Valgrind::Command - Base class for Test::Valgrind commands.
7
9 Version 1.19
10
12 This class is the base for Test::Valgrind commands.
13
14 Commands gather information about the target of the analysis. They
15 should also provide a default setup for generating suppressions.
16
18 "new"
19 my $tvc = Test::Valgrind::Command->new(
20 command => $command,
21 args => \@args,
22 );
23
24 Creates a new command object of type $command by requiring and
25 redispatching the method call to the module named $command if it
26 contains '::' or to "Test::Valgrind::Command::$command" otherwise. The
27 class represented by $command must inherit this class.
28
29 The "args" key is used to initialize the "args" accessor.
30
31 "new_trainer"
32 Creates a new command object suitable for generating suppressions.
33
34 Defaults to return "undef", which skips suppression generation.
35
36 "args"
37 my @args = $tvc->args($session);
38
39 Returns the list of command-specific arguments that are to be passed to
40 "valgrind".
41
42 Defaults to return the contents of the "args" option.
43
44 "env"
45 my $env = $tvc->env($session);
46
47 This event is called in scalar context before the command is ran, and
48 the returned value goes out of scope when the analysis ends. It's
49 useful for e.g. setting up %ENV for the child process by returning an
50 Env::Sanctify object, hence the name.
51
52 Defaults to void.
53
54 "suppressions_tag"
55 my $tag = $tvc->suppressions_tag($session);
56
57 Returns a identifier that will be used to pick up the right
58 suppressions for running the command, or "undef" to indicate that no
59 special suppressions are needed.
60
61 This method must be implemented when subclassing.
62
63 "check_suppressions_file"
64 my $supp_ok = $tvc->check_suppressions_file($file);
65
66 Returns a boolean indicating whether the suppressions contained in
67 $file are compatible with the command.
68
69 Defaults to true.
70
71 "filter"
72 my $filtered_report = $tvc->filter($session, $report);
73
74 The $session calls this method after receiving a report from the tool
75 and before forwarding it to the action. You can either return a
76 mangled $report (which does not need to be a clone of the original) or
77 "undef" if you want the action to ignore it completely.
78
79 Defaults to the identity function.
80
82 Test::Valgrind, Test::Valgrind::Session.
83
85 Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
86
87 You can contact me by mail or on "irc.perl.org" (vincent).
88
90 Please report any bugs or feature requests to "bug-test-valgrind at
91 rt.cpan.org", or through the web interface at
92 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Valgrind>. I will
93 be notified, and then you'll automatically be notified of progress on
94 your bug as I make changes.
95
97 You can find documentation for this module with the perldoc command.
98
99 perldoc Test::Valgrind::Command
100
102 Copyright 2009,2010,2011,2013,2015,2016 Vincent Pit, all rights
103 reserved.
104
105 This program is free software; you can redistribute it and/or modify it
106 under the same terms as Perl itself.
107
108
109
110perl v5.30.1 2020-01-30 Test::Valgrind::Command(3)