CC: | TODDR [...] cpan.org |
Subject: | t/no-all.t: Should SKIP unless IPC::System::Simple is installed |
As the test suite currently stands, there are two test files that are SKIPped if IPC::System::Simple is not installed.
#####
t/lex58.t ........................ skipped: IPC::System::Simple required
...
t/system.t ....................... skipped: IPC::System::Simple not installed
#####
t/no-all.t needs to be similarly SKIPped. Today I ran the test suite in an environment (Perl 7, it so happens) that does not have IPC-System-Simple installed. The result:
#####
$ p7prove -vb t/no-all.t
t/no-all.t ..
1..1
IPC::System::Simple required for Fatalised/autodying system() at t/no-all.t line 7.
BEGIN failed--compilation aborted at t/no-all.t line 7.
# Looks like your test exited with 2 before it could output anything.
Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/1 subtests
Test Summary Report
-------------------
t/no-all.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 1 tests but ran 0.
Files=1, Tests=0, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.05 cusr 0.00 csys = 0.08 CPU)
Result: FAIL
#####
The patch attached (which borrows code from similar test files) enabled t/no-all.t to be properly skipped in this IPC-S-S-less environment.
#####
$ p7prove -vb t/no-all.t
t/no-all.t ..
1..0 # SKIP IPC::System::Simple required
skipped: IPC::System::Simple required
Files=1, Tests=0, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.04 cusr 0.00 csys = 0.05 CPU)
Result: NOTESTS
#####
Please evaluate, apply and, at your earliest opportunity, issue a new CPAN release of autodie that includes this correction.
Thank you very much.
Jim Keenan
Subject: | t-no-all-skip-if-no-ipc-system-simple.diff |
6c6,13
< use Test::More tests => 1;
---
> use Test::More;
>
> BEGIN {
> eval "use IPC::System::Simple";
> plan skip_all => "IPC::System::Simple required" if $@;
> plan skip_all => "IPC::System::Simple 0.12 required"
> if $IPC::System::Simple::VERSION < 0.12;
> }
7a15
> plan ( tests => 1 );