On Sat, Feb 17, 2001 at 10:55:29AM -0600, Jarkko Hietaniemi wrote:
> On Sat, Feb 17, 2001 at 10:22:13AM -0600, Jarkko Hietaniemi wrote:
> > > One additional point to consider and solve is the BEGIN 'preamble' we
> > > now add to each test to make certain we are in a known directory, and
> > > more importantly, that we are running the tests using *the* lib/ of
> > > the Perl we are building and not some other lib.  Having to add that
> > > preamble manually to the lib tests is clunky, but if I pull a new
> > > module release out of CPAN, the preamble is not there, so...
> > 
> > To clarify on this: if I had to make *no* changes at the module tests
> > at all, that would be nice.

Ya know, I was consider doing just that.  I noticed durning my
coverage run that some of the tests didn't chdir() into t/
automatically and thus caused problems.  I thought it would make sense
to stick a little "CoreTest.pm" into t/ and then have the tests use
that, but that would require altering every test (however, it could be
done incrementally).

A simpler idea would to alter t/TEST so that it runs the tests as
"perl -I../lib".  This isn't *quite* the same as @INC = '../lib', but
it should be close enough.

That's find for "make test" and "perl harness" runs, but direct 
"perl t/lib/sometest.t" runs will still break.  Well, I guess people will 
just have to be careful and remember to stick -Ilib in there.


> Sort of related to this is that it would be nice in general to be able
> just to "drop in" the modules: now there are all sorts of bits and
> pieces that are in the CPAN distributions, ChangeLogs, READMES, and
> the like, that are not included in the core version of the same.
> Maybe the correct way to do this would be to have some sort of
> 'corefier' script that takes a CPAN module and does the right magic
> to integrate the module to the core?

Well, assuming it behaves well under MakeMaker and doesn't have XS and
isn't something fancy like the stuff in ext/

  perl Makefile.PL INST_LIB=/path/to/src/perl/lib
  make test
  make install
  cp test.pl /path/to/src/perl/t/Module/Name.t if -e test.pl
  cp t/* /path/to/src/perl/t/Module/Name/ if -d t/

Something like that.  We'll probably just want to read the contents of
t/ out of MANIFEST instead to avoid getting derivative junk.  But you
get the idea.

Reply via email to