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 do the right thing (run it, syntax highlight it,
whatever).

For test scripts and other executables, I use:

#!/usr/bin/perl

For .pm files, I just put

#!perl

> * 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 convention in running tests is to use the 'prove' command;

prove t/01_class.t

That should take care of blib for you.

> * Should a test script make any assumptions about the
> CWD?

It's expected that a test script will be executed from the package's root
directory, where the Makefile.PL etc reside.

> Is it fair/safe for the test script to change directories?

Yes. Typically, each test script runs as it's own process, so if it changes
directories, it only affects that one test file and not the others. It would
probably be nice of the test script to only change to directories inside
it's packages root, as opposed to snooping around the harddrive of whomever
is doing the testing.

> * What's the best practice for testing-only libraries?
>  Where do they go and how do you load them?  Is there
> a naming convention that most people follow (e.g.
> t::Foo::Bar).

I don't know. If there is that could be far more convienent than what I do.
I usually use My::Package::Test::blah.

        - Tyler

Reply via email to