Ilya Zakharevich wrote: > Running the following script in the root of Perl distribution will fix most of > the tests in ./t to be relocatable. All it does is replace > > @INC = '../lib'; # and some clones thereof > > by > > @INC = '../lib' unless \$ENV{PERLTEST_KEEP_INC}; Shouldn't the entire BEGIN block just be ripped out from all the tests rather than being modified? According to TestInit.pm: # This is a replacement for the old BEGIN preamble which heads (or # should head) up every core test program to prepare it for running. # Now instead of: # # BEGIN { # chdir 't' if -d 't'; # @INC = '../lib'; # } # # t/TEST will use -MTestInit. You may "use TestInit" in the test # programs but it is not required. I'm not sure if harness also does the right thing though. Perhaps the simplest way of doing this is for TEST to set PERL5LIB by default, and allow an override, e.g. $ cd t; ./TEST # Sets PERL5LIB to '../lib' $ cd t; ./TEST -perl5lib=/foo # Sets PERL5LIB to '/foo' I'm also far from clear why each test script needs the chdir 't' if -d 't'; surely that only needs to be done once in TEST? If this is correct then *all* the BEGIN blocks *and* TestInit.pm could be done away with. -- Alan Burlison --Thread Previous | Thread Next