Tyler MacDonald <[EMAIL PROTECTED]> wrote:
> > Aside from the suggestion from Thomas Klausner, you could subclass 
> > CPAN::Mini to do just that. Add Module::Dependency and you should get 
> > the system up and running rather quickly. I fact, it would probably be a 
> > really good idea to make the result availlable on CPAN as 
> > CPAN::Mini::Something. (Ask the modules list for a good namespace choice 
> > or #perl or Ricardo Signes, the author of CPAN::Mini.)

        I should mention also that what I'm ultimately after is something
like "cpans_ok" and "depends_ok" for unit tests. For the "depends_ok"
action, I'd want to test that when the dependancies are present, you get a
makefile (or buildfile), and when the dependancies are _not_ present, CPAN
picks up on that (which I'm guessing would involve overloading
CPAN::follow_prereqs).

        Of course, if you're to the point of unit testing a module, you're
either developing it, or your own CPAN has probably already followed_prereqs
for you... so there's got to be a way to "fake" the prereqs not being there
as well. *Ideally* (since Makefile.PL/Build.PL behaviour may differ if a
module is or isn't there), I'd like to fool perl into thinking that those
files aren't in @INC when they actually are. The best I've come up with for
solving that, is to create another directory tree with empty files with the
same names as the modules (tmp/Foo/Bar.pm, etc) and popping that onto
@INC... is there a better way to do this that doesn't involve creating a
bunch of stub files?

        Thanks,
                Tyler


> 
>       Heh, last night I created a new module 'Test::CPAN' in my CVS tree.
> I still hadn't figured out quite *how* I was going to test it though. I had
> gotten as far as:
> 
>       perl -MCPAN -e 'chdir("dev/DBIx-Transaction"); my $d =
> CPAN::Distribution->new(build_dir => "/home/faraway/dev/DBIx-Transaction",
> ID => "dev/DBIx-Transaction"); print $d->test'
> 
>       Which works great for Makefile.PL-based distributions, but if I want
> to unpack Module::Build-based distributions, I have to "./Build distdir"
> first, since CPAN.pm doesn't actually seem to know about Build.PL's...
> 
>       I've got a few personal programming hours before xmas to look into
> this further... hadn't considered pestering people in an IRC channel before,
> what network is it on? :)
> 
>               - Tyler
> 
>       
> 

Reply via email to