netcdf-c/dap4_test/test_raw.sh
Dennis Heimbigner d62a9e623c Fix the NC_INMEMORY code to work in all cases with HDF5 1.10.
re: github issue https://github.com/Unidata/netcdf-c/issues/1111

One of the less common use cases for the in-memory feature is
apparently failing with HDF5-1.10.x.  The fix is complicated and
requires significant changes to libhdf5/nc4memcb.c. The current
setup is detailed in the file docs/inmeminternal.dox.

Additionally, it was discovered that the program
nc_test/tst_inmemory.c, which is invoked by
nc_test/run_inmemory.sh, actually was failing because of the
above problem. But the failure is not detected since the script
does not return non-zero value.

Other Changes:
1. Fix nc_test_tst_inmemory to return errors correctly.
2. Make ncdap_tests/findtestserver.c and dap4_tests/findtestserver4.c
   be generated from ncdap_test/findtestserver.c.in.
3. Make LOG() print output to stderr instead of stdout to
   avoid contaminating e.g. ncdump output.
4. Modify the handling of NC_INMEMORY and NC_DISKLESS flags
   to properly handle that NC_DISKLESS => NC_INMEMORY. This
   affects a number of code pieces, especially memio.c.
2018-09-04 11:27:47 -06:00

71 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
set -e
. ${srcdir}/d4test_common.sh
echo "test_raw.sh:"
# Compute the set of testfiles
cd ${srcdir}/daptestfiles
F=`ls -1d *.dap`
cd -
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
}
setresultdir results_test_raw
if test "x${RESET}" = x1 ; then rm -fr ${BASELINERAW}/*.dmp ; fi
for f in $F ; do
echo "testing: $f"
URL="[log][dap4]file://${DAPTESTFILES}/${f}"
if ! ${NCDUMP} "${URL}" > ${builddir}/results_test_raw/${f}.dmp; then
failure "${URL}"
fi
if test "x${TEST}" = x1 ; then
if ! diff -wBb ${BASELINERAW}/${f}.dmp ${builddir}/results_test_raw/${f}.dmp ; then
failure "diff ${f}.dmp"
fi
elif test "x${RESET}" = x1 ; then
echo "${f}:"
cp ${builddir}/results_test_raw/${f}.dmp ${BASELINERAW}/${f}.dmp
elif test "x${DIFF}" = x1 ; then
echo "hdrtest: ${f}"
baseclean
if ! diff -wBb ${BASELINERAW}/${f}.dmp ${BASELINE}/${f}.ncdump ; then
failure diff -wBb ${BASELINERAW}/${f}.dmp ${BASELINE}/${f}.ncdump
fi
fi
done
rm -rf ${builddir}/results_test_raw
finish