Skip to content
Closed
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
41 changes: 30 additions & 11 deletions cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ set stime = `date -u "+%H%M%S"`
set docase = 0
set dotest = 0
set dosuite = 0
set suitesubmit = 1
set suitebuild = 1

if ($#argv < 1) then
set helpheader = 1
Expand Down Expand Up @@ -104,6 +106,8 @@ DESCRIPTION
--testid : test ID, user-defined id for testing (REQUIRED with --test or --suite)
--diff : generate comparison against another case
--report : automatically post results when tests are complete
--no-submit: for test suites, create the tests and compile the executables but do not submit the jobs
--no-build : for test suites, only create the test folders, do not compile the executables nor submit the jobs

EXAMPLES
cice.setup --version
Expand Down Expand Up @@ -214,6 +218,13 @@ while (1)
if ("$option" == "--report") then
set report = 1
shift argv
else if ("$option" == "--no-submit") then
set suitesubmit = 0
shift argv
else if ("$option" == "--no-build") then
set suitesubmit = 0
set suitebuild = 0
shift argv

# arguments with settings
else
Expand Down Expand Up @@ -379,7 +390,7 @@ else
cp -f ${ICE_SCRIPTS}/tests/report_results.csh ${tsdir}
cp -f ${ICE_SCRIPTS}/tests/poll_queue.csh ${tsdir}

foreach file (${tsdir}/suite.run ${tsdir}/suite.submit)
foreach file (${tsdir}/suite.build ${tsdir}/suite.run ${tsdir}/suite.submit)
cat >! $file << EOF0
#!/bin/csh -f

Expand All @@ -406,6 +417,7 @@ echo "#vers = ${vers}" >> results.log
echo "#------- " >> results.log
EOF0

chmod +x ${tsdir}/suite.build
chmod +x ${tsdir}/suite.run
chmod +x ${tsdir}/suite.submit
chmod +x ${tsdir}/results.csh
Expand Down Expand Up @@ -860,12 +872,13 @@ EOF2

if ( ${dosuite} == 1 ) then
cd ${ICE_SANDBOX}
# Write build and run commands to suite.run and suite.submit
# Write build commands to suite.build, suite.run, suite.submit
# and run commands to suite.run and suite.submit

cat >> ${tsdir}/results.csh << EOF
cat ${testname_base}/test_output >> results.log
EOF
foreach file (${tsdir}/suite.run ${tsdir}/suite.submit)
foreach file (${tsdir}/suite.build ${tsdir}/suite.run ${tsdir}/suite.submit)
cat >> $file << EOF
echo "-------test--------------"
echo "${testname_base}"
Expand All @@ -882,7 +895,7 @@ EOF
cat >> ${tsdir}/suite.run << EOF
./cice.test
EOF
foreach file (${tsdir}/suite.run ${tsdir}/suite.submit)
foreach file (${tsdir}/suite.build ${tsdir}/suite.run ${tsdir}/suite.submit)
cat >> $file << EOF
cd ..

Expand Down Expand Up @@ -944,14 +957,20 @@ setenv ICE_MACHINE_QSTAT ${ICE_MACHINE_QSTAT}
EOF0
endif

# build and submit tests
cd ${tsdir}
./suite.submit | tee suite.log
if ($report == 1) then
echo "Reporting results"
./poll_queue.csh
./results.csh
./report_results.csh
if ($suitesubmit == 1) then
# build and submit tests
./suite.submit | tee suite.log
if ($report == 1) then
echo "Reporting results"
./poll_queue.csh
./results.csh
./report_results.csh
endif
else if ($suitebuild == 1) then
# only build tests
./suite.build | tee suite.log
else
endif
cd ${ICE_SANDBOX}

Expand Down
2 changes: 1 addition & 1 deletion doc/source/developer_guide/dg_scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cases, building, and running the cice stand-alone model.
File List
--------------

The directory structure under configure/scripts is as follows.
The directory structure under configuration/scripts is as follows.

| **configuration/scripts/**
| **Makefile** primary makefile
Expand Down
31 changes: 28 additions & 3 deletions doc/source/user_guide/ug_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,12 @@ Test suites
Test suites support running multiple tests specified via
an input file. When invoking the test suite option (``--suite``) with **cice.setup**,
all tests will be created, built, and submitted automatically under
a local directory called testsuite.[testid] as part of involing the suite.::
a local directory called testsuite.[testid] ::

./cice.setup --suite base_suite --mach wolf --env gnu --testid myid

Like an individual test, the ``--testid`` option must be specified and can be any
string. Once the tests are complete, results can be checked by running the
string (except strings involving the colon character ":" which creates cryptic Makefile errors). Once the tests are complete, results can be checked by running the
results.csh script in the [suite_name].[testid]::

cd testsuite.[testid]
Expand All @@ -312,9 +312,28 @@ If a user adds ``--set`` to the suite, all tests in that suite will add that opt

./cice.setup --suite base_suite,decomp_suite --mach wolf --env gnu --testid myid -s debug

The option settings defined in the suite have precendent over the command line
The option settings defined in the suite have precedent over the command line
values if there are conflicts.

It is also possible to separately setup, build and submit the test cases. To setup and build the tests, use the ``--no-submit`` option with the ``buildincremental`` preset :
::

./cice.setup --suite base_suite --mach wolf --env gnu --testid myid --no-submit -s buildincremental
# wait for builds to complete
cd testsuite.[testid]
./suite.submit # submit the jobs

To only setup the tests, use the ``--no-build`` option with the ``buildincremental`` preset :
::

./cice.setup --suite base_suite --mach wolf --env gnu --testid myid --no-build -s buildincremental
# wait for setup to complete
cd testsuite.[testid]
./suite.submit # build and submit
# or separately
./suite.build
./suite.submit

The predefined test suites are defined under **configuration/scripts/tests** and
the files defining the suites
have a suffix of .ts in that directory. The format for the test suite file
Expand Down Expand Up @@ -380,6 +399,12 @@ following options are valid for suites,
``--report``
This is only used by ``--suite`` and when set, invokes a script that sends the test results to the results page when all tests are complete. Please see :ref:`testreporting` for more information.

``--no-submit``
Create the tests and compile the executables but do not submit the jobs

``--no-build``
Only create the test folders, do not compile the executables nor submit the jobs

Please see :ref:`case_options` and :ref:`indtests` for more details about how these options are used.


Expand Down