Nothing fancy, I just find myself copying this test into t/ directory of every new project so I thought others might find it useful, too.

Basically, it just runs Test::More's use_ok() on every file in the package's blib/lib directory to ensure that everything is building okay.

file: 000use.t

use Test::More; use File::Find; my @classes = (); my $root = 'blib/lib'; File::Find::find(

sub {

return unless $_ =~ /.pm$/;

my $path = $File::Find::name;

$path =~ s|^$root/||;

$path =~ s|.pm$||;

$path =~ s|/|::|g;

push @classes, $path;

},

$root

); ok( scalar( @classes ) > 0 ); foreach my $class ( @classes ) {

use_ok( $class );

} done_testing( scalar( @classes ) + 1 );







What's the first test you always write?