Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Testing Non-module code

by QM (Parson)
on Mar 16, 2004 at 19:50 UTC ( #337103=note: print w/replies, xml ) Need Help??


in reply to Testing Non-module code

I saw this on MJD's QOTW. See QOTW #14 Solution and the TestDupl.pm module. Maybe you can expound on this idea for your needs.

In summary:

Create a module (say YourTestModule), and in the INIT block calls a module sub that runs your tests, then exits (never actually running your program in full).

Run your tests by:

perl -MYourTestModule yourprogram
I'd be interested in comments as to the usefulness of this approach for "serious" code. (Or perhaps there's a better way that hasn't been mentioned yet?)

-QM
--
Quantum Mechanics: The dreams stuff is made of

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://337103]
help
Chatterbox?
[stevieb]: I'm working on hiding the fact the software needs MetaCPAN::Client, as I often have a hell of a time installing it. I'm going to change it to let the user know if they do revdep that it needs to be installed, and remove that distribution ..
[stevieb]: ...from being a prereq

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2017-06-25 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (572 votes). Check out past polls.