comp.lang.ada
 help / color / mirror / Atom feed
From: mockturtle <framefritti@gmail.com>
Subject: Suggestion about best practice with .gpr files
Date: Sun, 30 May 2021 10:37:21 -0700 (PDT)	[thread overview]
Message-ID: <f6b41bac-39d2-441d-a89d-3485bf3fa99bn@googlegroups.com> (raw)

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 library project (which is just natural) I cannot have an executable.  

In the past, I solved this problem by declaring the project to be a non-library one; nowadays I declare it to be a library project and then add a folder test/ with its src/ folder with the test programs and a specific project file that "with-s" the library project.  

Let me try drawing a picture relative to a library "foo" 

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. 

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

             reply	other threads:[~2021-05-30 17:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-30 17:37 mockturtle [this message]
2021-05-30 17:46 ` Suggestion about best practice with .gpr files Stephen Leake
2021-05-30 19:31   ` Simon Wright
2021-05-30 17:56 ` Dmitry A. Kazakov
2021-05-30 20:22 ` Jeffrey R. Carter
2021-05-31  7:42   ` AdaMagica
2021-05-31 16:59     ` Stephen Leake
2021-06-01  9:33       ` Jeffrey R. Carter
2021-06-04  7:48         ` Björn Lundin
2021-06-04  8:14           ` Dmitry A. Kazakov
2021-06-04  9:18           ` Jeffrey R. Carter
2021-06-04  9:47             ` Björn Lundin
2021-06-04 12:52           ` Simon Wright
2021-06-04 14:53             ` Björn Lundin
2021-06-01 14:38   ` Shark8
2021-05-31 15:02 ` Maxim Reznik
2021-05-31 17:07   ` Stephen Leake
2021-05-31 20:14 ` Per Sandberg
replies disabled

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