Test Script Best-Practices

2006-01-24 Thread Jeffrey Thalhammer
Greetings, I've noticed that CPAN authors use a variety of techniques to manipulate the run-time environment in their test scripts. Usually, it involves changing directories and/or altering @INC. This one seem pretty popular: BEGIN { if($ENV{PERL_CORE}) { #What is "PERL_CORE"?

Re: Test Script Best-Practices

2006-01-24 Thread chromatic
On Tuesday 24 January 2006 18:53, Jeffrey Thalhammer wrote: > Greetings, > > I've noticed that CPAN authors use a variety of > techniques to manipulate the run-time environment in > their test scripts. Usually, it involves changing > directories and/or altering @INC. This one seem pretty > popula

Re: Test Script Best-Practices

2006-01-24 Thread Tyler MacDonald
Jeffrey Thalhammer <[EMAIL PROTECTED]> wrote: > * Should a test script have a shebang? What should it > be? Any flags on that? It's not at all neccessary, but IMHO it is good form; it's a surefire way for anything else (HTTP server, IDEs, etc) to figure out that you're actually a perl script and

Re: Test Script Best-Practices

2006-01-24 Thread David Golden
Jeffrey Thalhammer wrote: * Should a test script have a shebang? What should it be? Any flags on that? I often see "-t" in a shebang. One downside of the shebang, though, is that it's not particularly portable. As chromatic said, with "prove" it's not really necessary. ("prove -t") *

Re: Test Script Best-Practices

2006-01-24 Thread Yitzchak Scott-Thoennes
On Tue, Jan 24, 2006 at 10:25:44PM -0500, David Golden wrote: > Jeffrey Thalhammer wrote: > >* Should a test script have a shebang? What should it > >be? Any flags on that? > > I often see "-t" in a shebang. One downside of the shebang, though, is > that it's not particularly portable. As chr

Re: Test Script Best-Practices

2006-01-25 Thread James E Keenan
Tyler MacDonald wrote: Jeffrey Thalhammer <[EMAIL PROTECTED]> wrote: [snip] * When run outside of 'make test', should the test script force modules to load from the distro's lib or blib directory by default? Or should it just load from the user's existing @INC (whatever it may be). The conv

Re: Test Script Best-Practices

2006-01-27 Thread Steffen Schwigon
James E Keenan <[EMAIL PROTECTED]> writes: > Tyler MacDonald wrote: >> The convention in running tests is to use the 'prove' command; >> prove t/01_class.t >> That should take care of blib for you. > > Not quite. You need to call the -b option to get prove to read from > blib. When I've been revi

Re: Test Script Best-Practices

2006-01-27 Thread James E Keenan
Steffen Schwigon wrote: Quite often -l (to read from lib/) is enough, depending on your module build complexity. For -b you have to call ./Build before "prove", which can be annoying and/or difficult to remember. I'll have to try that out. My modules all use MakeMaker rather than Module::Buil

Re: Test Script Best-Practices

2006-01-27 Thread Adam Kennedy
James E Keenan wrote: Steffen Schwigon wrote: Quite often -l (to read from lib/) is enough, depending on your module build complexity. For -b you have to call ./Build before "prove", which can be annoying and/or difficult to remember. I'll have to try that out. My modules all use MakeMaker ra

Re: Test Script Best-Practices

2006-01-28 Thread Matisse Enzer
On Jan 27, 2006, at 6:06 PM, James E Keenan wrote: Steffen Schwigon wrote: Quite often -l (to read from lib/) is enough, depending on your module build complexity. For -b you have to call ./Build before "prove", which can be annoying and/or difficult to remember. I'll have to try that out.