Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

prove v1.04 question

by cheekuperl (Monk)
on Sep 07, 2012 at 02:46 UTC ( [id://992231]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://992231]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-19 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found