From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:ac8:570a:: with SMTP id 10mr11673634qtw.360.1622396241812; Sun, 30 May 2021 10:37:21 -0700 (PDT) X-Received: by 2002:a25:da8a:: with SMTP id n132mr25847692ybf.504.1622396241581; Sun, 30 May 2021 10:37:21 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 30 May 2021 10:37:21 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=93.41.2.250; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 93.41.2.250 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Suggestion about best practice with .gpr files From: mockturtle Injection-Date: Sun, 30 May 2021 17:37:21 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:62049 List-Id: Dear.all, I have a problem that I solved in a fairly acceptable way, but I would like= to hear from you if there are some kind of "better practices" that I could= use. The problem is this: sometimes, while writing some software, I develop some= packages that could be used elsewhere, so I "extract" them in a library of= their own with their own project file that is "with-ed" inside the project= file of the larger software. When I "isolate" the package into its own library, I like also to add some= testing code. The problem is that if I declare the project to be a librar= y project (which is just natural) I cannot have an executable. =20 In the past, I solved this problem by declaring the project to be a non-lib= rary one; nowadays I declare it to be a library project and then add a fold= er test/ with its src/ folder with the test programs and a specific project= file that "with-s" the library project. =20 Let me try drawing a picture relative to a library "foo"=20 foolib/ ...| ...+-- foolib.gpr ...+-- src/ ...+-- obj/ ...+-- test/ ..........| ..........+--foolib_test.gpr ..........+--obj/ ..........+--src/ ................| ...............+-- foo_test_1.adb ...............+-- foo_test_2.adb ...............+-- foo_test_3.adb I hope you got the idea.=20 Do you have any suggestion about a different organization? Do there exist = some kind of "best practice" for this? Thank you in advance for your help Riccardo