2018-08-13 13:01:08 +08:00
|
|
|
#!/bin/sh
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
|
|
|
|
|
|
|
. ${srcdir}/d4test_common.sh
|
|
|
|
|
2020-05-31 07:36:25 +08:00
|
|
|
set -e
|
|
|
|
|
2017-05-18 02:30:24 +08:00
|
|
|
echo "test_raw.sh:"
|
|
|
|
|
2022-11-14 04:15:11 +08:00
|
|
|
computetestablefiles
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
# Do cleanup on the baseline file
|
|
|
|
baseclean() {
|
|
|
|
if test $# != 2 ; then
|
|
|
|
echo "simplify: too few args"
|
|
|
|
else
|
|
|
|
rm -f $2
|
|
|
|
while read -r iline; do
|
|
|
|
oline=`echo $iline | tr "'" '"'`
|
|
|
|
echo "$oline" >> $2
|
|
|
|
done < $1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Do cleanup on the result file
|
|
|
|
resultclean() {
|
|
|
|
if test $# != 2 ; then
|
|
|
|
echo "simplify: too few args"
|
|
|
|
else
|
|
|
|
rm -f $2
|
|
|
|
while read -r iline; do
|
|
|
|
oline=`echo $iline | sed -e 's|^\(netcdf.*\)[.]nc\(.*\)$|\\1\\2|'`
|
|
|
|
echo "$oline" >> $2
|
|
|
|
done < $1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-06-27 03:58:45 +08:00
|
|
|
setresultdir results_test_raw
|
2018-09-05 01:27:47 +08:00
|
|
|
|
2022-11-14 04:15:11 +08:00
|
|
|
if test "x${RESET}" = x1 ; then rm -fr ${BASELINERAW}/*.ncdump ; fi
|
2017-03-09 08:01:10 +08:00
|
|
|
for f in $F ; do
|
|
|
|
echo "testing: $f"
|
2022-11-14 04:15:11 +08:00
|
|
|
URL="[log][dap4]file://${RAWTESTFILES}/${f}"
|
|
|
|
if ! ${NCDUMP} ${DUMPFLAGS} "${URL}" > ${builddir}/results_test_raw/${f}.ncdump; then
|
2017-03-09 08:01:10 +08:00
|
|
|
failure "${URL}"
|
|
|
|
fi
|
|
|
|
if test "x${TEST}" = x1 ; then
|
2022-11-14 04:15:11 +08:00
|
|
|
if ! diff -wBb ${BASELINERAW}/${f}.ncdump ${builddir}/results_test_raw/${f}.ncdump ; then
|
|
|
|
failure "diff ${f}.ncdump"
|
2017-03-09 08:01:10 +08:00
|
|
|
fi
|
|
|
|
elif test "x${RESET}" = x1 ; then
|
2018-08-13 14:05:31 +08:00
|
|
|
echo "${f}:"
|
2022-11-14 04:15:11 +08:00
|
|
|
cp ${builddir}/results_test_raw/${f}.ncdump ${BASELINERAW}/${f}.ncdump
|
2017-03-09 08:01:10 +08:00
|
|
|
elif test "x${DIFF}" = x1 ; then
|
|
|
|
echo "hdrtest: ${f}"
|
2018-08-13 14:05:31 +08:00
|
|
|
baseclean
|
2022-11-14 04:15:11 +08:00
|
|
|
if ! diff -wBb ${BASELINERAW}/${f}.ncdump ${BASELINE}/${f}.ncdump ; then
|
|
|
|
failure diff -wBb ${BASELINERAW}/${f}.ncdump ${BASELINE}/${f}.ncdump
|
2017-03-09 08:01:10 +08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
finish
|