comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <mcondic.auntie.spam@acm.org>
Subject: Re: Suggestion for gnatstub
Date: Sat, 9 Nov 2002 09:50:29 -0500
Date: 2002-11-09T14:50:50+00:00	[thread overview]
Message-ID: <aqj7ca$44t$1@slb4.atl.mindspring.net> (raw)
In-Reply-To: x7vn0oizv5j.fsf@smaug.pushface.org

Well, yeah, but that's exactly what I *don't* want. I'd like a stub
generator that built something that would execute without raising an
exception. (Unless, of course, there was something else wrong with the code.
Id est, returning some default value that caused a calculation to go awry.)

I used to have a stub generator of my own that worked with Ada83 code.
Procedures simply had a "null ;" statement. Functions would declare a
temporary variable of the return type and to the extent that the tool could
figure out the kind of type it was, it provided an initial value to the
temporary. Then it just generated a "return Temp ;" statement. 99.9% of the
time, what it built was "Good Enough" for testing purposes. Occasionally,
you'd have to add some modifications by hand to get something usable as a
stub. But the point was, for getting a set of stubs built for
quick-and-dirty Smoke Testing, it saved a bunch of time. You could run your
main program and test its behavior and do iterative builds as you went
along.

Generating an exception instead is dramatically less useful. To be able to
successfully call the stub and move on with tests, you've got to hand modify
the code. Not impossible, but it does add labor.

MDC
--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jast.mil/

Send Replies To: m c o n d i c @ a c m . o r g

    "I'd trade it all for just a little more"
        --  Charles Montgomery Burns, [4F10]
======================================================================
Simon Wright <simon@pushface.org> wrote in message
news:x7vn0oizv5j.fsf@smaug.pushface.org...
>
> My ColdFrame framework generator goes to a lot of trouble to generate
> compilable subprograms that raise Program_Error if executed. I think
> there is one case where this doesn't work (functions returning a value
> of an imported type, eg GNAT.Socket_Type, that turns out to be
> private).





  reply	other threads:[~2002-11-09 14:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-08 11:14 Suggestion for gnatstub Victor Porton
2002-11-08 12:56 ` Marc A. Criley
2002-11-08 13:23   ` Marin David Condic
2002-11-08 21:09     ` chris.danx
2002-11-15 17:08       ` Wes Groleau
2002-11-15 17:35         ` Stephen Leake
2002-11-16 14:36         ` Marin David Condic
2002-11-09 14:15     ` Simon Wright
2002-11-09 14:50       ` Marin David Condic [this message]
2002-11-09 20:05         ` Simon Wright
2002-11-10 15:58           ` Marin David Condic
2002-11-10 20:31             ` Robert A Duff
2002-11-11 13:46               ` Marin David Condic
2002-11-11 15:31                 ` Robert A Duff
2002-11-11 20:32                   ` Randy Brukardt
2002-11-11  6:31             ` Simon Wright
2002-11-09 15:44       ` Robert A Duff
2002-11-09 20:08         ` Simon Wright
2002-11-09 21:56           ` Robert A Duff
2002-11-10  8:42             ` Pascal Obry
2002-11-10 12:20               ` Simon Wright
2002-11-10 16:04               ` Marin David Condic
2002-11-14 20:10               ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox