โŒ About FreshRSS

Reading view

There are new articles available, click to refresh the page.

Using GNATTest with Alire and GNATStudio

Hi All.
For context, I am working on a small code challenge that saw online. Essentially, is implementing an Ulam Spiral, in CLI, using different languages. I did this for fun, and to learn new things on the way.

I am currently working on the implementation of the Ada language. Coming from Java/Python/Javascript backgrounds, was challenging and fun figuring out how Ada does things. I am also using Alire for some small dependency management I need.

In any case, I want to implement some unit testing, just for completion, and quick verification for other parts that may be wrong. I read some articles online, and found two things:

  1. This git repository: https://github.com/alire-project/ada_spark_workflow shows a basic library on Ada, and shows that Unit Tests can be implemented as a separate crate
  2. The documentation for AUnit (https://docs.adacore.com/live/wave/aunit/html/aunit_cb/aunit_cb.html) shows how to implement tests, suites, fixtures, etc, which seems easy enough.

However, I also came into GNATTest and how is integrated into GNATStudio (which I am using for this development). Seems that make it easier to just use it to generate the test files, while I have to provide the actual test code, asserts, etc.

I added the libadalang_tools crate as a dependency, and it compiles fine. I can even see the build binaries in a folder (location: ${project_root_folder}/alire/cache/dependencies/libadalang_tools_23.0.0_75f92679/bin). However, GNATStudio complains that the binary can not be found, which makes sense, as it is not in the PATH environment variable

Here are my questions then:

  1. Can Alire set those binaries to the path? that way, when I run `alr edit`, they will be already on the path, and all will run without any issues.
  2. If #1 is not possible, then how can I configure the path to the binaries for GNATest (and other tools if needed) in a way that is portable to others (or even a future me) who want to clone the repository and build/run the code?

As a workaround, I changed the command that is executed on the GNATtest generation window and hardcoded the path. It works, but did not feel that was the correct way.

Any help on this is very welcome. Let me know if you need other details.

Regards!

submitted by /u/egamboau
[link] [comments]
โŒ