Skip to content

UCL-ARC/fortran-unit-testing-exercises

Repository files navigation

WORK IN PROGRESS

This repo is still under construction. As such, it is likely much of what is documented may not yet be implemented.

Fortran Unit Testing Exercises

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.

Using this 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.

Solutions

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.

Dependencies

There are several prerequisites to being able to use this repo.

  • fpm
  • cmake
  • A Fortran compiler which supports Fortran XX or above

pFUnit

For convenience pFUnit is included as a submodule and can be built using the provided build.sh script. Run ./build.sh -h for details.

Dev dependencies

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

  1. Create a python virtual environment and activate it
    python3 -m venv .venv
    source .venv/bin/activate
  2. Install the dev dependencies
    python -m pip install -e .
  3. Turn on pre-commit
    pre-commit install

About

Fortran unit testing example to be used alongside UCL-ARC/fortran-unit-testing-lesson

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published