http://qs1969.pair.com?node_id=447968

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.