| 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 3perl" |
| 58 |
.TH App::Prove::State 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 \- State storage for the "prove" command. |
| 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 implements that state |
| 72 |
and the operations that may be performed on it. |
| 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 |
Accepts a hashref with the following key/value pairs: |
| 87 |
.IP \(bu 4 |
| 88 |
\&\f(CW\*(C`store\*(C'\fR |
| 89 |
.Sp |
| 90 |
The filename of the data store holding the data that App::Prove::State reads. |
| 91 |
.IP \(bu 4 |
| 92 |
\&\f(CW\*(C`extensions\*(C'\fR (optional) |
| 93 |
.Sp |
| 94 |
The test name extensions. Defaults to \f(CW\*(C`.t\*(C'\fR. |
| 95 |
.IP \(bu 4 |
| 96 |
\&\f(CW\*(C`result_class\*(C'\fR (optional) |
| 97 |
.Sp |
| 98 |
The name of the \f(CW\*(C`result_class\*(C'\fR. Defaults to \f(CW\*(C`App::Prove::State::Result\*(C'\fR. |
| 99 |
.ie n .SS """result_class""" |
| 100 |
.el .SS \f(CWresult_class\fP |
| 101 |
.IX Subsection "result_class" |
| 102 |
Getter/setter for the name of the class used for tracking test results. This |
| 103 |
class should either subclass from \f(CW\*(C`App::Prove::State::Result\*(C'\fR or provide an |
| 104 |
identical interface. |
| 105 |
.ie n .SS """extensions""" |
| 106 |
.el .SS \f(CWextensions\fP |
| 107 |
.IX Subsection "extensions" |
| 108 |
Get or set the list of extensions that files must have in order to be |
| 109 |
considered tests. Defaults to ['.t']. |
| 110 |
.ie n .SS """results""" |
| 111 |
.el .SS \f(CWresults\fP |
| 112 |
.IX Subsection "results" |
| 113 |
Get the results of the last test run. Returns a \f(CWresult_class()\fR instance. |
| 114 |
.ie n .SS """commit""" |
| 115 |
.el .SS \f(CWcommit\fP |
| 116 |
.IX Subsection "commit" |
| 117 |
Save the test results. Should be called after all tests have run. |
| 118 |
.SS "Instance Methods" |
| 119 |
.IX Subsection "Instance Methods" |
| 120 |
\fR\f(CI\*(C`apply_switch\*(C'\fR\fI\fR |
| 121 |
.IX Subsection "apply_switch" |
| 122 |
.PP |
| 123 |
.Vb 1 |
| 124 |
\& $self\->apply_switch(\*(Aqfailed,save\*(Aq); |
| 125 |
.Ve |
| 126 |
.PP |
| 127 |
Apply a list of switch options to the state, updating the internal |
| 128 |
object state as a result. Nothing is returned. |
| 129 |
.PP |
| 130 |
Diagnostics: |
| 131 |
\- "Illegal state option: \f(CW%s\fR" |
| 132 |
.ie n .IP """last""" 4 |
| 133 |
.el .IP \f(CWlast\fR 4 |
| 134 |
.IX Item "last" |
| 135 |
Run in the same order as last time |
| 136 |
.ie n .IP """failed""" 4 |
| 137 |
.el .IP \f(CWfailed\fR 4 |
| 138 |
.IX Item "failed" |
| 139 |
Run only the failed tests from last time |
| 140 |
.ie n .IP """passed""" 4 |
| 141 |
.el .IP \f(CWpassed\fR 4 |
| 142 |
.IX Item "passed" |
| 143 |
Run only the passed tests from last time |
| 144 |
.ie n .IP """all""" 4 |
| 145 |
.el .IP \f(CWall\fR 4 |
| 146 |
.IX Item "all" |
| 147 |
Run all tests in normal order |
| 148 |
.ie n .IP """hot""" 4 |
| 149 |
.el .IP \f(CWhot\fR 4 |
| 150 |
.IX Item "hot" |
| 151 |
Run the tests that most recently failed first |
| 152 |
.ie n .IP """todo""" 4 |
| 153 |
.el .IP \f(CWtodo\fR 4 |
| 154 |
.IX Item "todo" |
| 155 |
Run the tests ordered by number of todos. |
| 156 |
.ie n .IP """slow""" 4 |
| 157 |
.el .IP \f(CWslow\fR 4 |
| 158 |
.IX Item "slow" |
| 159 |
Run the tests in slowest to fastest order. |
| 160 |
.ie n .IP """fast""" 4 |
| 161 |
.el .IP \f(CWfast\fR 4 |
| 162 |
.IX Item "fast" |
| 163 |
Run test tests in fastest to slowest order. |
| 164 |
.ie n .IP """new""" 4 |
| 165 |
.el .IP \f(CWnew\fR 4 |
| 166 |
.IX Item "new" |
| 167 |
Run the tests in newest to oldest order. |
| 168 |
.ie n .IP """old""" 4 |
| 169 |
.el .IP \f(CWold\fR 4 |
| 170 |
.IX Item "old" |
| 171 |
Run the tests in oldest to newest order. |
| 172 |
.ie n .IP """save""" 4 |
| 173 |
.el .IP \f(CWsave\fR 4 |
| 174 |
.IX Item "save" |
| 175 |
Save the state on exit. |
| 176 |
.PP |
| 177 |
\fR\f(CI\*(C`get_tests\*(C'\fR\fI\fR |
| 178 |
.IX Subsection "get_tests" |
| 179 |
.PP |
| 180 |
Given a list of args get the names of tests that should run |
| 181 |
.PP |
| 182 |
\fR\f(CI\*(C`observe_test\*(C'\fR\fI\fR |
| 183 |
.IX Subsection "observe_test" |
| 184 |
.PP |
| 185 |
Store the results of a test. |
| 186 |
.PP |
| 187 |
\fR\f(CI\*(C`save\*(C'\fR\fI\fR |
| 188 |
.IX Subsection "save" |
| 189 |
.PP |
| 190 |
Write the state to a file. |
| 191 |
.PP |
| 192 |
\fR\f(CI\*(C`load\*(C'\fR\fI\fR |
| 193 |
.IX Subsection "load" |
| 194 |
.PP |
| 195 |
Load the state from a file |