sciurius / perl-Getopt-Long

Module Getopt::Long - extended processing of command line options
13 stars 17 forks source link

gol-load1.t, gol-load2.t: Need to be adapted for use in Perl core distribution #22

Closed jkeenan closed 1 year ago

jkeenan commented 1 year ago

In preparation for a monthly development release of Perl on November 20, I recently attempt to synch the latest CPAN release of Getopt-Long (2.56) into our main branch, 'blead.' Two recently added test files failed, preventing this synching from completing successfully.

Here is the output I'm getting from these two test files:

$ cd t; TEST_JOBS=1 ./perl harness -v ../cpan/Getopt-Long/t/gol-load1.t ../cpan/Getopt-Long/t/gol-load2.t; cd -
Can't locate strict.pm in @INC (you may need to install the strict module) (@INC entries checked: ../../lib ../../t) at t/gol-load1.t line 15.
BEGIN failed--compilation aborted at t/gol-load1.t line 15.
../cpan/Getopt-Long/t/gol-load1.t .. Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
../cpan/Getopt-Long/t/gol-load2.t .. Can't locate strict.pm in @INC (you may need to install the strict module) (@INC entries checked: ../../lib ../../t) at t/gol-load2.t line 14.
BEGIN failed--compilation aborted at t/gol-load2.t line 14.
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 

Test Summary Report
-------------------
../cpan/Getopt-Long/t/gol-load1.t (Wstat: 512 (exited 2) Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
../cpan/Getopt-Long/t/gol-load2.t (Wstat: 512 (exited 2) Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=2, Tests=0,  0 wallclock secs ( 0.00 usr +  0.00 sys =  0.00 CPU)
Result: FAIL

AFAICT the problem arises because, unlike older test files in t/, these two new test files are written in a more modern style (use strict; use warnings; use Test::More) that requires maintainers of dual-life modules to write BEGIN blocks assigning to @INC in a way that takes into better account the layout of the core distribution.

Pull request forthcoming which may correct this problem.

Thank you very much. Jim Keenan

jkeenan commented 1 year ago

I have created this branch in the Perl core repository: smoke-me/jkeenan/getopt-long-2.57-sync-20231111 which syncs in version 2.57 of Getopt-Long.

It turns out that I had to do some metadata-ish work in the core to accommodate, e.g., splitting up the code into two *.pm files. If you happen to maintain a git checkout of the perl5 respository, you might want to checkout that branch and run it through a simple make test_harness to spot any flaws in my work. Thanks.

sciurius commented 1 year ago

I cloned the repo and ran the Configure & make & make test_harness. It seems it went well.

jkeenan commented 1 year ago

I cloned the repo and ran the Configure & make & make test_harness. It seems it went well.

Thanks. Assuming no adverse smoke-testing results, I'll merge this into Perl 5 blead in a few days.