Subject: | t/test.t fails if plackup is not in $ENV{PATH} |
On most of my smoker systems I see the following failure:
...
Use of uninitialized value $plackup in concatenation (.) or string at t/test.t line 19.
Failed to create daemon: 'execing into daemon
Error: daemon exited immediately at /home/cpansand/.cpan/build/2016100212/Ubic-1.60-haGt63/blib/lib/Ubic/Daemon.pm line 263.
' at /home/cpansand/.cpan/build/2016100212/Ubic-1.60-haGt63/blib/lib/Ubic/Daemon.pm line 414.
# Looks like your test exited with 255 before it could output anything.
t/test.t ..................
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 14/14 subtests
...
I think the problematic line in the test is the following one:
$plackup = which('plackup');
First, there's no check if $plackup is defined here; probably the test should be skipped if the program cannot be found. Then, there are many systems out there where a non-system perl is used without adjusting $PATH. This means the which("plackup") command here may find no plackup at all or a wrong one (belonging to the system perl, not to the currently used perl).
One possibility is to use $Config{scriptdir} here, and maybe only fallback to $PATH. But this won't help on smoker systems where distributions are only tested, but not installed. The solution here is more difficult; probably it's possible to check for all the blib/lib paths in @INC and add the corresponding blib/script paths to $ENV{PATH}.