Add Support for 'DIR' Parameter in Restart Test Macro

This commit adds support for setting a non-default case directory
in the

    add_test_compare_restarted_simulation
    add_test_compare_parallel_restarted_simulation

wrapper functions.  This, in turn, is helpful when creating
restarted cases for the aquifer models.
This commit is contained in:
Bård Skaflestad 2021-06-18 21:14:19 +02:00
parent 7a9c9bedea
commit 5ecc6b8166

View File

@ -82,15 +82,16 @@ endfunction()
# - This test class compares the output from a restarted simulation
# to that of a non-restarted simulation.
function(add_test_compare_restarted_simulation)
set(oneValueArgs CASENAME FILENAME SIMULATOR ABS_TOL REL_TOL)
set(oneValueArgs CASENAME FILENAME SIMULATOR ABS_TOL REL_TOL DIR)
set(multiValueArgs TEST_ARGS)
cmake_parse_arguments(PARAM "$" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if(NOT PARAM_DIR)
set(PARAM_DIR ${PARAM_CASENAME})
endif()
set(RESULT_PATH ${BASE_RESULT_PATH}/restart/${PARAM_SIMULATOR}+${PARAM_CASENAME})
opm_add_test(compareRestartedSim_${PARAM_SIMULATOR}+${PARAM_FILENAME} NO_COMPILE
EXE_NAME ${PARAM_SIMULATOR}
DRIVER_ARGS ${OPM_TESTS_ROOT}/${PARAM_CASENAME} ${RESULT_PATH}
DRIVER_ARGS ${OPM_TESTS_ROOT}/${PARAM_DIR} ${RESULT_PATH}
${PROJECT_BINARY_DIR}/bin
${PARAM_FILENAME}
${PARAM_ABS_TOL} ${PARAM_REL_TOL}
@ -146,15 +147,17 @@ endfunction()
# - This test class compares the output from a restarted parallel simulation
# to that of a non-restarted parallel simulation.
function(add_test_compare_parallel_restarted_simulation)
set(oneValueArgs CASENAME FILENAME SIMULATOR ABS_TOL REL_TOL)
set(oneValueArgs CASENAME FILENAME SIMULATOR ABS_TOL REL_TOL DIR)
set(multiValueArgs TEST_ARGS)
cmake_parse_arguments(PARAM "$" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if(NOT PARAM_DIR)
set(PARAM_DIR ${PARAM_CASENAME})
endif()
set(RESULT_PATH ${BASE_RESULT_PATH}/parallelRestart/${PARAM_SIMULATOR}+${PARAM_CASENAME})
opm_add_test(compareParallelRestartedSim_${PARAM_SIMULATOR}+${PARAM_FILENAME} NO_COMPILE
EXE_NAME ${PARAM_SIMULATOR}
DRIVER_ARGS ${OPM_TESTS_ROOT}/${PARAM_CASENAME} ${RESULT_PATH}
DRIVER_ARGS ${OPM_TESTS_ROOT}/${PARAM_DIR} ${RESULT_PATH}
${PROJECT_BINARY_DIR}/bin
${PARAM_FILENAME}
${PARAM_ABS_TOL} ${PARAM_REL_TOL}