Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
There's more than one way to do things
 
PerlMonks  

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

by sundialsvc4 (Monsignor)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2014-04-21 00:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (489 votes), past polls