Shlomi Fish wrote:
> Hi all!
> 
> See http://xrl.us/sw5o for a recipe for integrating "make runtest" and "make 
> distruntest" targets into a Makefile.PL-generated Makefile that makes use of 
> Test::Manifest.
> 
> I needed that when working on XML::RSS, so I wrote it. 

What has me scratching my head here is why you're hacking in a new target for 
Test::Run rather than just overriding the test target using the much cleaner 
test_via_harness().  Either the author wants to use Test::Run or they don't.  
If the intention is for your own personal use while hacking other's modules, it 
seems much easier to simply have a prove command-line equivalent for running 
tests with Test::Run and Test::Manifest then to have to hack up each author's 
Makefile.PL.


As for the implementation, here's some notes to avoid MakeMaker land mines:

Your "perl" is hard coded.  You should be using $(PERLRUNINST) so that the 
tests run with the same perl used to run Makefile.PL.


You probably want to stash the bulk of the command line code off in a function 
somewhere like ExtUtils::Command::MM::test_harness() and 
Test::Manifest::run_t_manifest().  Long command lines mean portability problems.


This is not how you override methods in MakeMaker.  Its not backwards 
compatible and it pokes at the guts which are likely to move.

  sub ExtUtils::MM_Any::test_via_harness {

Instead, do this:

  {
      package MY;
      sub test_via_harness {
          ...
      }
  }

Reply via email to