From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4821 invoked by alias); 24 Jun 2004 06:28:18 -0000 Mailing-List: contact xconq7-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: xconq7-owner@sources.redhat.com Received: (qmail 4794 invoked from network); 24 Jun 2004 06:28:16 -0000 Received: from unknown (HELO mail1.panix.com) (166.84.1.72) by sourceware.org with SMTP; 24 Jun 2004 06:28:16 -0000 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mail1.panix.com (Postfix) with ESMTP id 866A84870D; Thu, 24 Jun 2004 02:28:16 -0400 (EDT) Received: (from kingdon@localhost) by panix5.panix.com (8.11.6p2-a/8.8.8/PanixN1.1) id i5O6SGM04277; Thu, 24 Jun 2004 02:28:16 -0400 (EDT) Date: Thu, 24 Jun 2004 07:01:00 -0000 Message-Id: <200406240628.i5O6SGM04277@panix5.panix.com> From: Jim Kingdon To: mcdonald@phy.cmich.edu Cc: xconq7@sources.redhat.com In-reply-to: <1087997746.13930.115.camel@localhost.localdomain> (message from Eric McDonald on Wed, 23 Jun 2004 07:35:46 -0600) Subject: Re: Autotesting (was Re: RFC: Increment and Decrement) References: <1087800371.13930.32.camel@localhost.localdomain> <1087874495.13930.60.camel@localhost.localdomain> <200406220619.i5M6J6A20964@panix5.panix.com> <16600.208.442000.738922@lapjr.intranet.kiel.bmiag.de> <1087913659.13930.85.camel@localhost.localdomain> <200406221450.i5MEor012313@panix5.panix.com> <1087964259.13930.100.camel@localhost.localdomain> <200406230602.i5N623s12442@panix5.panix.com> <1087997746.13930.115.camel@localhost.localdomain> X-SW-Source: 2004/txt/msg00582.txt.bz2 > I do intend to look more closely at auto-testing at some point. It has > been on my list to do for some time. (Incidentally, I have used it > before: to verify the packed boolean tables implementation.) Oh yes, I remember. That's why I thought I might con you into writing more ;-). > 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). > might have to do a full init on the Xconq engine to make sure that > various crucial data structures and variables got initialized.... IOW, > potentially a pain. 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. Most systems I know which are more fully unit tested do some of each. As for where autotest.c stands, well, it hasn't really tackled these issues. It does a fairly normal xconq setup (using auto.g), and then it runs the tests in order (without resetting anything in between). 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. I could elaborate, but for now I'll just say that (a) to really get this working smoothly won't happen overnight, but (b) it is usually feasible to do it one step at a time, starting with those tests, or styles of tests, which are easy to write now and working up to the tests which are now hard.