Re: testing CPAN-ability without CPAN?

[email protected] ((Andreas J. Koenig))
Newsgroups perl.cpan.discuss
Message-ID <[email protected]>
>>>>> On Tue, 20 Dec 2005 08:43:20 -0800, Tyler MacDonald <[email protected]> said:

  > 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?

I'm not sure I can follow you, but did you consider

 @INC = ();

?

-- 
andreas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.