I made some changes in a mod in cpan, P, and upgraded the test module as well.

During devel, and in the first 1.1.0 release I found 2 probs that I tried to check for at the beginning of the test. Problem 1 is if I have PERL5OPT set in my env with a -CSA.

First workaround was to try to unset it at the beginning of the test (ENV{PERL5OPT}=undef): No effect.

Next thing I tried was checking if it was defined and if so, printing an error to STDERR and dying, but in a compile in cpan just now, it didn't die on each test (which it should have if it checked for that value -- it only died on the one test that it affected:

# Failed test 'test mixed digit string' # at t/P.t line 109. # Looks like you failed 1 test of 27. t/P.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/27 subtests Test Summary Report ------------------- t/P.t (Wstat: 256 Tests: 27 Failed: 1) Failed test: 27 Non-zero exit status: 1 Files=1, Tests=27, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.58 cusr + 0.14 csys = 0.75 CPU) Result: FAIL Failed 1/1 test programs. 1/27 subtests failed.

Compare that to what happens if I run make test:

bin/lib/P> make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Har +ness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib +', 'blib/arch')" t/*.t t/P.t .. 1/28 ***************************************** ***************************************** ***************************************** * Please unset PERL5OPT in your ENV * ***************************************** ***************************************** ***************************************** # Looks like you planned 28 tests but ran 2. # Looks like your test exited with 255 just after 2. t/P.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 26/28 subtests Test Summary Report ------------------- t/P.t (Wstat: 65280 Tests: 2 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 28 tests but ran 2. Files=1, Tests=2, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.02 cusr + 0.01 csys = 0.07 CPU) Result: FAIL Failed 1/1 test programs. 0/2 subtests failed. make: *** [test_dynamic] Error 255
I.e. most or all of the tests should fail.

2nd problem has to do with a needed pre-req, 'mem.pm'. While it is in my Makefile.PL, and ends up in the META files (my meta, yml, json..). Similar prob -- in that
1) it isn't pulling in the pre-req. So, in P.t (1.1.1), I
2) checked for it, tried to run cpan to install it if it was missing, and if it couldn't -- then die with fat error message like above -- same prob, it acts like it completely circumvents my check for the pre-req, but only sometimes! (somewhere along the line, a "use 5.12.0" got inserted in the test program (not sure how or why). So instead of this check code:

BEGIN{ eval {require mem }; if ($@ && $@ =~ /Can't locate mem/) { # attempt to install via cpan my $inst=`cpan -i mem`; $inst =~ /PASS/ || do { die "\n*****************************************\n". "*****************************************\n" . "*****************************************\n" . "* Cannot install mem via cpan: BIGFAIL*\n". "*****************************************\n" . "*****************************************\n" . "*****************************************\n"; }; } }
I see, In 5.12 or above:
Output from '/usr/bin/make test': PERL_DL_NONLAZY=1 /home/sand/src/perl/repoperls/installed-perls/perl/v +5.12.5/a2da/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" + "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/a +rch')" t/*.t Can't locate mem.pm in @INC (you may need to install the mem module) ( +@INC contains: /tmp/loop_over_bdir-23652-1RDoLF/P-1.1.1-ll8YPM/blib/l +ib /tmp/loop_over_bdir-23652-1RDoLF/P-1.1.1-ll8YPM/blib/arch /etc/per +l /usr/local/lib/perl/5.18.1 /usr/local/share/perl/5.18.1 /usr/lib/pe +rl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/loc +al/lib/site_perl .) at lib/P.pm line 147. BEGIN failed--compilation aborted at lib/P.pm line 147. # Failed test 'received testcase 1' # at t/P.t line 135. Use of uninitialized value $rstr in pattern match (m//) at t/P.t line +136. # Failed test at t/P.t line 136. Can't locate mem.pm in @INC (you may need to install the mem module) ( +@INC contains: /tmp/loop_over_bdir-23652-1RDoLF/P-1.1.1-ll8YPM/blib/l +ib /tmp/loop_over_bdir-23652-1RDoLF/P-1.1.1-ll8YPM/blib/arch /etc/per +l /usr/local/lib/perl/5.18.1 /usr/local/share/perl/5.18.1 /usr/lib/pe +rl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/loc +al/lib/site_perl .) at lib/P.pm line 147. BEGIN failed--compilation aborted at lib/P.pm line 147. # Failed test 'received testcase 2' # at t/P.t line 135. Use of uninitialized value $rstr in pattern match (m//) at t/P.t line +136. .... Test Summary Report ------------------- t/P.t (Wstat: 6400 Tests: 27 Failed: 25) Failed tests: 3-27 Non-zero exit status: 25 Files=1, Tests=27, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.11 cusr + 0.01 csys = 0.14 CPU) Result: FAIL Failed 1/1 test programs. 25/27 subtests failed. make: *** [test_dynamic] Error 25 ------------------------------ PREREQUISITES ------------------------------ Prerequisite modules loaded: requires: Module Need Have ------------------- ------ -------- mem v0.3.2 0.3.2 Test::Simple 0.44 1.001002 build_requires: Module Need Have ------------------- ------ -------- mem v0.3.2 0.3.2 configure_requires: Module Need Have ------------------- ------ -------- ExtUtils::MakeMaker 0 6.83_01
Say what? How can mem be missing and yet the PREREQ's claim it is loaded?

Not only did it not show the error, if it wasn't loaded, but it then claimed it WAS both "not found", yet loaded.

I dunno, but doesn't that violate causality or some quantum law or is that like the cat being both alive and not alive at the same time? ???

Very confused....
Linda, still diddling in perl...


In reply to cpan mod test probs by perl-diddler

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.