Skip to content

Commit aa2b627

Browse files
authored
Merge pull request #362 from billsacks/funitshare
Description of changes Purposes of this test: Ensure that the unit test infrastructure continues to work. Confirm that the share unit tests continue to pass. Requires the CIME changes in ESMCI/cime#4895. Also requires share1.1.13 or later. Specific notes Contributors other than yourself, if any: none Fixes: none User interface changes?: No Testing performed (automated tests and/or manual tests): Ran the new test (FUNITSHARE_P1x1_Mmpi-serial.ne30pg3_t232.B1850C_LTso.derecho_intel) and confirmed that it passes.
2 parents 29d84f6 + e9249ae commit aa2b627

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Implementation of the share code FUNIT test.
3+
4+
This "system" test runs the share code's Fortran unit tests. We're abusing the system test
5+
infrastructure to run these, so that a run of the test suite can result in the unit tests
6+
being run as well.
7+
8+
Grid and compset are irrelevant for this test type.
9+
"""
10+
11+
import os
12+
from CIME.SystemTests.funit import FUNIT
13+
from CIME.XML.standard_module_setup import *
14+
15+
logger = logging.getLogger(__name__)
16+
17+
18+
class FUNITSHARE(FUNIT):
19+
def __init__(self, case):
20+
FUNIT.__init__(self, case)
21+
22+
# The CMake build for the share unit tests uses the MPISERIAL env var to find the
23+
# mpi-serial library. On derecho, MPISERIAL is not set even if the mpi-serial
24+
# module is loaded; instead, there is an NCAR_ROOT_MPI_SERIAL variable. Set the
25+
# needed MPISERIAL env var for this test.
26+
if "NCAR_ROOT_MPI_SERIAL" in os.environ:
27+
os.environ["MPISERIAL"] = os.environ["NCAR_ROOT_MPI_SERIAL"]
28+
29+
def get_test_spec_dir(self):
30+
return os.path.join(self._case.get_value("SRCROOT"), "share")
31+
32+
def get_extra_run_tests_args(self):
33+
return '--cmake-args " -DUNITTESTS=ON -DUSE_CIME_MACROS=ON"'

cime_config/config_tests.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
3+
<!--
4+
This defines various CESM-specific system tests
5+
-->
6+
7+
<config_test>
8+
9+
<test NAME="FUNITSHARE">
10+
<DESC>Run the share code's Fortran unit tests. Grid and compset (and most case settings) are ignored.</DESC>
11+
<INFO_DBUG>1</INFO_DBUG>
12+
<STOP_OPTION>ndays</STOP_OPTION>
13+
<STOP_N>11</STOP_N>
14+
<CHECK_TIMING>FALSE</CHECK_TIMING>
15+
<DOUT_S>FALSE</DOUT_S>
16+
</test>
17+
18+
</config_test>

cime_config/testlist_allactive.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,4 +251,13 @@
251251
<option name="comment">Include a short debug test using the atm grid for aoflux calculations rather than the default xgrid.</option>
252252
</options>
253253
</test>
254+
<test name="FUNITSHARE_P1x1_Mmpi-serial" grid="ne30pg3_t232" compset="B1850C_LTso">
255+
<machines>
256+
<machine name="derecho" compiler="intel" category="prealpha"/>
257+
</machines>
258+
<options>
259+
<option name="wallclock">00:30:00</option>
260+
<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>
261+
</options>
262+
</test>
254263
</testlist>

0 commit comments

Comments
 (0)