in reply to Inner workings of "make test"

Perhaps try make distclean and then make.

You can step in to that particular test using: make testdb TEST_FILE=t/Chart-Scientific.t But it looks more like a rebuild is in order.

When you run through make, you're picking up the package from 'blib/lib', 'blib/arch'. Kinda like calling perl -Iblib/lib -Iblib/arc t/Chart-Scientific.t The packages are stored in blib for testing and verification. They are only moved to your real perl package directory after you do an install.

OTOH, when you call perl t/Chart-Scientific.t you are picking the package up from your perl lib path. (whatever that is.) perl -V will tell you.


"Look, Shiny Things!" is not a better business strategy than compatibility and reuse.


OSUnderdog

Replies are listed 'Best First'.
Re^2: Inner workings of "make test"
by kesterkester (Hermit) on Dec 03, 2004 at 18:21 UTC

    I'm still getting the same errors after doing a make distclean. Hmmm...

    It looks like a a library isn't being seen, but I don't understand why it works from the command line. Does make test have a different library environment than straight perl?

      YES. Here is an example. I created a simple ( h2xs -XA FOO ) package (no XS) and ran make -n testdb TEST_FILE=t/1.t the -n tells make to report what it would do if it were to run (which it doesn't)

      $make -n testdb TEST_FILE=t/2.t /nfs/mu/apps/perl/5.8.4/bin/perl "-MExtUtils::Command" -e mkpath \ blib/lib blib/lib/auto/FOO \ blib/arch/auto/FOO blib/bin \ blib/script blib/man1 \ blib/man3 chmod 755 \ blib/lib blib/lib/auto/FOO \ blib/arch/auto/FOO blib/bin \ blib/script blib/man1 \ blib/man3 touch blibdirs /bin/sh -c true /nfs/mu/apps/perl/5.8.4/bin/perl -MExtUtils::Install -e 'pm_to_blib({@ +ARGV}, '\''blib/lib/auto'\'', '\'''\'')' \ FOO.pm blib/lib/FOO.pm touch pm_to_blib /bin/sh -c true /bin/sh -c true /bin/sh -c true /bin/sh -c true PERL_DL_NONLAZY=1 /nfs/mu/apps/perl/5.8.4/bin/perl -d "-Iblib/lib" "-I +blib/arch" t/2.t

      Notice the last line:

      PERL_DL_NONLAZY=1 /nfs/mu/apps/perl/5.8.4/bin/perl -d "-Iblib/lib" "-Iblib/arch" t/2.t

      This calls perl with blib/lib and blib/arch ahead of everything else in the @INC list of package directories to search. This will ensure that the package(s) you are testing are picked up before whatever else is in @INC.

      For example, heres a test that will report what @INC has:

      # Before `make install' is performed this script should be runnable wi +th # `make test'. After `make install' it should work as `perl 1.t' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; print join("\n", @INC); ok(1);

      Now when I run this using the make:

      $make testdb TEST_FILE=t/2.t PERL_DL_NONLAZY=1 /nfs/mu/apps/perl/5.8.4/bin/perl -d "-Iblib/lib" "-I +blib/arch" t/2.t Reading ~/.perldb options. Loading DB routines from perl5db.pl version 1.25 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. 1..1 main::(t/2.t:10): print join("\n", @INC); DB<1> c blib/lib blib/arch /home/memyselfandi/lib /foo/apps/perl/5.8.4/lib /foo/sdk/perl/5.8.4/sitelib/prod/lib /foo/foofoo/corplib/gcc331/prod/perllib/lib .ok 1 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. DB<1> q

      "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.


      OSUnderdog