On Sun, Dec 13, 2009 at 05:58:18PM +0000, Fergal Daly wrote:
> 2009/12/13 Rene Schickbauer <rene.schickba...@gmail.com>:
> >
> > Except for really simple tests, having PostgreSQL server and memcached
> > installed is quite essential (both cam be started as temporary instances if
> > required as long as the binaries are available).

You can also have a look at Test::Database. The module expects the tester
to have configured a database (where you can create and drop tables)
or a "driver" (where you can create and drop databases) for you.

It makes it easy to skip if no Postgres handle is available.

> - skipping them on such systems - I've had big arguments along these
> lines before, I think that declaring a "pass" having skipped important
> tests due to unsatisfied deps is a bad idea. Users expect a pass to
> mean a pass and will probably not even noticed skips whizzing past
> during an automated install. Ideally tests should only be skipped when
> they are irrelevant - e.g. windows only functions on a linux install.
> Skipping them for code that _will_ be called but can't be tested right
> now is worse than not testing that code at all - the user is left with

Maybe it's possible to declare N/A by trying to use Test::Database in
Makefile.PL / Build.PL and stop right there is Test::Database is not
installed or doesn't have a postgres handle available.

Of course, this assumes that at least some testers will have
Test::Database configured (this is a chicken and egg situation), which
reminds me I planned to email several Perl test-oriented mailing lists
about the module.

Maybe it's time for me to do that. :-)

-- 
 Philippe Bruhat (BooK)

 Your reputation is what you make of it... and what you choose to take with
 you.                               (Moral from Groo The Wanderer #48 (Epic))

Reply via email to