mirror of
https://github.com/OPM/opm-upscaling.git
synced 2025-02-25 18:45:23 -06:00
improve test driver
This commit is contained in:
@@ -47,10 +47,12 @@ macro (add_test_upscale_perm gridname bcs rows)
|
|||||||
set(RESULT_PATH ${BASE_RESULT_PATH}/${TEST_NAME})
|
set(RESULT_PATH ${BASE_RESULT_PATH}/${TEST_NAME})
|
||||||
opm_add_test(${TEST_NAME} NO_COMPILE
|
opm_add_test(${TEST_NAME} NO_COMPILE
|
||||||
EXE_NAME upscale_perm
|
EXE_NAME upscale_perm
|
||||||
DRIVER_ARGS ${INPUT_DATA_PATH} ${RESULT_PATH}
|
DRIVER_ARGS -i ${INPUT_DATA_PATH}
|
||||||
${PROJECT_BINARY_DIR}/bin
|
-r ${RESULT_PATH}
|
||||||
upscale_perm_BC${bcs}_${gridname}
|
-b ${PROJECT_BINARY_DIR}/bin
|
||||||
${abstol} ${reltol}
|
-n upscale_perm_BC${bcs}_${gridname}
|
||||||
|
-a ${abstol}
|
||||||
|
-t ${reltol}
|
||||||
TEST_ARGS -bc ${bcs}
|
TEST_ARGS -bc ${bcs}
|
||||||
-output ${RESULT_PATH}/upscale_perm_BC${bcs}_${gridname}.txt
|
-output ${RESULT_PATH}/upscale_perm_BC${bcs}_${gridname}.txt
|
||||||
${INPUT_DATA_PATH}/grids/${gridname}.grdecl)
|
${INPUT_DATA_PATH}/grids/${gridname}.grdecl)
|
||||||
@@ -79,10 +81,12 @@ macro (add_test_upscale_relperm testname gridname stonefiles rows cols)
|
|||||||
endforeach()
|
endforeach()
|
||||||
opm_add_test(${TEST_NAME} NO_COMPILE
|
opm_add_test(${TEST_NAME} NO_COMPILE
|
||||||
EXE_NAME upscale_relperm
|
EXE_NAME upscale_relperm
|
||||||
DRIVER_ARGS ${INPUT_DATA_PATH} ${RESULT_PATH}
|
DRIVER_ARGS -i ${INPUT_DATA_PATH}
|
||||||
${PROJECT_BINARY_DIR}/bin
|
-r ${RESULT_PATH}
|
||||||
upscale_relperm_${testname}
|
-b ${PROJECT_BINARY_DIR}/bin
|
||||||
${abstol} ${reltol}
|
-n upscale_relperm_${testname}
|
||||||
|
-a ${abstol}
|
||||||
|
-t ${reltol}
|
||||||
TEST_ARGS ${test_args})
|
TEST_ARGS ${test_args})
|
||||||
endmacro ()
|
endmacro ()
|
||||||
|
|
||||||
@@ -103,10 +107,12 @@ macro (add_test_upscale_elasticity gridname method)
|
|||||||
set(RESULT_PATH ${BASE_RESULT_PATH}/${TEST_NAME})
|
set(RESULT_PATH ${BASE_RESULT_PATH}/${TEST_NAME})
|
||||||
opm_add_test(${TEST_NAME} NO_COMPILE
|
opm_add_test(${TEST_NAME} NO_COMPILE
|
||||||
EXE_NAME upscale_elasticity
|
EXE_NAME upscale_elasticity
|
||||||
DRIVER_ARGS ${INPUT_DATA_PATH} ${RESULT_PATH}
|
DRIVER_ARGS -i ${INPUT_DATA_PATH}
|
||||||
${PROJECT_BINARY_DIR}/bin
|
-r ${RESULT_PATH}
|
||||||
upscale_elasticity_${method}_${gridname}
|
-b ${PROJECT_BINARY_DIR}/bin
|
||||||
${abstol} ${reltol}
|
-n upscale_elasticity_${method}_${gridname}
|
||||||
|
-a ${abstol}
|
||||||
|
-t ${reltol}
|
||||||
TEST_ARGS output=${RESULT_PATH}/upscale_elasticity_${method}_${gridname}.txt
|
TEST_ARGS output=${RESULT_PATH}/upscale_elasticity_${method}_${gridname}.txt
|
||||||
gridfilename=${INPUT_DATA_PATH}/grids/${gridname}.grdecl
|
gridfilename=${INPUT_DATA_PATH}/grids/${gridname}.grdecl
|
||||||
output_wave_speeds=true
|
output_wave_speeds=true
|
||||||
@@ -128,10 +134,12 @@ macro (add_test_cpchop gridname)
|
|||||||
set(RESULT_PATH ${BASE_RESULT_PATH}/${TEST_NAME})
|
set(RESULT_PATH ${BASE_RESULT_PATH}/${TEST_NAME})
|
||||||
opm_add_test(${TEST_NAME} NO_COMPILE
|
opm_add_test(${TEST_NAME} NO_COMPILE
|
||||||
EXE_NAME cpchop
|
EXE_NAME cpchop
|
||||||
DRIVER_ARGS ${INPUT_DATA_PATH} ${RESULT_PATH}
|
DRIVER_ARGS -i ${INPUT_DATA_PATH}
|
||||||
${PROJECT_BINARY_DIR}/bin
|
-r ${RESULT_PATH}
|
||||||
cpchop_${gridname}
|
-b ${PROJECT_BINARY_DIR}/bin
|
||||||
${abstol} ${reltol}
|
-n cpchop_${gridname}
|
||||||
|
-a ${abstol}
|
||||||
|
-t ${reltol}
|
||||||
TEST_ARGS resultfile=${RESULT_PATH}/cpchop_${gridname}.txt use_random=false
|
TEST_ARGS resultfile=${RESULT_PATH}/cpchop_${gridname}.txt use_random=false
|
||||||
gridfilename=${INPUT_DATA_PATH}/grids/${gridname}.grdecl)
|
gridfilename=${INPUT_DATA_PATH}/grids/${gridname}.grdecl)
|
||||||
endmacro ()
|
endmacro ()
|
||||||
|
|||||||
@@ -1,14 +1,34 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
INPUT_DATA_PATH="$1"
|
if test $# -eq 0
|
||||||
RESULT_PATH="$2"
|
then
|
||||||
BINPATH="$3"
|
echo -e "Usage:\t$0 <options> -- [additional simulator options]"
|
||||||
TEST_NAME="$4"
|
echo -e "\tMandatory options:"
|
||||||
ABS_TOL="$5"
|
echo -e "\t\t -i <path> Path to read deck from"
|
||||||
REL_TOL="$6"
|
echo -e "\t\t -r <path> Path to store results in"
|
||||||
EXE_NAME="$7"
|
echo -e "\t\t -b <path> Path to simulator binary"
|
||||||
shift 7
|
echo -e "\t\t -n <name> Test name"
|
||||||
|
echo -e "\t\t -a <tol> Absolute tolerance in comparison"
|
||||||
|
echo -e "\t\t -t <tol> Relative tolerance in comparison"
|
||||||
|
echo -e "\t\t -e <filename> Simulator binary to use"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
OPTIND=1
|
||||||
|
while getopts "i:r:b:n:a:t:e:" OPT
|
||||||
|
do
|
||||||
|
case "${OPT}" in
|
||||||
|
i) INPUT_DATA_PATH=${OPTARG} ;;
|
||||||
|
r) RESULT_PATH=${OPTARG} ;;
|
||||||
|
b) BINPATH=${OPTARG} ;;
|
||||||
|
n) TEST_NAME=${OPTARG} ;;
|
||||||
|
a) ABS_TOL=${OPTARG} ;;
|
||||||
|
t) REL_TOL=${OPTARG} ;;
|
||||||
|
e) EXE_NAME=${OPTARG} ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $(($OPTIND-1))
|
||||||
TEST_ARGS="$@"
|
TEST_ARGS="$@"
|
||||||
|
|
||||||
rm -Rf ${RESULT_PATH}
|
rm -Rf ${RESULT_PATH}
|
||||||
|
|||||||
Reference in New Issue
Block a user