in reply to MakeMaker and multiple test directories

ExtUtils::MakeMakers WriteMakefile function takes
test => { TESTS => 't/*.t' },
as a parameter. You can set it to whatever, and the resulting makefile executes something like
C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, ' +blib\lib', 'blib\arch')" t\001_load.t ...
which may or may not agree with various shells (which have their own limits). I suggest you do kinda like Mail::Box does, and have a simple test.pl, one which uses Test::Harness to run the various test files in any way you please. Actually, something like the following is better:
#!/usr/bin/perl # file: test.pl use ExtUtils::Command::MM; @ARGV = qw[ mytests/01-load-This.t ... ]; test_harness( $ENV{TEST_VERBOSE} || 0, 'blib\lib', 'blib\arch');
Combine that with test => { TESTS => 'test.pl' }, and you've got gold ;)

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: MakeMaker and multiple test directories
by chromatic (Archbishop) on Jul 21, 2003 at 23:40 UTC

    Unfortunately, it's pyrite. CPAN ignores the return value of test.pl, so it will silently install modules for which the tests fail. You might as well not distribute tests in that case.

      Really? If that is true, it is still just a failing of CPAN, nothing less, nothing more. It does not invalidate the tests in any way (the tests are not there to stop cpan from installing a module).

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

        Oops, it's a MakeMaker problem.

        Still, I really don't see the point of running the tests if you're going to ignore the results. At least if people ran them and they failed, people could work with me to fix the errors. If you had to force installation if the tests fail, as you do with t/ tests, at least you know you might have trouble.

        Update: MakeMaker doesn't run test.pl through Test::Harness. Read the article.