comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Lorenzen <mark.lorenzen@gmail.com>
Subject: Re: gprbuild and package renames (testsuites)
Date: Wed, 26 Jun 2019 07:14:02 -0700 (PDT)
Date: 2019-06-26T07:14:02-07:00	[thread overview]
Message-ID: <0e907bb5-e767-4f4e-aca4-15327a80f5ee@googlegroups.com> (raw)
In-Reply-To: <86e32abe-7c57-4ea1-879e-869464a6a316@googlegroups.com>

On Monday, June 24, 2019 at 9:47:05 AM UTC+2, Per Jakobsen wrote:
> Hi
> 
> I'm using gprbuilds "Naming" package to make Stub-packages for the system to test:
> 
>    package Naming is
>       for Specification ("B") use "stub_b.ads";
>       for Body          ("B") use "stub_b.adb";
>    end Naming;
> 
> This works fine for a single package, but then I wonder if testing multiple packages may be linked into the same executable:
> 
> 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.
> 
> 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.
> 
> Is it possible and/or reasonable to link in tests for multiple packages into the same testrunner?
> 
> Test suite A: Package A -> Package Stub_B
> Test suite B: Package B -> Package Stub_C
> Test suite C: Package C
> 
> Thing can get even more "interesting" if there are circular dependencies ("limited with")...
> 
> How are you guys handling this?
> 
> ~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 implementation of a package overrides the original. I thus have a project per unit test.

Regards,

Mark

      parent reply	other threads:[~2019-06-26 14:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24  7:47 gprbuild and package renames (testsuites) Per Jakobsen
2019-06-24 15:39 ` briot.emmanuel
2019-06-25  5:47   ` Per Jakobsen
2019-06-26 14:14 ` Mark Lorenzen [this message]
replies disabled

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