tap/perl: handle missing or non-executable scripts better
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 2 Feb 2012 13:51:59 +0000 (14:51 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 2 Feb 2012 19:21:52 +0000 (20:21 +0100)
commit2077a04427bae2945635bf870817b3e21aae5f4d
tree4a9508e02fb91f53e0a16f82d021d5c5b9c7c9eb
parentdde91c5484e045882198d656fcfda7e9c11d7858
tap/perl: handle missing or non-executable scripts better

This change improves how our Perl-based TAP driver handles
non-runnable test scripts (meaning they might be not executable,
or not readable, or even not exist).  In particular, it makes the
driver deterministically display a clear "ERROR" result instead
of possibly dying with diagnostic from 'TAP::Parser' internals,
and prevents it from displaying spurious "missing TAP plan" errors.

Moreover, with this change, some testsuite failures present only
with newer perl versions (e.g., 5.14) are fixed.  See automake
bug#10418.

* tests/tap-bad-prog.tap: When testing the perl implementation of
the TAP driver, and when the perl interpreter offers a good-enough
'IPC::Open3::open3' function, expect it not to display spurious
"missing TAP plan" diagnostic if the error is actually due to a
non-runnable test script.
* lib/tap-driver.pl (start): Removed, broken up into ...
(setup_io): ... this ...
(setup_parser): ... and this, which now tries to catch and report
errors in launching the test scripts.
(finish): New, used by both 'main' and 'setup_parser'.
(main): Adjust.
lib/tap-driver.pl
tests/tap-bad-prog.tap