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:
parent
e56141da26
commit
95f4d9d5e5
@ -47,10 +47,12 @@ macro (add_test_upscale_perm gridname bcs rows)
|
||||
set(RESULT_PATH ${BASE_RESULT_PATH}/${TEST_NAME})
|
||||
opm_add_test(${TEST_NAME} NO_COMPILE
|
||||
EXE_NAME upscale_perm
|
||||
DRIVER_ARGS ${INPUT_DATA_PATH} ${RESULT_PATH}
|
||||
${PROJECT_BINARY_DIR}/bin
|
||||
upscale_perm_BC${bcs}_${gridname}
|
||||
${abstol} ${reltol}
|
||||
DRIVER_ARGS -i ${INPUT_DATA_PATH}
|
||||
-r ${RESULT_PATH}
|
||||
-b ${PROJECT_BINARY_DIR}/bin
|
||||
-n upscale_perm_BC${bcs}_${gridname}
|
||||
-a ${abstol}
|
||||
-t ${reltol}
|
||||
TEST_ARGS -bc ${bcs}
|
||||
-output ${RESULT_PATH}/upscale_perm_BC${bcs}_${gridname}.txt
|
||||
${INPUT_DATA_PATH}/grids/${gridname}.grdecl)
|
||||
@ -79,10 +81,12 @@ macro (add_test_upscale_relperm testname gridname stonefiles rows cols)
|
||||
endforeach()
|
||||
opm_add_test(${TEST_NAME} NO_COMPILE
|
||||
EXE_NAME upscale_relperm
|
||||
DRIVER_ARGS ${INPUT_DATA_PATH} ${RESULT_PATH}
|
||||
${PROJECT_BINARY_DIR}/bin
|
||||
upscale_relperm_${testname}
|
||||
${abstol} ${reltol}
|
||||
DRIVER_ARGS -i ${INPUT_DATA_PATH}
|
||||
-r ${RESULT_PATH}
|
||||
-b ${PROJECT_BINARY_DIR}/bin
|
||||
-n upscale_relperm_${testname}
|
||||
-a ${abstol}
|
||||
-t ${reltol}
|
||||
TEST_ARGS ${test_args})
|
||||
endmacro ()
|
||||
|
||||
@ -103,10 +107,12 @@ macro (add_test_upscale_elasticity gridname method)
|
||||
set(RESULT_PATH ${BASE_RESULT_PATH}/${TEST_NAME})
|
||||
opm_add_test(${TEST_NAME} NO_COMPILE
|
||||
EXE_NAME upscale_elasticity
|
||||
DRIVER_ARGS ${INPUT_DATA_PATH} ${RESULT_PATH}
|
||||
${PROJECT_BINARY_DIR}/bin
|
||||
upscale_elasticity_${method}_${gridname}
|
||||
${abstol} ${reltol}
|
||||
DRIVER_ARGS -i ${INPUT_DATA_PATH}
|
||||
-r ${RESULT_PATH}
|
||||
-b ${PROJECT_BINARY_DIR}/bin
|
||||
-n upscale_elasticity_${method}_${gridname}
|
||||
-a ${abstol}
|
||||
-t ${reltol}
|
||||
TEST_ARGS output=${RESULT_PATH}/upscale_elasticity_${method}_${gridname}.txt
|
||||
gridfilename=${INPUT_DATA_PATH}/grids/${gridname}.grdecl
|
||||
output_wave_speeds=true
|
||||
@ -128,10 +134,12 @@ macro (add_test_cpchop gridname)
|
||||
set(RESULT_PATH ${BASE_RESULT_PATH}/${TEST_NAME})
|
||||
opm_add_test(${TEST_NAME} NO_COMPILE
|
||||
EXE_NAME cpchop
|
||||
DRIVER_ARGS ${INPUT_DATA_PATH} ${RESULT_PATH}
|
||||
${PROJECT_BINARY_DIR}/bin
|
||||
cpchop_${gridname}
|
||||
${abstol} ${reltol}
|
||||
DRIVER_ARGS -i ${INPUT_DATA_PATH}
|
||||
-r ${RESULT_PATH}
|
||||
-b ${PROJECT_BINARY_DIR}/bin
|
||||
-n cpchop_${gridname}
|
||||
-a ${abstol}
|
||||
-t ${reltol}
|
||||
TEST_ARGS resultfile=${RESULT_PATH}/cpchop_${gridname}.txt use_random=false
|
||||
gridfilename=${INPUT_DATA_PATH}/grids/${gridname}.grdecl)
|
||||
endmacro ()
|
||||
|
@ -1,14 +1,34 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
INPUT_DATA_PATH="$1"
|
||||
RESULT_PATH="$2"
|
||||
BINPATH="$3"
|
||||
TEST_NAME="$4"
|
||||
ABS_TOL="$5"
|
||||
REL_TOL="$6"
|
||||
EXE_NAME="$7"
|
||||
shift 7
|
||||
if test $# -eq 0
|
||||
then
|
||||
echo -e "Usage:\t$0 <options> -- [additional simulator options]"
|
||||
echo -e "\tMandatory options:"
|
||||
echo -e "\t\t -i <path> Path to read deck from"
|
||||
echo -e "\t\t -r <path> Path to store results in"
|
||||
echo -e "\t\t -b <path> Path to simulator binary"
|
||||
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="$@"
|
||||
|
||||
rm -Rf ${RESULT_PATH}
|
||||
|
Loading…
Reference in New Issue
Block a user