Debian Codegraph @

upstream/mageia-cauldron/man3pm/App::Prove::State::Result.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (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 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "App::Prove::State::Result 3pm"
61 .TH App::Prove::State::Result 3pm 2025-06-24 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 App::Prove::State::Result \- Individual test suite results.
68 .SH VERSION
69 .IX Header "VERSION"
70 Version 3.50
71 .SH DESCRIPTION
72 .IX Header "DESCRIPTION"
73 The \f(CW\*(C`prove\*(C'\fR command supports a \f(CW\*(C`\-\-state\*(C'\fR option that instructs it to
74 store persistent state across runs. This module encapsulates the results for a
75 single test suite run.
76 .SH SYNOPSIS
77 .IX Header "SYNOPSIS"
78 .Vb 2
79 \& # Re\-run failed tests
80 \& $ prove \-\-state=failed,save \-rbv
81 .Ve
82 .SH METHODS
83 .IX Header "METHODS"
84 .SS "Class Methods"
85 .IX Subsection "Class Methods"
86 \fR\f(CI\*(C`new\*(C'\fR\fI\fR
87 .IX Subsection "new"
88 .PP
89 .Vb 4
90 \& my $result = App::Prove::State::Result\->new({
91 \& generation => $generation,
92 \& tests => \e%tests,
93 \& });
94 .Ve
95 .PP
96 Returns a new \f(CW\*(C`App::Prove::State::Result\*(C'\fR instance.
97 .ie n .SS """state_version"""
98 .el .SS \f(CWstate_version\fP
99 .IX Subsection "state_version"
100 Returns the current version of state storage.
101 .ie n .SS """test_class"""
102 .el .SS \f(CWtest_class\fP
103 .IX Subsection "test_class"
104 Returns the name of the class used for tracking individual tests. This class
105 should either subclass from \f(CW\*(C`App::Prove::State::Result::Test\*(C'\fR or provide an
106 identical interface.
107 .PP
108 \fR\f(CI\*(C`generation\*(C'\fR\fI\fR
109 .IX Subsection "generation"
110 .PP
111 Getter/setter for the "generation" of the test suite run. The first
112 generation is 1 (one) and subsequent generations are 2, 3, etc.
113 .PP
114 \fR\f(CI\*(C`last_run_time\*(C'\fR\fI\fR
115 .IX Subsection "last_run_time"
116 .PP
117 Getter/setter for the time of the test suite run.
118 .PP
119 \fR\f(CI\*(C`tests\*(C'\fR\fI\fR
120 .IX Subsection "tests"
121 .PP
122 Returns the tests for a given generation. This is a hashref or a hash,
123 depending on context called. The keys to the hash are the individual
124 test names and the value is a hashref with various interesting values.
125 Each k/v pair might resemble something like this:
126 .PP
127 .Vb 11
128 \& \*(Aqt/foo.t\*(Aq => {
129 \& elapsed => \*(Aq0.0428488254547119\*(Aq,
130 \& gen => \*(Aq7\*(Aq,
131 \& last_pass_time => \*(Aq1219328376.07815\*(Aq,
132 \& last_result => \*(Aq0\*(Aq,
133 \& last_run_time => \*(Aq1219328376.07815\*(Aq,
134 \& last_todo => \*(Aq0\*(Aq,
135 \& mtime => \*(Aq1191708862\*(Aq,
136 \& seq => \*(Aq192\*(Aq,
137 \& total_passes => \*(Aq6\*(Aq,
138 \& }
139 .Ve
140 .PP
141 \fR\f(CI\*(C`test\*(C'\fR\fI\fR
142 .IX Subsection "test"
143 .PP
144 .Vb 1
145 \& my $test = $result\->test(\*(Aqt/customer/create.t\*(Aq);
146 .Ve
147 .PP
148 Returns an individual \f(CW\*(C`App::Prove::State::Result::Test\*(C'\fR instance for the
149 given test name (usually the filename). Will return a new
150 \&\f(CW\*(C`App::Prove::State::Result::Test\*(C'\fR instance if the name is not found.
151 .PP
152 \fR\f(CI\*(C`test_names\*(C'\fR\fI\fR
153 .IX Subsection "test_names"
154 .PP
155 Returns an list of test names, sorted by run order.
156 .PP
157 \fR\f(CI\*(C`remove\*(C'\fR\fI\fR
158 .IX Subsection "remove"
159 .PP
160 .Vb 2
161 \& $result\->remove($test_name); # remove the test
162 \& my $test = $result\->test($test_name); # fatal error
163 .Ve
164 .PP
165 Removes a given test from results. This is a no\-op if the test name is not
166 found.
167 .PP
168 \fR\f(CI\*(C`num_tests\*(C'\fR\fI\fR
169 .IX Subsection "num_tests"
170 .PP
171 Returns the number of tests for a given test suite result.
172 .PP
173 \fR\f(CI\*(C`raw\*(C'\fR\fI\fR
174 .IX Subsection "raw"
175 .PP
176 Returns a hashref of raw results, suitable for serialization by YAML.