develooper Front page | perl.perl5.porters | Postings from November 2003

Re: [PATCH 5.8.2 @21574] make tests relocatable

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
November 13, 2003 16:07
Subject:
Re: [PATCH 5.8.2 @21574] make tests relocatable
Message ID:
20031114000652.GC7943@localhost.comcast.net
On Thu, Nov 13, 2003 at 01:32:32PM -0800, Ilya Zakharevich wrote:
> On Thu, Nov 13, 2003 at 09:21:38PM +0000, Alan Burlison wrote:
> > Shouldn't the entire BEGIN block just be ripped out from all the tests 
> > rather than being modified?  According to TestInit.pm:
> > 
> > # This is a replacement for the old BEGIN preamble which heads (or
> > # should head) up every core test program to prepare it for running.
> > # Now instead of:
> > #
> > # BEGIN {
> > #   chdir 't' if -d 't';
> > #   @INC = '../lib';
> > # }
> > #
> > # t/TEST will use -MTestInit.  You may "use TestInit" in the test
> > # programs but it is not required.
> 
> It is crucial that an individual test can be run without the
> intervention of TEST:
> 
>   ./perl t/op/stat.t
> 
> to provide as small "Perl-related environment" as possible.  E.g.,
> consider line-ending bugs;  if
> 
>   ./perl t/TEST op/stat.t
> 
> fails, I do not know whether I should debug t/TEST, or t/op/stat.t.

You can do 

	./perl -MTestInit op/stat.t

I for one would be really happy if the ever expanding set of repeated
code necessary at the top of dual-life module tests could be reduced.


-- 
Michael G Schwern        schwern@pobox.com  http://www.pobox.com/~schwern/
Do not try comedy at home!  Milk & Cheese are advanced experts!  Attempts at
comedy can be dangerously unfunny!

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About