comp.lang.ada
 help / color / mirror / Atom feed
* Suggestion about best practice with .gpr files
@ 2021-05-30 17:37 mockturtle
  2021-05-30 17:46 ` Stephen Leake
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: mockturtle @ 2021-05-30 17:37 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-06-04 14:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-30 17:37 Suggestion about best practice with .gpr files mockturtle
2021-05-30 17:46 ` 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

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