1nickt has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to use prove --state=failed,save. But it seems to not work as documented.
The first thing that is unclear is whether "test" in the doc refers to individual tests, or to test files. So I tried it both ways.
At the urging of Bishop toolic I am posting here my test files and results.
With multiple tests in a single file:
$ rm .prove $ cat t/test.t use Test::More tests => 4; ok 1 == 1, 'A'; ok 1 == 2, 'B'; ok 1 == 1, 'C'; ok 1 == 2, 'D'; $ prove -v --state=save t/test.t t/test.t .. 1..4 ok 1 - A not ok 2 - B # Failed test 'B' # at t/test.t line 3. ok 3 - C not ok 4 - D # Failed test 'D' # at t/test.t line 5. # Looks like you failed 2 tests of 4. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/4 subtests Test Summary Report ------------------- t/test.t (Wstat: 512 Tests: 4 Failed: 2) Failed tests: 2, 4 Non-zero exit status: 2 Files=1, Tests=4, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.03 cusr + 0.00 csys = 0.06 CPU) Result: FAIL $ cat .prove --- generation: 1 last_run_time: 1519583552.87203 tests: t/test.t: elapsed: 0.0406849384307861 gen: 1 last_fail_time: 1519583552.87122 last_result: 3 last_run_time: 1519583552.87122 last_todo: 0 seq: 1 total_failures: 1 version: 1 ... $ prove -v --state=failed,save t/test.t t/test.t .. t/test.t .. 1..4 ok 1 - A not ok 2 - B # Failed test 'B' # at t/test.t line 3. ok 3 - C not ok 4 - D # Failed test 'D' # at t/test.t line 5. # Looks like you failed 2 tests of 4. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/4 subtests Test Summary Report ------------------- t/test.t (Wstat: 512 Tests: 4 Failed: 2) Failed tests: 2, 4 Non-zero exit status: 2 Files=1, Tests=4, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.02 cusr + 0.00 csys = 0.05 CPU) Result: FAIL $ cat .prove --- generation: 2 last_run_time: 1519583756.96688 tests: t/test1.t: elapsed: 0.0349948406219482 gen: 2 last_fail_time: 1519583756.96619 last_result: 3 last_run_time: 1519583756.96619 last_todo: 0 mtime: 1519583524 seq: 2 total_failures: 2 version: 1 ...
As you can see all four tests were run the second time as well as the first time. There also does not seem to be anything in the .prove file that records the outcome of the individual tests.
With multiple test files:
As you can see, again all four test files were run the second time as well as the first time. The only difference is that on the second run the failing test files were run first, and then the ones that had succeeded on the first run. Again, this is not the behaviour the documentation describes.
Any clues gratefully accepted, especially if you are using this feature yourself with success.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: prove --state=failed,save
by choroba (Cardinal) on Feb 25, 2018 at 20:27 UTC | |
by 1nickt (Canon) on Feb 25, 2018 at 23:35 UTC |