Spread pretty thin these days. I might be able to port an exercise or two to help you spin up if you get the track tooling in place, but I can’t really help with maintainership. I used Ada 95 for some systems programming courses at West Point way back when, but I haven’t touched the language since.
One thing to keep in mind is that once this thing it up, people will be requesting mentorship. The track tools also have to be maintained. This is an indefinite open-ended commitment. Getting to 20 exercises with the necessary tooling is just the start.
We need to choose a testing framework if we’re going to move forward with an Ada track.
So far I’ve heard one vote for GNATtest, and one vote for Ahven, but I’ve not yet heard any reasoning around either of the choices.
If it doesn’t matter which we choose, I’m happy to just flip a coin.
Here’s a test suite that uses GNATtest:
with GNATtest; use GNATtest;
with Hello;
procedure Hello_Test is
begin
Assert.Equal(Hello.Hello, "Hello, World!");
end Hello_Test;
And here’s the equivalent test suite using Ahven:
with Ahven;
with Hello;
procedure Hello_Test is new Test_Unit
with Procedure => Hello_Test_Case;
procedure Hello_Test_Case is
begin
Assert.String_Equal(Hello.Hello, "Hello, World!");
end Hello_Test_Case;
AFAIK gnattest doesn’t provides GNATtest package,because it’s a tool, not a library:
gnattest tool is a utility that creates unit-test skeletons as well as a test driver infrastructure (harness).
It uses AUnit in the generated code. Here is example of a test with AUnit (in examples/simple_test/tests/math-test.adb of the repo):
with AUnit.Assertions; use AUnit.Assertions;
package body Math.Test is
function Name (T : Test) return AUnit.Message_String is
pragma Unreferenced (T);
begin
return AUnit.Format ("Test Math package");
end Name;
procedure Run_Test (T : in out Test) is
pragma Unreferenced (T);
I1 : constant Int := 5;
I2 : constant Int := 3;
begin
Assert (I1 + I2 = 8, "Incorrect result after addition");
Assert (I1 - I2 = 2, "Incorrect result after subtraction");
end Run_Test;
end Math.Test;
I have been taking a look at the Ada track, I’ve already done the “Hello, World” and “Leap” problems, will tackle a test generator next (to read the test cases from the problem specification JSON and generate the unit tests) and probably a test runner after that