Test-More / Test2-Harness

Alternative to Test::Harness
Other
23 stars 26 forks source link

Avoid Bareword "POSIX::WNOHANG" error in Debug.pm #251

Closed toddr closed 2 years ago

toddr commented 2 years ago

Otherwise you get an error when the code is used on 5.36: Bareword "POSIX::WNOHANG" not allowed while "strict subs" in use at...

toddr commented 2 years ago

A little more context here... I got this error while building our package stack. Specifically it went off in t/test.t for Test2-Harness-Renderer-JUnit. What's super wierd is that it only failed on some platforms which makes absolutely no sense. The actual failure was:

[2022-07-06 19:35:24] LOG           # Failed test 'Exit Value Check'
[2022-07-06 19:35:24] LOG           # at t/test.t line 66.
[2022-07-06 19:35:24] LOG           # +-------+----+-------+
[2022-07-06 19:35:24] LOG           # | GOT   | OP | CHECK |
[2022-07-06 19:35:24] LOG           # +-------+----+-------+
[2022-07-06 19:35:24] LOG           # | 65280 | eq | 0     |
[2022-07-06 19:35:24] LOG           # +-------+----+-------+
[2022-07-06 19:35:24] LOG           # Failed test 't/test-ok/pass-1.tx'
[2022-07-06 19:35:24] LOG           # at t/test.t line 55.
[2022-07-06 19:35:24] LOG           # +-------------------------------+----+-------------------------------+
[2022-07-06 19:35:24] LOG           # | GOT                           | OP | CHECK                         |
[2022-07-06 19:35:24] LOG           # +-------------------------------+----+-------------------------------+
[2022-07-06 19:35:24] LOG           # | Bareword "POSIX::WNOHANG" not | =~ | (?^:\(\ PASSED\ \).*t\/test\- |
[2022-07-06 19:35:24] LOG           # |  allowed while "strict subs"  |    | ok\/pass\-1\.tx)              |
[2022-07-06 19:35:24] LOG           # | in use at /usr/local/cpanel/3 |    |                               |
[2022-07-06 19:35:24] LOG           # | rdparty/perl/536/cpanel-lib/A |    |                               |
[2022-07-06 19:35:24] LOG           # | pp/Yath/Options/Debug.pm line |    |                               |
[2022-07-06 19:35:24] LOG           # |  213.\n                       |    |                               |
[2022-07-06 19:35:24] LOG           # | Compilation failed in require |    |                               |
[2022-07-06 19:35:24] LOG           # |  at /usr/local/cpanel/3rdpart |    |                               |
[2022-07-06 19:35:24] LOG           # | y/perl/536/cpanel-lib/App/Yat |    |                               |
[2022-07-06 19:35:24] LOG           # | h/Options.pm line 134.\n      |    |                               |
[2022-07-06 19:35:24] LOG           # | BEGIN failed--compilation abo |    |                               |
[2022-07-06 19:35:24] LOG           # | rted at /usr/local/cpanel/3rd |    |                               |
[2022-07-06 19:35:24] LOG           # | party/perl/536/bin/yath line  |    |                               |
[2022-07-06 19:35:24] LOG           # | 261.\n                        |    |                               |
[2022-07-06 19:35:24] LOG           # +-------------------------------+----+-------------------------------+
[2022-07-06 19:35:24] LOG           # Failed test 't/test-ok/pass-2.tx'
[2022-07-06 19:35:24] LOG           # at t/test.t line 60.