Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions cime_config/SystemTests/funitshare.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
Implementation of the share code FUNIT test.

This "system" test runs the share code's Fortran unit tests. We're abusing the system test
infrastructure to run these, so that a run of the test suite can result in the unit tests
being run as well.

Grid and compset are irrelevant for this test type.
"""

import os
from CIME.SystemTests.funit import FUNIT
from CIME.XML.standard_module_setup import *

logger = logging.getLogger(__name__)


class FUNITSHARE(FUNIT):
def __init__(self, case):
FUNIT.__init__(self, case)

# The CMake build for the share unit tests uses the MPISERIAL env var to find the
# mpi-serial library. On derecho, MPISERIAL is not set even if the mpi-serial
# module is loaded; instead, there is an NCAR_ROOT_MPI_SERIAL variable. Set the
# needed MPISERIAL env var for this test.
if "NCAR_ROOT_MPI_SERIAL" in os.environ:
os.environ["MPISERIAL"] = os.environ["NCAR_ROOT_MPI_SERIAL"]

def get_test_spec_dir(self):
return os.path.join(self._case.get_value("SRCROOT"), "share")

def get_extra_run_tests_args(self):
return '--cmake-args " -DUNITTESTS=ON -DUSE_CIME_MACROS=ON"'
18 changes: 18 additions & 0 deletions cime_config/config_tests.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>

<!--
This defines various CESM-specific system tests
-->

<config_test>

<test NAME="FUNITSHARE">
<DESC>Run the share code's Fortran unit tests. Grid and compset (and most case settings) are ignored.</DESC>
<INFO_DBUG>1</INFO_DBUG>
<STOP_OPTION>ndays</STOP_OPTION>
<STOP_N>11</STOP_N>
<CHECK_TIMING>FALSE</CHECK_TIMING>
<DOUT_S>FALSE</DOUT_S>
</test>

</config_test>
9 changes: 9 additions & 0 deletions cime_config/testlist_allactive.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,13 @@
<option name="comment">Include a short debug test using the atm grid for aoflux calculations rather than the default xgrid.</option>
</options>
</test>
<test name="FUNITSHARE_P1x1_Mmpi-serial" grid="ne30pg3_t232" compset="B1850C_LTso">
<machines>
<machine name="derecho" compiler="intel" category="prealpha"/>
</machines>
<options>
<option name="wallclock">00:30:00</option>
<option name="comment">This test runs the CESM_share Fortran unit tests. We're abusing the system test infrastructure to run these, so that a run of the test suite results in the unit tests being run as well. These unit tests are run as a GitHub action for each share PR, so this system test is less about catching code problems and more about making sure the unit testing infrastructure continues to work in each CESM tag. Grid and compset are irrelevant here. Needs to be mpi-serial in order to load the necessary modules.</option>
</options>
</test>
</testlist>