On Sat, Apr 21, 2001 at 08:10:43AM +0100, Michael G Schwern wrote:
> On Fri, Apr 20, 2001 at 08:55:53AM -0400, barries wrote:
> > Below's a patch that adds #line support to Pod::Tests, making it easier
> > to find the original line the test is on. This makes output from
> > SelfTest trivial.
>
> Thanks! This will have to wait until the end of the month, I've got
> TPC deadlines to meet. :(
Rats, SelfTest benefits greatly from the #line stuff (and there's a
trivial bugfix in there for when there are no tests or (more likely) no
examples.
Anyway, you mentioned previously that you wanted to cover new modules
like SelfTest a bit. One key tweak to SelfTest is that it will only run
tests if "-c" is on the comman line:
perl -c lib/Foo/Bar.pm
This allows it to be much lighter weight and have a simpler API (no need
for environment vars and fewer options to pass via C<use>).
SelfTest.pm now looks like (sans POD):
$VERSION=0.02 ;
use SelfTest ( test_file => "t/selftest.t" ) ;
BEGIN {
if ( $^C ) {
require SelfTest::Heavy ;
*SelfTest::import = \&SelfTest::Heavy::import ;
}
}
1 ;
which is about as lightweight as I can make it. Miniscule bloat and
loading time, probably needs a "require 5.005" due to the $^C
dependancy.
- Barrie