2016-07-06 04:30:10 -05:00
#!/bin/bash
2017-02-16 09:00:42 -06:00
# This runs a simulator, then compares the summary, restart and init
# files against a reference.
2016-07-06 04:30:10 -05:00
INPUT_DATA_PATH = " $1 "
RESULT_PATH = " $2 "
BINPATH = " $3 "
FILENAME = " $4 "
ABS_TOL = " $5 "
REL_TOL = " $6 "
2018-09-07 07:37:34 -05:00
COMPARE_ECL_COMMAND = " $7 "
EXE_NAME = " ${ 8 } "
shift 8
2016-07-06 04:30:10 -05:00
TEST_ARGS = " $@ "
mkdir -p ${ RESULT_PATH }
cd ${ RESULT_PATH }
2019-05-02 04:35:26 -05:00
${ BINPATH } /${ EXE_NAME } ${ TEST_ARGS } --output-dir= ${ RESULT_PATH }
2018-08-09 01:11:36 -05:00
test $? -eq 0 || exit 1
2016-07-06 04:30:10 -05:00
cd ..
2018-09-13 03:04:23 -05:00
2019-05-10 08:25:14 -05:00
ecode = 0
2019-06-03 04:17:32 -05:00
ignore_extra_kw = ""
if grep -q "ignore_extra" <<< $ghprbCommentBody
then
ignore_extra_kw = "-x"
fi
2019-05-10 08:25:14 -05:00
echo "=== Executing comparison for EGRID, INIT, UNRST and RFT files if these exists in refrece folder ==="
2019-06-03 04:17:32 -05:00
${ COMPARE_ECL_COMMAND } ${ ignore_extra_kw } ${ INPUT_DATA_PATH } /opm-simulation-reference/${ EXE_NAME } /${ FILENAME } ${ RESULT_PATH } /${ FILENAME } ${ ABS_TOL } ${ REL_TOL }
2017-02-16 09:00:42 -06:00
if [ $? -ne 0 ]
then
ecode = 1
2019-06-03 04:17:32 -05:00
${ COMPARE_ECL_COMMAND } ${ ignore_extra_kw } -a ${ INPUT_DATA_PATH } /opm-simulation-reference/${ EXE_NAME } /${ FILENAME } ${ RESULT_PATH } /${ FILENAME } ${ ABS_TOL } ${ REL_TOL }
2017-02-16 09:00:42 -06:00
fi
2017-02-02 07:58:23 -06:00
exit $ecode