WORK IN PROGRESS
This repo is still under construction. As such, it is likely much of what is documented may not yet be implemented.
This repo contains exercises to help learn unit testing in Fortran and is intended to be used alongside the UCL-ARC/fortran-unit-testing-lesson repo.
In the episodes directory you will find exercises which match up to episodes in UCL-ARC/fortran-unit-testing-lesson.
Each episode contains its own build systems however there is a top level build script (build.sh) to make things easier.
Every exercise has a provided solution. To use this solution, you will likely need to make a small change to some code or build/run a different project.
Within each solution, you can find docstrings about fixes to the exercise questions. To find these, search each solution for comments starting with Q<question_number>_FIX<fix_number>
. The question_number and fix_number will correspond to a specific question and fix in each solution.
There are several prerequisites to being able to use this repo.
- fpm
- cmake
- A Fortran compiler which supports Fortran XX or above
For convenience pFUnit is included as a submodule and can be built using the provided build.sh script. Run ./build.sh -h
for details.
This repo utilises fortitude alongside pre-commit for linting. To install these tools we use pip therefore contibutors will require python version 3.9 or above.
To setup pre-commit and fortitude
- Create a python virtual environment and activate it
python3 -m venv .venv source .venv/bin/activate
- Install the dev dependencies
python -m pip install -e .
- Turn on pre-commit
pre-commit install