2017-06-01 01:00:04 +08:00
|
|
|
#!/bin/bash
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
|
|
|
|
|
|
|
. ${srcdir}/d4test_common.sh
|
|
|
|
|
2017-05-18 02:30:24 +08:00
|
|
|
echo "test_raw.sh:"
|
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
# Compute the set of testfiles
|
|
|
|
PUSHD ${srcdir}/daptestfiles
|
|
|
|
F=`ls -1d *.dap`
|
|
|
|
POPD
|
|
|
|
F=`echo $F | tr '\r\n' ' '`
|
|
|
|
F=`echo $F | sed -e s/.dap//g`
|
|
|
|
|
|
|
|
# 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
|
|
|
|
}
|
|
|
|
|
2017-11-18 01:49:06 +08:00
|
|
|
mkdir ./results_test_raw
|
2017-03-09 08:01:10 +08:00
|
|
|
if test "x${RESET}" = x1 ; then rm -fr ${BASELINERAW}/*.dmp ; fi
|
|
|
|
for f in $F ; do
|
|
|
|
echo "testing: $f"
|
2017-04-08 05:43:01 +08:00
|
|
|
URL="[dap4]file://${DAPTESTFILES}/${f}"
|
2017-11-18 01:49:06 +08:00
|
|
|
if ! ${VG} ${NCDUMP} "${URL}" > ./results_test_raw/${f}.dmp; then
|
2017-03-09 08:01:10 +08:00
|
|
|
failure "${URL}"
|
|
|
|
fi
|
|
|
|
if test "x${TEST}" = x1 ; then
|
2017-11-18 01:49:06 +08:00
|
|
|
if ! diff -wBb ${BASELINERAW}/${f}.dmp ./results_test_raw/${f}.dmp ; then
|
2017-03-09 08:01:10 +08:00
|
|
|
failure "diff ${f}.dmp"
|
|
|
|
fi
|
|
|
|
elif test "x${RESET}" = x1 ; then
|
|
|
|
echo "${f}:"
|
2017-11-18 01:49:06 +08:00
|
|
|
cp ./results_test_raw/${f}.dmp ${BASELINERAW}/${f}.dmp
|
2017-03-09 08:01:10 +08:00
|
|
|
elif test "x${DIFF}" = x1 ; then
|
|
|
|
echo "hdrtest: ${f}"
|
|
|
|
rm -f ./tr1 ./tr2 ./tb1 ./tb2
|
|
|
|
baseclean
|
|
|
|
if ! diff -wBb ./${BASELINERAW}/${f}.dmp ./${BASELINE}/${f}.ncdump ; then
|
|
|
|
failure diff -wBb ./${BASELINERAW}/${f}.dmp ./${BASELINE}/${f}.ncdump
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
2017-11-18 01:49:06 +08:00
|
|
|
rm -rf ./results_test_raw
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
finish
|
2017-04-04 11:39:44 +08:00
|
|
|
|