in reply to Re^2: Is prove's --ignore-exit flag incomplete or ignored?
in thread Is prove's --ignore-exit flag incomplete or ignored?
I think you'll find that --ignore-exit is indeed ignoring the exit value; however, it is not ignoring failed tests.
In "... our own code for generating the TAP output ...", you'll probably need to implement something along the lines of TODO or SKIP that Test::More provides which, in your code, ignores failed tests where that would be a valid thing to do.
Consider these four runs:
$ for i in exit_0_test_todo.t exit_1_test_todo.t; do cat $i; echo "--- +-------------"; prove --failures $i; echo "============"; prove --fai +lures --ignore-exit $i; echo "============"; done use strict; use warnings; use Test::More tests => 1; TODO: { local $TODO = 'WIP'; is 1, 0, 'Tickety-boo'; }; exit 0; ---------------- exit_0_test_todo.t .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.03 cusr + 0.06 csys = 0.12 CPU) Result: PASS ============ exit_0_test_todo.t .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.02 sys + 0.03 cusr + 0.06 csys = 0.12 CPU) Result: PASS ============ use strict; use warnings; use Test::More tests => 1; TODO: { local $TODO = 'WIP'; is 1, 0, 'Tickety-boo'; }; exit 1; ---------------- exit_1_test_todo.t .. 1/1 # Looks like your test exited with 1 just af +ter 1. exit_1_test_todo.t .. Dubious, test returned 1 (wstat 256, 0x100) All 1 subtests passed Test Summary Report ------------------- exit_1_test_todo.t (Wstat: 256 Tests: 1 Failed: 0) Non-zero exit status: 1 Files=1, Tests=1, 1 wallclock secs ( 0.03 usr 0.02 sys + 0.03 cusr + 0.06 csys = 0.14 CPU) Result: FAIL ============ exit_1_test_todo.t .. 1/1 # Looks like your test exited with 1 just af +ter 1. exit_1_test_todo.t .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.06 cusr + 0.03 csys = 0.12 CPU) Result: PASS ============
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Is prove's --ignore-exit flag incomplete or ignored?
by songmaster (Beadle) on Dec 21, 2020 at 20:42 UTC |