From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: AUnit question Date: Wed, 20 Sep 2017 20:01:23 +0300 Organization: Aioe.org NNTP Server Message-ID: References: <9298d1ba-cce4-460c-900a-f84a35c8be2d@googlegroups.com> NNTP-Posting-Host: YlTmPmf+i9DmLSFqhtVtHg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.14.10 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:48192 Date: 2017-09-20T20:01:23+03:00 List-Id: 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