Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: code duplicate in tests -- code or custom module only needed to test

by hippo (Bishop)
on Dec 06, 2018 at 11:51 UTC ( [id://1226836]=note: print w/replies, xml ) Need Help??


in reply to code duplicate in tests -- code or custom module only needed to test

If you have dependencies which are required only by the tests then it is important to flag them as such. If you use ExtUtils::MakeMaker then TEST_REQUIRES is the key. This has the following benefits:

  • Users who don't want to run the tests do not end up downloading and installing modules they won't use (ie. if the test dependencies had been declared as main dependencies).
  • Users who can't successfully install the test dependencies can still run your module.
  • Your tests don't bloat the main code.

FWIW, I agree with Corion and haukex that option 1 is likely to be the best path.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-19 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found