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 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.187.130 with SMTP id l124mr1888525iof.129.1505978114723; Thu, 21 Sep 2017 00:15:14 -0700 (PDT) X-Received: by 10.36.7.207 with SMTP id f198mr120itf.13.1505978114685; Thu, 21 Sep 2017 00:15:14 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer01.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!126no162563itl.0!news-out.google.com!194ni122itf.0!nntp.google.com!126no162559itl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 21 Sep 2017 00:15:14 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.218.37.33; posting-account=W2gdXQoAAADxIuhBWhPFjUps3wUp4RhQ NNTP-Posting-Host: 76.218.37.33 References: <9298d1ba-cce4-460c-900a-f84a35c8be2d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: AUnit question From: Stephen Leake Injection-Date: Thu, 21 Sep 2017 07:15:14 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 2660102466 X-Received-Bytes: 2812 Xref: news.eternal-september.org comp.lang.ada:48193 Date: 2017-09-21T00:15:14-07:00 List-Id: 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.