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 X-Received: by 10.58.195.202 with SMTP id ig10mr10660167vec.38.1400706510718; Wed, 21 May 2014 14:08:30 -0700 (PDT) X-Received: by 10.140.19.161 with SMTP id 30mr55780qgh.35.1400706510589; Wed, 21 May 2014 14:08:30 -0700 (PDT) Path: backlog3.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!hl10no3188450igb.0!news-out.google.com!gi6ni6673igc.0!nntp.google.com!hl10no3188447igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 21 May 2014 14:08:30 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=93.37.252.167; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 93.37.252.167 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <555cfef5-5cde-453f-a24c-0df108ce2979@googlegroups.com> Subject: Re: How to test a library? From: mockturtle Injection-Date: Wed, 21 May 2014 21:08:30 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.dca.giganews.com comp.lang.ada:186550 Date: 2014-05-21T14:08:30-07:00 List-Id: On Wednesday, May 21, 2014 9:34:46 PM UTC+2, Victor Porton wrote: > What is the correct way to test a (shared) library I am going to create? >=20 > I assume there are special libraries for unit tests or something like thi= s.=20 > Where to get more info on this? >=20 I know about AUnit that is available on the AdaCore site. If I remember co= rrectly, it is integrated in some way inside GPS. However, I never used it= since I use my own home-brew library suited for my own need. As a side note, I find it very convenient to have the test code being a pro= cedure that is a child of the tested package. For example, the test for pa= ckage foo.bar could be procedure Foo.Bar.Test is ... end Foo.Bar.Test; Of course, if you use GPS/GNAT you must register in the project file that f= oo-bar-test.adb is a main. In this way you have also the visibility of the internal details of your pa= ckage and sometimes (not often, at least in my experience) this is useful i= n testing. Also, I like this solution for its "cleanness," since the pack= age brings its own test with it... Riccardo