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

I am using prove with following config:
prove v1.04, using Test::Harness v2.56 and Perl v5.8.8

I have just started using prove and my question is how to count the number of test cases in my test file?
The --count option is not available with my version of prove.

Replies are listed 'Best First'.
Re: prove v1.04 question
by Anonymous Monk on Sep 07, 2012 at 03:18 UTC
    upgrade  cpanp -i App::Prove
      Unfortunately I do not have that choice.
      I have to work with what I have :)

        Are you able to install a current version of prove into your own home directory? There are options to do that.

        --MidLifeXis

      A reply falls below the community's threshold of quality. You may see it by logging in.
Re: prove v1.04 question
by philiprbrenan (Monk) on Sep 07, 2012 at 15:25 UTC

    You could try:

    $Test->no_plan;

    and then run prove: it will count the number of tests for you. Eventually when you have finished, I would urge you to remove the no_plan and substitute the actual number. A further possibility would be to use:

    scalar $Test->summary;

    at the end of each test script to count the number of tests in that script, possibly writing it to a file etc if there are a lot to be summed over. again the caveat about replacing no_plan with the actual number.