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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:aed:39e7:: with SMTP id m94mr4221946qte.0.1561558442976; Wed, 26 Jun 2019 07:14:02 -0700 (PDT) X-Received: by 2002:aca:f256:: with SMTP id q83mr1829204oih.99.1561558442498; Wed, 26 Jun 2019 07:14:02 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!m24no2602733qtm.0!news-out.google.com!4ni129qtw.1!nntp.google.com!m24no2602726qtm.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 26 Jun 2019 07:14:02 -0700 (PDT) In-Reply-To: <86e32abe-7c57-4ea1-879e-869464a6a316@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=185.34.132.4; posting-account=Srm5lQoAAAAEMX9rv2ilEKR6FDPapmSq NNTP-Posting-Host: 185.34.132.4 References: <86e32abe-7c57-4ea1-879e-869464a6a316@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0e907bb5-e767-4f4e-aca4-15327a80f5ee@googlegroups.com> Subject: Re: gprbuild and package renames (testsuites) From: Mark Lorenzen Injection-Date: Wed, 26 Jun 2019 14:14:02 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56772 Date: 2019-06-26T07:14:02-07:00 List-Id: On Monday, June 24, 2019 at 9:47:05 AM UTC+2, Per Jakobsen wrote: > Hi >=20 > I'm using gprbuilds "Naming" package to make Stub-packages for the system= to test: >=20 > package Naming is > for Specification ("B") use "stub_b.ads"; > for Body ("B") use "stub_b.adb"; > end Naming; >=20 > This works fine for a single package, but then I wonder if testing multip= le packages may be linked into the same executable: >=20 > The package structure is Package A depends on Package B which depends on = Package C, and I want to write unit-tests for each package. >=20 > To test Package A, a stub must be made for Package B. > To test Package B, a stub must be made for Package C. > Package C can be tested without stubs. >=20 > Is it possible and/or reasonable to link in tests for multiple packages i= nto the same testrunner? >=20 > Test suite A: Package A -> Package Stub_B > Test suite B: Package B -> Package Stub_C > Test suite C: Package C >=20 > Thing can get even more "interesting" if there are circular dependencies = ("limited with")... >=20 > How are you guys handling this? >=20 > ~Per I can't give you an answer to your problem, but when I have had the need to= provide stubbed packages for unit testing, I have made a unit test project= that *extends* the original project. In the *extending* project, a new imp= lementation of a package overrides the original. I thus have a project per = unit test. Regards, Mark