tomazos has asked for the wisdom of the Perl Monks concerning the following question:

Lets suppose you download a cpan module and it fails tests when you make test it. I understand the tests are kept it the t directory. Is there a general strategy for solving this? Is there a document somewhere describing the approach? How do you run tests individually rather than all at once? Can you do that from the command line? Is there a way to make test verbosely? etc.

-Andrew.


Andrew Tomazos  |  andrew@tomazos.com  |  www.tomazos.com

Replies are listed 'Best First'.
Re: make test failure stategy
by ysth (Canon) on Jul 13, 2005 at 11:55 UTC
    You can select which tests to run using
    make test TEST_FILES="t/foo.t t/bar.t t/baz*.t"
    (not sure which ExtUtils::MakeMaker version this requires; I believe it is undocumented).

    Verbose output is given by

    make test TEST_VERBOSE=1
    (should work for ExtUtils::MakeMaker version 5.53_01 and later, plus some earlier versions).

    Also, you could look at using the prove utility included with recent Test::Harness versions.

Re: make test failure stategy
by gellyfish (Monsignor) on Jul 13, 2005 at 12:05 UTC

    You can run the tests individually by hand (assuming there is no further magic in the Makefile) by doing:

    perl -Mblib t/whatever.t
    THis will almost certainly give you more verbose output as Test::Harness (for instance) will summarize the results.

    /J\

Re: make test failure stategy
by rinceWind (Monsignor) on Jul 13, 2005 at 12:50 UTC
    Besides the other suggestions, you might like to try the prove script that ships with recent releases of Test::Harness. See http://search.cpan.org/~petdance/Test-Harness-2.52/bin/prove

    --

    Oh Lord, won’t you burn me a Knoppix CD ?
    My friends all rate Windows, I must disagree.
    Your powers of persuasion will set them all free,
    So oh Lord, won’t you burn me a Knoppix CD ?
    (Missquoting Janis Joplin)