-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
tracking-issueA list of issues or TODOsA list of issues or TODOs
Description
(migrated from internal issue tracker)
Here are some of my thoughts on how to start with automated tests in eCLM. For now only unit testing is covered; system testing is a different matter and I will post about it on another thread below.
Phase 1: Set up unit test infrastructure
CLM5 uses the parallel Fortran Unit testing library (a.k.a. pFUnit) to run unit tests. We need to integrate this into eCLM and test if it works.
1. Build pFUnit standalone
The goal of this step is to learn the correct cmake
parameters to build pFUnit, which will be important for the next step.
- Successfully build pFUnit on JSC systems
- Successfully build pFUnit on Ubuntu (necessary for GitHub CI)
2. Build pFUnit within eCLM
- Add pFUnit as a git submodule under eCLM/src/externals
- Add pFUnit into this CMakeLists.txt
- Use the ExternalProject_Add construct; see usage examples in TSMP2/cmake
3. Add dummy unit tests in eCLM and run them
- Get familiar with writing and running unit tests. Check out pFUnit_demos for examples.
- Add some dummy unit tests inside eCLM (e.g., one test that always passes and another test that always fails)
- Run the tests. The workflow for running tests should look something like this:
# Configure eCLM
cmake -S src -B "$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_COMPILER=mpifort
# Build eCLM
cmake --build "$BUILD_DIR"
# Run tests
cd "$BUILD_DIR"
ctest
- This examples test workflow might be useful: How to run ParFlow tests locally
Phase 2: Port unit tests from CLM5 to eCLM
Once the test infrastructure is set up, we can start copying the unit tests under CTSM/src and test if they work.
Metadata
Metadata
Assignees
Labels
tracking-issueA list of issues or TODOsA list of issues or TODOs