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

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

by sundialsvc4 (Abbot)
on Jul 18, 2011 at 03:45 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2020-07-03 23:39 GMT
Find Nodes?
    Voting Booth?

    No recent polls found