On 2012-02-27 08:08, Ludovic Brenta wrote:
> I would keep the library project file unchanged and create one project
> file for both the tests and the benchmark:
>
> with "lib.gpr";
> project Main is
> for Source_Dirs use ("tests", "benchmarks");
> for Main use ("test", "benchmark");
> end Main;
>
> You load main.gpr in GPS.
I set this up and it basically works fine... which is great. I do have
one quirk though. My library has some SPARK components. When I load
lib.gpr directly I can run the Examiner from inside GPS fine. It uses a
command line that looks, in part, like
spark -index_file=lib.idx ...
This works because the SPARK index file (lib.idx) is in the same folder
as the project file (lib.gpr). However, when I load my main project file
as defined above and then try to run the Examiner on a file in the lib
subproject it does not work. The command above is issued but the
Examiner complains that it can't open the file lib.idx. I suspect that
the working folder is the one containing main.gpr and not the one
containing lib.gpr.
It seems like, ideally, GPS should change to the folder of the
subproject before issuing commands defined as external tools over that
project. I don't see a way to make it do this. Perhaps this is a problem
with the GPS/SPARK integration. Maybe I could fix it myself by tinkering
with the Python files of the appropriate plug-in. However, before
attempting something like that I thought I'd ask here to see if there's
a better way.
Right now to use SPARK on my library I need to load the lib.gpr file
directly. That's not the end of the world, but it's also not everything
I had hoped for.
Peter