Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Working with Test::Harness

by TStanley (Canon)
on Jan 11, 2005 at 15:58 UTC ( [id://421307]=perlmeditation: print w/replies, xml ) Need Help??

Recently, I decided to redo the tests for my modules by integrating them with Test::Harness and adding a check of the POD using Test::Pod. It definitely proved to be an eye opening experience, as I thought I had managed to cover my modules fairly well. In the end, I ended up adding about 10-12 additional tests between my three modules. I discovered this by dividing up my current tests into files, as well as looking through the module itself (which has convinced me that I really need to add comments to things, so that I can understand what it was that I wrote).

I was having a problem with Test::Harness at first, but a short email conversation with the maintainer cleared every thing up, so a big thanks to Andy for his help.

Overall, I am quite glad that I did this, as now everything is testing better, and when a test does fail, I get more information, so that I can troubleshoot easier.

TStanley
--------
The only thing necessary for the triumph of evil is for good men to do nothing -- Edmund Burke

Replies are listed 'Best First'.
Re: Working with Test::Harness
by stvn (Monsignor) on Jan 11, 2005 at 21:02 UTC

    Your next step should be to run your tests with Devel::Cover and see what you find. Have fun!!

    -stvn

      Here's a plug for Module::Build -- it now offers the "Build testpod" and "Build testcover" actions, which test your pod (with Test::Pod) or your coverage (with Devel::Cover) without your having to write any additional code beyond your ordinary tests in the t/ directory.

      -xdg

      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re: Working with Test::Harness
by demerphq (Chancellor) on Jan 11, 2005 at 18:05 UTC

    Im confused what you mean by "integrating them with Test::Harness".... Do you mean rewriting them so Test::Harness can understand the results and runs your test suite?

    ---
    demerphq

      What I did was to take my test.pl file and break out the tests into separate .t files inside the t directory.

      TStanley
      --------
      The only thing necessary for the triumph of evil is for good men to do nothing -- Edmund Burke

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://421307]
Approved by Old_Gray_Bear
Front-paged by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-26 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found