Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Test::Harness vs blib

by asarih (Hermit)
on Apr 14, 2005 at 20:59 UTC ( #447968=perlquestion: print w/replies, xml ) Need Help??

asarih has asked for the wisdom of the Perl Monks concerning the following question:

I have a test script for a module for which Test::Harness and blib give different results.

Here's what I get with Test::Harness (I edited Makefile for brevity):

$ make test verbose PERL_DL_NONLAZY=1 /opt/perl-5.8.6/bin/perl "-MExtUtils::Command::MM" " +-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/07-main.t t/07-main....dubious Test returned status 0 (wstat 11, 0xb) DIED. FAILED tests 8-9 Failed 2/9 tests, 77.78% okay Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/07-main.t 0 11 9 4 44.44% 8-9 Failed 1/1 test scripts, 0.00% okay. 2/9 subtests failed, 77.78% okay. *** Error code 2 make: Fatal error: Command failed for target `test_dynamic'
Note also that there seems to be some confusion about the number of failed tests (either 2 or 4).

And this is the output from blib:

$ PERL_DL_NONLAZY=1 /opt/perl-5.8.6/bin/perl -Mblib t/07-main.t 1..9 ok 1 - use IPC::Door::Client; ok 2 - use IPC::Door::Server; ok 3 - door_create() ok 4 - is_door, OO-version ok 5 - is_door, subroutine version ok 6 - info (pid), OO-version ok 7 - info (pid), subroutine version ok 8 - door_cred() ok 9 - door_call()
Could this be a bug in either Test::Harness or blib, or it's just my badly written module?

Update: Fixed the typo in "PERL_DL_NONLAZY" as pointed out below; the output is the same. I don't think I'm contaminating @INC, either. And if I run the test script (with Test::Harness) through the debugger, all the tests are successful.

$ make test TEST_VERBOSE=1 TEST_FILES=t/07-main.t PERL_DL_NONLAZY=1 /opt/perl-5.8.6/bin/perl "-MExtUtils::Command::MM" " +-e" "test_harness(1, 'blib/lib', 'blib/arch')" t/07-main.t t/07-main....1..9 ok 1 - use IPC::Door::Client; ok 2 - use IPC::Door::Server; ok 3 - door_create() ok 4 - is_door, OO-version ok 5 - is_door, subroutine version ok 6 - info (pid), OO-version ok 7 - info (pid), subroutine version dubious Test returned status 0 (wstat 11, 0xb) DIED. FAILED tests 8-9 Failed 2/9 tests, 77.78% okay Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/07-main.t 0 11 9 4 44.44% 8-9 Failed 1/1 test scripts, 0.00% okay. 2/9 subtests failed, 77.78% okay. *** Error code 2 make: Fatal error: Command failed for target `test_dynamic' $ /opt/perl-5.8.6/bin/perl -V Summary of my perl5 (revision 5 version 8 subversion 6) configuration: Platform: osname=solaris, osvers=2.10, archname=sun4-solaris uname='sunos asgard 5.10 generic sun4u sparc sunw,ultraax-e2 ' config_args='-Dcc=gcc -Duselargefiles -Dprefix=/opt/perl-5.8.6 -d' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultipl +icity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE + -D_FILE_OFFSET_BITS=64', optimize='-O', cppflags='-fno-strict-aliasing -pipe' ccversion='', gccversion='3.4.3 (csl-sol210-3_4-branch+sol_rpath)' +, gccosandvers='solaris2.10' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' ' libpth=/usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-fPIC', lddlflags='-G' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under solaris Compiled at Apr 13 2005 00:31:51 %ENV: PERL5LIB="/users/asari/perl/lib/site_perl" PERLDOC_PAGER="less -E" @INC: /users/asari/perl/lib/site_perl /opt/perl-5.8.6/lib/5.8.6/sun4-solaris /opt/perl-5.8.6/lib/5.8.6 /opt/perl-5.8.6/lib/site_perl/5.8.6/sun4-solaris /opt/perl-5.8.6/lib/site_perl/5.8.6 /opt/perl-5.8.6/lib/site_perl .

$ PERL_DL_NONLAZY=1 /opt/perl-5.8.6/bin/perl -d "-MExtUtils::Command:: +MM" "-e" "test_harness(1, 'blib/lib', 'blib/arch')" t/07-main.t Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): test_harness(1, 'blib/lib', 'blib/arch') DB<1> c t/07-main....1..9 ok 1 - use IPC::Door::Client; ok 2 - use IPC::Door::Server; ok 3 - door_create() ok 4 - is_door, OO-version ok 5 - is_door, subroutine version ok 6 - info (pid), OO-version ok 7 - info (pid), subroutine version ok 8 - door_cred() ok 9 - door_call() ok All tests successful. Files=1, Tests=9, 1 wallclock secs ( 0.29 cusr + 0.10 csys = 0.39 C +PU) Debugged program terminated. Use q to quit or R to restart, use O inhibit_exit to avoid stopping after program termination, h q, h R or h O to get additional info.

Update 2: Added readmore tags.

Replies are listed 'Best First'.
Re: Test::Harness vs blib
by brian_d_foy (Abbot) on Apr 14, 2005 at 23:58 UTC

    Let's see the full output from `make test TEST_VERBOSE=1`.

    That command line you typed out looks wrong. Surely it isn't "PEL_DL_NOLAZY" with a missing "R". Also, I wouldn't expect to find modules in blib, although I would expect them to end up in blib/lib (and notice that's where `make test` looks). Are you doing something odd with your distro or do you have 'blib/lib' put into @INC somehow?

    --
    brian d foy <brian@stonehenge.com>
      Ah, yes, that was a typo, but "PERL_DL_NONLAZY=1" gives the same output, unfortunately.
Re: Test::Harness vs blib
by Fletch (Bishop) on Apr 14, 2005 at 21:04 UTC

    Just a guess, but does this do any fork calls? Could be the same two tests are failing in the parent and in the child (under Test::Harness for whatever reason) which might explain the count of 4 failures in only two tests.

Re: Test::Harness vs blib
by PodMaster (Abbot) on Apr 15, 2005 at 01:49 UTC
    FYI, blib is not responsibe for any of that output (its t/07-main.t that's printing those ok's).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://447968]
Approved by ghenry
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2022-08-08 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?