Debian Codegraph @

upstream/debian-unstable/man3/App::Prove::State::Result.3perl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "App::Prove::State::Result 3perl"
58 .TH App::Prove::State::Result 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 App::Prove::State::Result \- Individual test suite results.
65 .SH VERSION
66 .IX Header "VERSION"
67 Version 3.48
68 .SH DESCRIPTION
69 .IX Header "DESCRIPTION"
70 The \f(CW\*(C`prove\*(C'\fR command supports a \f(CW\*(C`\-\-state\*(C'\fR option that instructs it to
71 store persistent state across runs. This module encapsulates the results for a
72 single test suite run.
73 .SH SYNOPSIS
74 .IX Header "SYNOPSIS"
75 .Vb 2
76 \& # Re\-run failed tests
77 \& $ prove \-\-state=failed,save \-rbv
78 .Ve
79 .SH METHODS
80 .IX Header "METHODS"
81 .SS "Class Methods"
82 .IX Subsection "Class Methods"
83 \fR\f(CI\*(C`new\*(C'\fR\fI\fR
84 .IX Subsection "new"
85 .PP
86 .Vb 4
87 \& my $result = App::Prove::State::Result\->new({
88 \& generation => $generation,
89 \& tests => \e%tests,
90 \& });
91 .Ve
92 .PP
93 Returns a new \f(CW\*(C`App::Prove::State::Result\*(C'\fR instance.
94 .ie n .SS """state_version"""
95 .el .SS \f(CWstate_version\fP
96 .IX Subsection "state_version"
97 Returns the current version of state storage.
98 .ie n .SS """test_class"""
99 .el .SS \f(CWtest_class\fP
100 .IX Subsection "test_class"
101 Returns the name of the class used for tracking individual tests. This class
102 should either subclass from \f(CW\*(C`App::Prove::State::Result::Test\*(C'\fR or provide an
103 identical interface.
104 .PP
105 \fR\f(CI\*(C`generation\*(C'\fR\fI\fR
106 .IX Subsection "generation"
107 .PP
108 Getter/setter for the "generation" of the test suite run. The first
109 generation is 1 (one) and subsequent generations are 2, 3, etc.
110 .PP
111 \fR\f(CI\*(C`last_run_time\*(C'\fR\fI\fR
112 .IX Subsection "last_run_time"
113 .PP
114 Getter/setter for the time of the test suite run.
115 .PP
116 \fR\f(CI\*(C`tests\*(C'\fR\fI\fR
117 .IX Subsection "tests"
118 .PP
119 Returns the tests for a given generation. This is a hashref or a hash,
120 depending on context called. The keys to the hash are the individual
121 test names and the value is a hashref with various interesting values.
122 Each k/v pair might resemble something like this:
123 .PP
124 .Vb 11
125 \& \*(Aqt/foo.t\*(Aq => {
126 \& elapsed => \*(Aq0.0428488254547119\*(Aq,
127 \& gen => \*(Aq7\*(Aq,
128 \& last_pass_time => \*(Aq1219328376.07815\*(Aq,
129 \& last_result => \*(Aq0\*(Aq,
130 \& last_run_time => \*(Aq1219328376.07815\*(Aq,
131 \& last_todo => \*(Aq0\*(Aq,
132 \& mtime => \*(Aq1191708862\*(Aq,
133 \& seq => \*(Aq192\*(Aq,
134 \& total_passes => \*(Aq6\*(Aq,
135 \& }
136 .Ve
137 .PP
138 \fR\f(CI\*(C`test\*(C'\fR\fI\fR
139 .IX Subsection "test"
140 .PP
141 .Vb 1
142 \& my $test = $result\->test(\*(Aqt/customer/create.t\*(Aq);
143 .Ve
144 .PP
145 Returns an individual \f(CW\*(C`App::Prove::State::Result::Test\*(C'\fR instance for the
146 given test name (usually the filename). Will return a new
147 \&\f(CW\*(C`App::Prove::State::Result::Test\*(C'\fR instance if the name is not found.
148 .PP
149 \fR\f(CI\*(C`test_names\*(C'\fR\fI\fR
150 .IX Subsection "test_names"
151 .PP
152 Returns an list of test names, sorted by run order.
153 .PP
154 \fR\f(CI\*(C`remove\*(C'\fR\fI\fR
155 .IX Subsection "remove"
156 .PP
157 .Vb 2
158 \& $result\->remove($test_name); # remove the test
159 \& my $test = $result\->test($test_name); # fatal error
160 .Ve
161 .PP
162 Removes a given test from results. This is a no-op if the test name is not
163 found.
164 .PP
165 \fR\f(CI\*(C`num_tests\*(C'\fR\fI\fR
166 .IX Subsection "num_tests"
167 .PP
168 Returns the number of tests for a given test suite result.
169 .PP
170 \fR\f(CI\*(C`raw\*(C'\fR\fI\fR
171 .IX Subsection "raw"
172 .PP
173 Returns a hashref of raw results, suitable for serialization by YAML.