Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Test::Harness: Calling a script with proper @INC

by sundialsvc4 (Abbot)
on Jul 18, 2011 at 03:45 UTC ( [id://915067]=note: print w/replies, xml ) Need Help??


in reply to Test::Harness: Calling a script with proper @INC

What I have begun to do, in large test cases, is to insert logic at the beginning of each test file which sets-up the correct environment for that test file.   In other words, instead of putting the setup responsibility into “the wrapper,” so to speak, I push it down into some bit of common-code that all of the individual test files use or include.   “It just works out better that way,” one very nice feature being that tests can be run individually (they are Perl programs, after all...) or in a given harness, and everything works out the same way regardless.   The test files no longer depend upon “I am being run within this-or-that harness” (and I use the word “harness” loosely here).   They run consistently no matter how they are run.   (And, the necessary changes need only be done in one file or unit which they all reference.)

  • Comment on Re: Test::Harness: Calling a script with proper @INC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found