comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: AUnit question
Date: Thu, 21 Sep 2017 00:15:14 -0700 (PDT)
Date: 2017-09-21T00:15:14-07:00	[thread overview]
Message-ID: <c6870375-92f7-4555-b7a2-0d7c7d229a7a@googlegroups.com> (raw)
In-Reply-To: <opu6t2$12cn$1@gioia.aioe.org>

On Wednesday, September 20, 2017 at 12:01:26 PM UTC-5, Victor Porton wrote:
> Stephen Leake wrote:
> 
> > On Tuesday, September 19, 2017 at 5:47:38 PM UTC-5, Victor Porton wrote:
> >> I need to pass certain directory from command line to AUnit test cases.
> >> 
> >> So I can create an extension type derived from Test_Suite and store the
> >> command line argument into a field in the extension.
> > 
> > I do this via a discriminant in Test_Case; why do you want to put it in
> > Test_Suite?
> 
> I want to put it into Test_Suite because otherwise I would need to specify 
> over and over again the same parameter for every Test_Case. This makes the 
> listing somehow longer.
> 
> I decided to make a patch for AUnit which would do the following:
> 
> - Create new private tagged type Test_Environment.
> 
> - Add "Environment: access Test_Environment'Class := null" parameter to 
> Add_Test procedure.
> 
> - Add Environment field or discriminant also to Test_Suite. It will be set 
> by default (when Environment parameter is null) to a Test_Case when using 
> the null Environment for it.
> 
> -- 
> Victor Porton - http://portonvictor.org

That sounds reasonable.

You could also have a package Test_Environment, that all your test programs use for things like this. It could declare an Unbounded_String for this directory name, which you set in your test driver.

Hmm. If you are running multiple Test_Suites, each with a different environment, that would not work; you'd need a map on suite_id, or something.

  reply	other threads:[~2017-09-21  7:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ops6q5$1omp$1@gioia.aioe.org>
2017-09-20 16:17 ` AUnit question Stephen Leake
2017-09-20 17:01   ` Victor Porton
2017-09-21  7:15     ` Stephen Leake [this message]
2014-08-04 11:28 Victor Porton
2014-08-04 15:52 ` Simon Wright
replies disabled

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