This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: Autotesting (was Re: RFC: Increment and Decrement)
- From: Eric McDonald <mcdonald at phy dot cmich dot edu>
- To: Jim Kingdon <kingdon at panix dot com>
- Cc: xconq7 at sources dot redhat dot com
- Date: Thu, 24 Jun 2004 14:34:31 -0400 (EDT)
- Subject: Re: Autotesting (was Re: RFC: Increment and Decrement)
On Thu, 24 Jun 2004, Jim Kingdon wrote:
> > I thought that I would probably have to figure out how to instantiate
> > a Lisp stream buffer [. . . etc etc etc and so on]
>
> Ah yes, but unfortunately for your excuse, this part was written years
> ago by Stan. There's a function in lisp.c called
> read_form_from_string which has all I needed to write a simple test
> (which I have now checked in).
I see. Thanks for popping the excuse bubble, __I guess. :-)
I will followup with some more tests, hopefully in the next few
days.
> I'm not sure it affects the lisp.c code, but in general, yeah, these
> kinds of global "crucial data structures and variables" are the bane
> of unit testing. There are basically two solutions: (1) make the code
> more modular, so it is easier to just set up the part you are testing,
> or (2) as part of the test code, have a bunch of helper methods which
> do various kinds of setup.
I agree with both solutions, and this is pretty much what has been
lurking in the back of my head, regarding what likely needed to be
done for better autotesting.
> Generally speaking, I had in mind moving towards a situation where
> each unit test blows away any state which might confuse it, and then
> sets up what it needs to run.
Yes, I completely agree with this goal.
Eric