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

Re: [PATCH 5.8.2 @21574] make tests relocatable

Thread Previous | Thread Next
Michael G Schwern
November 13, 2003 21:56
Re: [PATCH 5.8.2 @21574] make tests relocatable
Message ID:
On Thu, Nov 13, 2003 at 09:32:01PM -0800, Ilya Zakharevich wrote:
> > This uses Config, File::Spec and
> > which in turn use more modules.  In the end, stat.t loads nine modules 
> > totalling 2381 lines of code (not including all the code in stat.t)
> > This is pretty typical for an op test.
> ..which is a lunacy.  IMO, op tests should not do this.  This makes it
> quite hard to find a minimal environment which manifests the bug.

Welp, we've been doing this for years and they sky is still up, the ground
still down and the tests run ok.  stat.t, for example, has been using 
File::Spec since Dec 2001. was introduced shortly after.

Without using things like File::Spec and Config in tests, they can't be
made portable.  Without using things like we can't write maintainable
tests.  When you test yourself with yourself you run into these interesting
bootstrapping problems.

After nearly two years of use without a serious bootstrapping problem, the 
current practice has proven itself robust.

The best thing that can be done to improve the op tests, from a minimal
environment standpoint, is to break the larger tests (like stat.t) down into 
a number of smaller more focused tests.  This, unfortunately, involves a lot 
of manpower and careful picking apart of the code.

Michael G Schwern
"May you eat three balanced meals a day and have healthful, regular bowel 
        -- Gimlet, son of Groin, "Bored of the Rings"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About