App::Prove::State — State storage for the “prove” command.
| Use Case | Command | Description |
|---|---|---|
| Re-run failed tests | prove --state=failed,save -rbv |
Re-run tests that failed in the last run and save state |
| Run in same order as last time | prove --state=last,save |
Run tests in the same order as the last run |
| Run only passed tests | prove --state=passed,save |
Run only tests that passed in the last run |
| Run all tests normally | prove --state=all |
Run all tests in normal order |
| Run tests by temperature (hot first) | prove --state=hot,save |
Run tests that most recently failed first |
| Run tests by TODO count | prove --state=todo,save |
Run tests ordered by number of TODOs |
| Run slowest tests first | prove --state=slow,save |
Run tests in slowest to fastest order |
| Run fastest tests first | prove --state=fast,save |
Run tests in fastest to slowest order |
| Run newest tests first | prove --state=new,save |
Run tests in newest to oldest order |
| Run oldest tests first | prove --state=old,save |
Run tests in oldest to newest order |
Version 3.43
The “prove” command supports a “--state” option that instructs it to store persistent state across runs. This module implements that state and the operations that may be performed on it.
# Re-run failed tests
$ prove --state=failed,save -rbv
new — Accepts a hashref with the following key/value pairs:
store — The filename of the data store holding the data that App::Prove::State reads.extensions (optional) — The test name extensions. Defaults to “.t”.result_class (optional) — The name of the “result_class”. Defaults to App::Prove::State::Result.result_class — Getter/setter for the name of the class used for tracking test results. This class should either subclass from App::Prove::State::Result or provide an identical interface.extensions — Get or set the list of extensions that files must have in order to be considered tests. Defaults to ['.t'].results — Get the results of the last test run. Returns a result_class() instance.commit — Save the test results. Should be called after all tests have run.apply_switch — Apply a list of switch options to the state, updating the internal object state as a result. Nothing is returned.
$self->apply_switch('failed,save');
Diagnostics: “Illegal state option: %s”
last — Run in the same order as last timefailed — Run only the failed tests from last timepassed — Run only the passed tests from last timeall — Run all tests in normal orderhot — Run the tests that most recently failed firsttodo — Run the tests ordered by number of todosslow — Run the tests in slowest to fastest orderfast — Run test tests in fastest to slowest ordernew — Run the tests in newest to oldest orderold — Run the tests in oldest to newest ordersave — Save the state on exitget_tests — Given a list of args, get the names of tests that should runobserve_test — Store the results of a testsave — Write the state to a fileload — Load the state from a fileGenerated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-16 09:06 @2600:1f28:365:80b0:7cb9:fb:26c1:e368
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)