Michael G Schwern <[EMAIL PROTECTED]> writes: > >There's a chicken/egg problem here. blib.pm is going to find the lib/ >directory so we can load uninstalled modules. So... how do you find >blib.pm?
Same place one would have found TestInit.pm ? But I take you point. blib.pm is in perl core dist precisely so that extension modules can find it via perl's built-in INC. I have no real objection to t/TestInit.pm, I was just trying to avoid duplication. > >I believe the above worked for you because you happen to have an already >installed perl in the same spot as the new one is going to go. If you move >that out of the way, no good. > >Other problems include that we can't assume blib.pm works. Don't want the >whole basic test suite falling apart because of a module failure. > >Finally, since you have to run from t/ anyway, blib.pm is overkill. This >works just as well: > > cd t; ./perl -I../lib foo/bar.t > >Anyhow, t/TestInit.pm *already does this*. > >schwern@blackrider:/usr/local/src/perl-current$ ./perl -It -MTestInit -wle 'print >@INC; use Cwd; print cwd;' >.../lib >/usr/local/src/perl-current/t > >While the result is still ugly, it means we can expand and alter the >requirements for running a core test. For example, the PERL_CORE >environment variable should be set (t/TestInit.pm currently doesn't). So >the full command is really something like this: > > cd t; > PERL_CORE=1 ./perl -I../lib path/to/test.t > >Which could be reduced somewhat to: > > ./perl -It -MTestInit t/path/to/test.t > >and perhaps reduced a little further by moving/linking TestInit.pm into the >top level directory. > > ./perl -MTestInit t/path/to/test.t > >but that will cause trouble when running tests with -T (because . is no >longer in the path). > >When tests are run using t/TEST (ie. "make test") are run with TestInit. So >strictly speaking the BEGIN block is redundant. t/harness (ie. "make >test_harness") is currently not using TestInit. There's currently a bug >where $Test::Harness::switches is not honored. -- Nick Ing-Simmons http://www.ni-s.u-net.com/