Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

prove v1.04 question

by cheekuperl (Monk)
on Sep 07, 2012 at 02:46 UTC ( #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.

Comment on prove v1.04 question
Select or Download Code
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 :)

        Unfortunately I do not have that choice. I have to work with what I have :)

        I laugh at you

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

        --MidLifeXis

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
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? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2014-07-23 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (140 votes), past polls