1Test::Valgrind::SessionU(s3e)r Contributed Perl DocumentaTteisotn::Valgrind::Session(3)
2
3
4

NAME

6       Test::Valgrind::Session - Test::Valgrind session object.
7

VERSION

9       Version 1.19
10

DESCRIPTION

12       This class supervises the execution of the "valgrind" process.  It also
13       acts as a dispatcher between the different components.
14

METHODS

16   "new"
17           my $tvs = Test::Valgrind::Session->new(
18            search_dirs    => \@search_dirs,
19            valgrind       => $valgrind,  # One candidate
20            valgrind       => \@valgrind, # Several candidates
21            min_version    => $min_version,
22            regen_def_supp => $regen_def_supp,
23            no_def_supp    => $no_def_supp,
24            allow_no_supp  => $allow_no_supp,
25            extra_supps    => \@extra_supps,
26           );
27
28       The package constructor, which takes several options :
29
30       ·   All the directories from @search_dirs will have valgrind appended
31           to create a list of candidates for the "valgrind" executable.
32
33           Defaults to the current "PATH" environment variable.
34
35       ·   If a simple scalar $valgrind is passed as the value to 'valgrind',
36           it will be the only candidate.  @search_dirs will then be ignored.
37
38           If an array refernce "\@valgrind" is passed, its values will be
39           prepended to the list of the candidates resulting from
40           @search_dirs.
41
42       ·   $min_version specifies the minimal "valgrind" version required.
43           The constructor will croak if it's not able to find an adequate
44           "valgrind" from the supplied candidates list and search path.
45
46           Defaults to none.
47
48       ·   If $regen_def_supp is true, the default suppression file associated
49           with the tool and the command will be forcefully regenerated.
50
51           Defaults to false.
52
53       ·   If $no_def_supp is true, "valgrind" won't read the default
54           suppression file associated with the tool and the command.
55
56           Defaults to false.
57
58       ·   If $allow_no_supp is true, the command will always be run into
59           "valgrind" even if no appropriate suppression file is available.
60
61           Defaults to false.
62
63       ·   $extra_supps is a reference to an array of optional suppression
64           files that will be passed to "valgrind".
65
66           Defaults to none.
67
68   "valgrind"
69           my $valgrind_path = $tvs->valgrind;
70
71       The path to the selected "valgrind" executable.
72
73   "version"
74           my $valgrind_version = $tvs->version;
75
76       The Test::Valgrind::Version object associated to the selected
77       "valgrind".
78
79   "regen_def_supp"
80           my $regen_def_supp = $tvs->regen_def_supp;
81
82       Read-only accessor for the "regen_def_supp" option.
83
84   "no_def_supp"
85           my $no_def_supp = $tvs->no_def_supp;
86
87       Read-only accessor for the "no_def_supp" option.
88
89   "allow_no_supp"
90           my $allow_no_supp = $tvs->allow_no_supp;
91
92       Read-only accessor for the "allow_no_supp" option.
93
94   "extra_supps"
95           my @extra_supps = $tvs->extra_supps;
96
97       Read-only accessor for the "extra_supps" option.
98
99   "run"
100           $tvs->run(
101            action  => $action,
102            tool    => $tool,
103            command => $command,
104           );
105
106       Runs the command $command through "valgrind" with the tool $tool, which
107       will report to the action $action.
108
109       If the command is a Test::Valgrind::Command::Aggregate object, the
110       action and the tool will be initialized once before running all the
111       aggregated commands.
112
113   "action"
114       Read-only accessor for the "action" associated to the current run.
115
116   "tool"
117       Read-only accessor for the "tool" associated to the current run.
118
119   "parser"
120       Read-only accessor for the "parser" associated to the current tool.
121
122   "command"
123       Read-only accessor for the "command" associated to the current run.
124
125   "do_suppressions"
126       Forwards to "->action->do_suppressions".
127
128   "parser_class"
129       Calls "->tool->parser_class" with the current session object as the
130       unique argument.
131
132   "report_class"
133       Calls "->tool->report_class" with the current session object as the
134       unique argument.
135
136   "def_supp_file"
137       Returns an absolute path to the default suppression file associated to
138       the current session.
139
140       "undef" will be returned as soon as any of
141       "->command->suppressions_tag" or "->tool->suppressions_tag" are also
142       "undef".  Otherwise, the file part of the name is builded by joining
143       those two together, and the directory part is roughly
144       File::HomeDir->my_home / .perl / Test-Valgrind / suppressions /
145       $VERSION.
146
147   "suppressions"
148           my @suppressions = $tvs->suppressions;
149
150       Returns the list of all the suppressions that will be passed to
151       "valgrind".  Honors "no_def_supp" and "extra_supps".
152
153   "start"
154           $tvs->start;
155
156       Starts the action and tool associated to the current run.  It's
157       automatically called at the beginning of "run".
158
159   "abort"
160           $tvs->abort($msg);
161
162       Forwards to "->action->abort" after unshifting the session object to
163       the argument list.
164
165   "report"
166           $tvs->report($report);
167
168       Forwards to "->action->report" after unshifting the session object to
169       the argument list.
170
171   "finish"
172           $tvs->finish;
173
174       Finishes the action and tool associated to the current run.  It's
175       automatically called at the end of "run".
176
177   "status"
178           my $status = $tvs->status;
179
180       Returns the status code of the last run of the session.
181

SEE ALSO

183       Test::Valgrind, Test::Valgrind::Action, Test::Valgrind::Command,
184       Test::Valgrind::Tool, Test::Valgrind::Parser.
185
186       File::HomeDir.
187

AUTHOR

189       Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
190
191       You can contact me by mail or on "irc.perl.org" (vincent).
192

BUGS

194       Please report any bugs or feature requests to "bug-test-valgrind at
195       rt.cpan.org", or through the web interface at
196       <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Valgrind>.  I will
197       be notified, and then you'll automatically be notified of progress on
198       your bug as I make changes.
199

SUPPORT

201       You can find documentation for this module with the perldoc command.
202
203           perldoc Test::Valgrind::Session
204
206       Copyright 2009,2010,2011,2013,2015,2016 Vincent Pit, all rights
207       reserved.
208
209       This program is free software; you can redistribute it and/or modify it
210       under the same terms as Perl itself.
211
212
213
214perl v5.30.0                      2019-07-26        Test::Valgrind::Session(3)
Impressum