> -----Original Message-----
> From: Rene Schickbauer [mailto:rene.schickba...@gmail.com]
> Sent: Sunday, December 13, 2009 5:54 PM
> To: module-authors@perl.org
> Subject: Writing tests
> 
> Hi!
> 
> I'm currently writing some tests for my Maplat framework.
> 
> 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).
> 
> What is the reasonable response if one or both of them are not
> available during
> "make test"?
> 
> *) FAIL the tests?

Yes...

> *) SKIP the tests?

...unless you can make that dependencies optional.

Or, make memcached optional and skip the tests related to that and
abstract the DB interface to be able to use a more common and
easy to install module (maybe SQLite) and make postgres an optional and advanced
dep. and run the tests with the "lite" interface and use postgres only if it is 
available.

However, if you can't make some parts optional or strictly need postgres
then die() since there is no guarantee that your code works, without testing.

> *) DIAG("Warning") and skip the tests?
> 
> In my case, skipping the tests will probably exclude > 80% of the
> functionality, so what do i do? I probably can't just assume every
> cpantester
> has postgresql and memcached installed, can i?
> 
> LG
> Rene
> 
> --
> #!/usr/bin/perl # 99 bottles Wikipedia Edition
> $c=99;do{print "$c articles of wikipedia on the net,\n$c articles of
> wiki".
> "pedia,\ndiscuss one at length, delete it at will,\n".--$c." articles
> of ".
> "wikipedia on the net.\n\n";}while($c);print"So long & thx for the
> fish\n";

Reply via email to