added: allow DIR parameter in add_test_compare_parallel_simulation

This commit is contained in:
Arne Morten Kvarving 2019-12-04 12:52:00 +01:00
parent 0a6b5f0ea9
commit d5eea3252b

View File

@ -83,17 +83,21 @@ endfunction()
# - This test class compares the output from a parallel simulation
# to the output from the serial instance of the same model.
function(add_test_compare_parallel_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}/parallel/${PARAM_SIMULATOR}+${PARAM_CASENAME})
set(TEST_ARGS ${OPM_TESTS_ROOT}/${PARAM_CASENAME}/${PARAM_FILENAME} ${PARAM_TEST_ARGS})
set(TEST_ARGS ${OPM_TESTS_ROOT}/${PARAM_DIR}/${PARAM_FILENAME} ${PARAM_TEST_ARGS})
# Add test that runs flow_mpi and outputs the results to file
opm_add_test(compareParallelSim_${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}