-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Data::Dumper pure-perl tests #22896
Conversation
This is a follow-up to 67201d9, which reduced the number of tests without adjusting the skip count. Previously, testing without XS available resulted in: t/sortkeys.t .................. Dubious, test returned 255 (wstat 65280, 0xff00) All 22 subtests passed (less 13 skipped subtests: 9 okay) ... /sortkeys.t (Wstat: 65280 (exited 255) Tests: 24 Failed: 2) Failed tests: 23-24 Non-zero exit status: 255 Parse errors: Bad plan. You planned 22 tests but ran 24.
This is a follow-up to 5b50ddc, which added 4 tests without adjusting the skip count. Previously, testing without XS available resulted in: t/quotekeys.t ................. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 4/18 subtests (less 5 skipped subtests: 9 okay) ... t/quotekeys.t (Wstat: 65280 (exited 255) Tests: 14 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 18 tests but ran 14.
This is a follow-up to commit b5048e7, which added 'Deparse' support to XS, and commit 9baac1a, which added 'Useqq' support to XS. There are no longer any configuration settings that implicitly force the use of the pure Perl implementation (outside of 'Useperl' itself). Previously, testing without XS available resulted in: t/dumpperl.t .................. 1/31 Undefined subroutine &Data::Dumper::Dumpxs called at .../dist/Data-Dumper/blib/lib/Data/Dumper.pm line 213. # Looks like your test exited with 255 just after 10. t/dumpperl.t .................. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 21/31 subtests ... t/dumpperl.t (Wstat: 65280 (exited 255) Tests: 10 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 31 tests but ran 10.
This is a follow-up to b5048e7, which added 'Deparse' support to XS and made both XS and pure Perl testing mandatory. The other test files treat XS as optional, so this patch follows that pattern. (If we decide that the XS part of Data::Dumper is not optional, we should change all the other test files for consistency.) Previously, testing without XS available resulted in: t/deparse.t ................... Undefined subroutine &Data::Dumper::Dumpxs called at .../dist/Data-Dumper/blib/lib/Data/Dumper.pm line 213. # Looks like your test exited with 255 before it could output anything. t/deparse.t ................... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 16/16 subtests ... t/deparse.t (Wstat: 65280 (exited 255) Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 16 tests but ran 0.
This is a follow-up to 7d3a730, which fixed an out-of-bounds write in Dumpxs when passed invalid UTF-8. This test does not apply to the pure Perl implementation (which detects the invalid input and cleanly throws an error instead). Previously, testing without XS available would result in: t/bugs.t ...................... 1/24 Malformed UTF-8 character (fatal) at .../dist/Data-Dumper/blib/lib/Data/Dumper.pm line 587. # Looks like your test exited with 2 just after 6. t/bugs.t ...................... Dubious, test returned 2 (wstat 512, 0x200) Failed 18/24 subtests ... t/bugs.t (Wstat: 512 (exited 2) Tests: 6 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 24 tests but ran 6.
Is there any way I can build a perl where, for the purpose of testing Data::Dumper, I can simulate an environment where XS is not available? |
This is a bit of a hack, but:
Finally, when you're done, do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I don't see an easy way to request a pure-perl build.
If we had that it would make sense to add that to Porting/test-dist-module.pl
That is indeed a hack, because after running command #6 above, you don't have a Data::Dumper that the rest of the test suite ( |
Most of the tests in Data-Dumper were written under the assumption that the XS parts of the module may be unavailable. However, this part of the test suite hasn't seen much use in the last 15 or so years, so some of it has started failing. Some of this is due to outdated skip counts or assumptions that certain options force the use of the pure-perl implementation; these fail because tests were added/removed and the XS implementation has grown support for
Useqq
andDeparse
. In other cases, the test assumes that XS is always available.This PR updates the tests so they all pass even if XS is not available. (If instead we decide to make XS mandatory, we should remove all the "XS available?" checks from the tests to avoid further bit-rot of dead code.)