added: new test class: init

this compares the init file from a simulation run to a reference
in opm-data
This commit is contained in:
Arne Morten Kvarving 2016-11-22 13:26:46 +01:00
parent c8fae07be3
commit 9cae20d6f3
3 changed files with 48 additions and 5 deletions

View File

@ -15,7 +15,6 @@ set(BASE_RESULT_PATH ${PROJECT_BINARY_DIR}/tests/results)
macro (add_test_compareECLFiles casename filename simulator)
set(RESULT_PATH ${BASE_RESULT_PATH}/${simulator}+${casename})
# Add test that runs flow and outputs the results to file
opm_add_test(compareECLFiles_${simulator}+${filename} NO_COMPILE
EXE_NAME ${simulator}
DRIVER_ARGS ${OPM_DATA_ROOT}/${casename} ${RESULT_PATH}
@ -37,7 +36,6 @@ endmacro (add_test_compareECLFiles)
macro (add_test_compareECLRestartFiles casename filename simulator)
set(RESULT_PATH ${BASE_RESULT_PATH}/restart/${simulator}+${casename})
# Add test that runs flow and outputs the results to file
opm_add_test(compareECLRestartFiles_${simulator}+${filename} NO_COMPILE
EXE_NAME ${simulator}
DRIVER_ARGS ${OPM_DATA_ROOT}/${casename} ${RESULT_PATH}
@ -49,6 +47,27 @@ macro (add_test_compareECLRestartFiles casename filename simulator)
TEST_ARGS ${OPM_DATA_ROOT}/${casename}/${filename})
endmacro (add_test_compareECLRestartFiles)
###########################################################################
# TEST: compareECLInitFiles
###########################################################################
# Input:
# - casename: basename (no extension)
#
macro (add_test_compareECLInitFiles casename filename simulator)
set(RESULT_PATH ${BASE_RESULT_PATH}/init/${simulator}+${casename})
opm_add_test(compareECLInitFiles_${simulator}+${filename} NO_COMPILE
EXE_NAME ${simulator}
DRIVER_ARGS ${OPM_DATA_ROOT}/${casename} ${RESULT_PATH}
${CMAKE_BINARY_DIR}/bin
${filename}
${abs_tol} ${rel_tol}
${COMPARE_SUMMARY_COMMAND}
${COMPARE_ECL_COMMAND}
TEST_ARGS ${OPM_DATA_ROOT}/${casename}/${filename})
endmacro (add_test_compareECLInitFiles)
###########################################################################
# TEST: parallelECLFiles
###########################################################################
@ -91,6 +110,11 @@ opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-restart-regressionTest.sh ""
add_test_compareECLRestartFiles(spe1 SPE1CASE2_ACTNUM flow)
add_test_compareECLRestartFiles(spe9 SPE9_CP_SHORT flow)
# Init tests
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-init-regressionTest.sh "")
add_test_compareECLInitFiles(norne NORNE_ATW2013 flow)
# Parallel tests
if(MPI_FOUND)
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-parallel-regressionTest.sh "")

View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
INPUT_DATA_PATH="$1"
RESULT_PATH="$2"
BINPATH="$3"
FILENAME="$4"
ABS_TOL="$5"
REL_TOL="$6"
COMPARE_SUMMARY_COMMAND="$7"
COMPARE_ECL_COMMAND="$8"
EXE_NAME="${9}"
shift 9
TEST_ARGS="$@"
rm -Rf ${RESULT_PATH}
mkdir -p ${RESULT_PATH}
cd ${RESULT_PATH}
${BINPATH}/${EXE_NAME} ${TEST_ARGS} nosim=true
cd ..
${COMPARE_ECL_COMMAND} -t INIT ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${FILENAME} ${ABS_TOL} ${REL_TOL}

View File

@ -24,6 +24,3 @@ ${COMPARE_SUMMARY_COMMAND} -r ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-
${COMPARE_ECL_COMMAND} ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${FILENAME} ${ABS_TOL} ${REL_TOL}
${COMPARE_ECL_COMMAND} -t INIT ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${FILENAME} ${ABS_TOL} ${REL_TOL}