Ken Williams wrote:

So, is there a workaround to force the use of the newer Test::Harness in "make test"?



That's a pain. You could probably do this:


make test PERL_ARCHLIB=/foo/darwin PERL_LIB=/foo



This doesn't quite work for me:


[localhost:~/Getopt-ArgvFile-1.06] fz% make test PERL_ARCHLIB=$PERL5LIB/darwin PERL_LIB=$PERL5LIB
make: *** No rule to make target `/Volumes/Unix/usrlocal/lib/perl5/darwin/Config.pm', needed by `Makefile'. Stop.



but it *does* work (thanks!) if I only set PERL_LIB:


[localhost:~/Getopt-ArgvFile-1.06] fz% make test PERL_LIB=$PERL5LIB
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/System/Library/Perl/darwin -I/Volumes/Unix/usrlocal/lib/perl5 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/base......ok


t/prefix....ok

All tests successful.
Files=2, Tests=7, 2 wallclock secs ( 0.81 cusr + 0.41 csys = 1.22 CPU)



(It even works with PERL_LIB=/dev/null, as long as I keep PERL5LIB in my environment. PERL_ARCHLIB, on the other hand, can't be changed because at some point the Makefile wants to set CONFIGDEP = $(PERL_ARCHLIB)/Config.pm (etc.))


However, this leaves me with two questions. First, can I hope this to always work? Or was it by special luck in this case that the tests didn't require anything from /System/Library/Perl (which is what the Makefile had PERL_LIB set to)? It looks like what we'd really need here is the ability to specify a library *path*, rather than just one directory...

Second, of course, I'd like ultimately to have CPAN do all this for me. Now I see that it lets me set "makepl_arg", "make_arg", "make_install_arg", but nothing like a "make_test_arg" :-( Is there a way?



If I were you, though, I'd just install Test::Harness into the standard /Library/Perl/ (Apple knows this is the location users will be installing modules into, that's what that directory is for), and install with

sudo make install UNINST=1

which will remove the ones in /System/Library/Perl/ .


That sounds like the voice of reason, to which I'll probably surrender :-) Still, if there is a way to segregate our stuff from Apple's -- to override it, rather than replace it -- I think it may be worth finding. After all, shouldn't non-sudoers be able to install modules that need the new Test::Harness?

Also it would simplify backups, provide a single switch to revert to the stock behavior (unsetenv PERL5LIB), and insure us against Apple or CPAN changing their minds about who owns /Library/Perl, /System/Library/Perl, or /usr/bin/head...


(It even works with PERL_LIB=/dev/null, as long as I keep PERL5LIB in my environment. Apparently the reason we can't also change PERL_ARCHLIB is that the Makefile uses it to set CONFIGDEP.)


    # Where is the Config information that we are using/depend on
    CONFIGDEP = $(PERL_ARCHLIB)/Config.pm $(PERL_INC)/config.h
)





Reply via email to