As part of the SEWG hackathon today, @billsacks and I added CMake code to build an example pfunit test into CISM. PFUnit adds Fortran-based unit testing to projects and is used by many components in CESM. For this project, we used the test code in ESCOMP/cesm_share as an example, and we used some infrastructure from CIME to support this, so, to run the tests, we used the instructions from ESCOMP/cesm_share .
Unit tests are simple tests that test very small and specific pieces of code with given inputs to make sure we are getting expected outputs. These are lightweight tests that can be run automatically by github actions for pull requests or as part of development activities. To get "good" coverage of large models like CISM, it would require many (MANY) unit tests, but these could still be useful to ensure that important parts of code are not broken by updates.
The code for the pfunit building infrastructure and an example test is on my branch here.
So, there are a couple of "next steps" for this project:
As part of the SEWG hackathon today, @billsacks and I added CMake code to build an example pfunit test into CISM. PFUnit adds Fortran-based unit testing to projects and is used by many components in CESM. For this project, we used the test code in ESCOMP/cesm_share as an example, and we used some infrastructure from CIME to support this, so, to run the tests, we used the instructions from ESCOMP/cesm_share .
Unit tests are simple tests that test very small and specific pieces of code with given inputs to make sure we are getting expected outputs. These are lightweight tests that can be run automatically by github actions for pull requests or as part of development activities. To get "good" coverage of large models like CISM, it would require many (MANY) unit tests, but these could still be useful to ensure that important parts of code are not broken by updates.
The code for the pfunit building infrastructure and an example test is on my branch here.
So, there are a couple of "next steps" for this project: