comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: ANN: Ahven 1.8
Date: Sat, 05 Jun 2010 00:08:03 -0400
Date: 2010-06-05T00:08:03-04:00	[thread overview]
Message-ID: <82ljauyvdo.fsf@stephe-leake.org> (raw)
In-Reply-To: d506859b-e891-4376-abec-dc2479f621d1@v12g2000prb.googlegroups.com

Dan <dan@irvine.com> writes:

> Ahven accepts parameterless procedures as test routines,
> such as the p1,p2,p3,q1,q2,q3 in my example.  AUnit, in contrast,
> requires test routines to have a parameter of type
> AUnit.Test_Cases.Test_Case'Class.  I have thousands of procedures that
> I would like to test using a test driver, but unfortunately not a
> single one of those comes in the form AUnit requires.

Ah. Adapting an existing test suite to use the framework is an issue.

You could write one AUnit test that calls all the thousands of tests,
but that would be silly.

You could probably write a tool to convert those tests to match AUnit,
but that would still be a lot of work.

> The problem is that Ada doesn't have a good way for one procedure to
> create other procedures, that can then be registered (using 'access).
> I tried using generics to instantiate the new test procedures, but ran
> into accessiblity-level problems.  I also tried using an allocator of
> a protected type that contains a procedure, but that results in a
> protected procedure, and AUnit only knows how to register normal
> (unprotected) procedures.

You need to write new source code. Real software writes itself :) (a new
slogan I just made up :).

> I presume that it may be possible to modify AUnit to support
> registering parameterless test procedures (or even better, an array of
> them), which would be convenient for my purposes.  

Not easy; the tests are called by the standard Ada dispatching call methods.

> It would also be possible to write some sort of offline test-generator
> that creates the kind of test procedures that AUnit expects.

Yes.

-- 
-- Stephe



  reply	other threads:[~2010-06-05  4:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-02 16:24 ANN: Ahven 1.8 Tero Koskinen
2010-06-03 12:08 ` Stephen Leake
2010-06-03 19:36   ` Dan
2010-06-03 19:43     ` Dan
2010-06-04  9:17     ` Stephen Leake
2010-06-04 15:37       ` Tero Koskinen
2010-06-05 12:41         ` Simon Wright
2010-06-05 19:17           ` Ludovic Brenta
2010-06-06 12:31             ` Stephen Leake
2010-06-06 16:20               ` Ludovic Brenta
2010-06-06 16:45                 ` Simon Wright
2010-06-06 17:48                   ` Ludovic Brenta
2010-06-07  8:26                 ` Stephen Leake
2010-06-07 19:21                   ` Simon Wright
2010-06-04 17:12       ` Dan
2010-06-05  4:08         ` Stephen Leake [this message]
2010-06-08 15:24 ` Jérôme Haguet
replies disabled

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