testing

Ovid publiustemp-londonpm at yahoo.com
Mon Nov 3 17:29:43 GMT 2008


--- On Mon, 3/11/08, Dave Cross <dave at dave.org.uk> wrote:
 
>   It's recommended that you run use_ok() inside a BEGIN
> block so its
>   functions are exported at compile-time and prototypes are
> properly
>   honored.

I would recommend that people *not* do that, but instead put their 'use_ok' statements in a single test.  I get tired of seeing 'use_ok $module or die' getting needlessly duplicated throughout a test suite, particularly since it's so easy to get wrong.

Here's a basic test script to find all modules and ensure you can use them:

  http://use.perl.org/~Ovid/journal/37797

Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6






More information about the london.pm mailing list