Add unit tests via pFUnit #216
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
. Thepf
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 toCMakeLists.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.