On Thu, Apr 11, 2002 at 02:49:30PM -0500, Andy Lester wrote:
> > One simple way around this is to use SelfTest or Test::Inline and
> > throw in at the top of each of your modules:
> >
> >     =for testing
> >     use_ok('My::Self');
> >
> > and then just run the tests in each self-testing module in turn.
> 
> The bummer is that I'm not the only programmer, and I've had problems with
> .pm files being created that don't compile on their own.

Teach the other folks how to test. :)


> I want an automated test to File::Find thru the source tree and load
> up each .pm as it gets found, making sure it'll load on its own.

Ok:

    sub test {
        return unless /\.pm$/;
        print "# compiling $_\n";
        system(qq{$^X -e 'print eval { require "$_"; 1 } ? "ok\n" : "not ok\n"' });
    }

    use File::Find;
    find(\&test , shift || '.');

adjust as necessary.  Doesn't have to be fancy.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
sun readdened wheat stalks
bowing down in autumn sun
my mind wanders far
        -- stimps

Reply via email to