I've already done one for the Avery bug, since it's an obvious typo.
From a design and testing point of view (to talk on the actual topic of the mailing list) I think it also goes to show the benefit of doing an initial unit test script which does nothing but load all the modules in a distribution and make sure they compile and load cleanly.
Even if you do no other unit test scripts, at least you know there aren't any killer syntax errors.
And in the other unit tests, you can just C< use Module; > normally, without having to test it.
I've been doing this for about the last year now, and I've found it to work quite well.
01_compile.t ------------
#!/usr/bin/perl -w
# Load testing for CGI::Capture
use strict;
use lib ();
use File::Spec::Functions ':ALL';
BEGIN {
$| = 1;
unless ( $ENV{HARNESS_ACTIVE} ) {
require FindBin;
chdir ($FindBin::Bin = $FindBin::Bin); # Avoid a warning
lib->import( catdir( updir(), updir(), 'modules') );
}
}use Test::More tests => 2;
# Check their perl version ok( $] >= 5.006, "Your perl is new enough" );
# Does the module load
use_ok('CGI::Capture');exit(0);
----------------------------
That block at the top is to let the tests work inside my slightly unusual CVS layout. (I have a build_module.pl script to assemble stuff into the proper layout when releasing).
Adam
Rob Kinyon wrote:
This is actually kinda cool. Are you planning on submitting RT reports? *hint hint*
Rob
On Wed, 19 Jan 2005 04:02:46 +1100, Adam Kennedy <[EMAIL PROTECTED]> wrote:
Well... there's Zanas, which has
file.html.pm ------- <html></html> -------
And don't get me started on
file.gif.pm ------------------ (binary gif file) ------------------
Still haven't worked out what the hell they are for... :)
It's partly my fault for making the "what is a module" regex wrong.
Paper::Specs has used a code generator that doesn't escape properly, so half a dozen Paper::Specs::Avery::8XXX label modules die
description => "Avery 5 1/2" blah blah labels",
Of the ones that are my fault, we have gems like
tr [\$|\%|\&|\*] //g;
And one that got fixed...
$|=1;$::|=1;
Or Damian's use of @0 <-- that's a zero
Or the fact that <<1HERE1 is illegal per the docs, but does actually work.
Since it takes 4 or 5 minutes to nail down the exact fault location for each file, I haven't had time to get details on the rest, but it's mostly insanely ugly quote/regexs or fairly insane code in general that is causing the problems now, and I never said I'd support every single thing.
I've been uploading some autogenerated reports as well, to
http://ali.as/PPI/tinderbox/
So you can see there are a large number of modules uploaded with corrupted tarballs, or who have started using Build.PL without keeping the wrapper Makefile.PL for compatibility.
Adam
_______________________________________________ sw-design mailing list [email protected] http://metaperl.com/cgi-bin/mailman/listinfo/sw-design
