Simplified testing on the Fortran track

We recently made several changes to the way student solutions are tested.

The online test runner

When you run tests in the online editor, or after an exercism submit from the CLI, the response should now be slightly quicker. This is probably not enough for most students to notice, but reducing load on Exercism’s infrastructure is good for us all.

Local testing

Differences here are much more obvious. Until now, testing an exercise solution needed multiple steps:

mkdir build
cd build
cmake ..
cmake --build .
ctest -V

From today, every exercise download should include a pre-built Makefile.

On systems running gfortran (most Linux and Mac installations), you can just run

make

from the exercise directory, to compile your code and immediately run the tests. In this case, there is no longer a need to have cmake installed on your computer.

Alternatively, many tracks use

exercism test

to run tests, and this now works on Fortran.

This involved quite a lot of changes, both to the code and to the documentation.

Please let us know of any problems you find!

As a fallback option for compilers other than gfortran, the older cmake testing should still work. See the HELP.md file that downloads with each exercise for all the options.

Testing on Windows is more complicated and less well tested. I will create a separate post for Fortran-on-Windows.

1 Like