uDALES / u-dales

uDALES: large-eddy-simulation software for urban flow, dispersion and microclimate modelling
https://udales.github.io/u-dales
GNU General Public License v3.0
54 stars 18 forks source link

Add unit tests via pFUnit #216

Open cc-a opened 2 months ago

cc-a commented 2 months ago

This PR is in draft as I wouldn't recommended merging as is but I wanted to circulate to the group before going any further down this road.

This PR provides a quick and dirty adoption of the pFUnit framework and its application to a couple of trivial test cases.

See unit_tests/README.md for instructions on how to build and run the tests.

The test cases are provided in unit_tests/test_simple.pf. The pf suffix indicates that these files are fortran with the addition of pre-processor directives provided by pFUnit. The pre-processing is taken care of by the changes made to CMakeLists.txt and run as part of the standard build process for the code base (just for purposes of this demo).

The preprocessor directives make it possible to write tests with minimal boiler plate. There are two tests; the first is a trivial demonstration of some of the assert preprocessor directives, whilst the second demonstrates testing a function from uDALES.