netcdf-c/dap4_test/tst_parse.sh
Dennis Heimbigner 6d8809100f Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh)
1. When running under windows (as opposed to cygwin)
   we need to make sure to not user /cygdrive/ file paths.
   This was ocurring in libdap4/d4read.c, but may occur
   elsewhere.
2. Shell scripts in the git repo are not being checked-out
   with the executable mode set. Had core.filemode set to false.
   Was a major hassle to fix.
2017-04-03 21:39:44 -06:00

43 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
. ${srcdir}/d4test_common.sh
cd ${DMRTESTFILES}
F=`ls -1 *.dmr | sed -e 's/[.]dmr//' |tr '\r\n' ' '`
cd $WD
if test "x${RESET}" = x1 ; then rm -fr ${BASELINE}/*.d4p ; fi
for f in $F ; do
echo "testing: $f"
if ! ${VG} ${execdir}/test_parse ${DMRTESTFILES}/${f}.dmr > ./results/${f}.d4p ; then
failure "${f}"
fi
if test "x${TEST}" = x1 ; then
if ! diff -wBb ${BASELINE}/${f}.d4p ./results/${f}.d4p ; then
failure "${f}"
fi
elif test "x${DIFF}" = x1 ; then
echo "diff -wBb ${DMRTESTFILES}/${f}.dmr ./results/${f}.d4p"
rm -f ./tmp
cat ./results/${f}.d4p \
| sed -e '/<Dimensions>/d' -e '/<Types>'/d -e '/<Variables>'/d -e '/<Groups>'/d \
| sed -e '/<\/Dimensions>/d' -e '/<\/Types>'/d -e '/<\/Variables>'/d -e '/<\/Groups>'/d \
| sed -e '/_edu.ucar.opaque.size/,+2d' \
| cat > ./tmp
if ! diff -wBb ${DMRTESTFILES}/${f}.dmr ./tmp ; then
failure "${f}"
fi
elif test "x${RESET}" = x1 ; then
echo "${f}:"
cp ./results/${f}.d4p ${BASELINE}/${f}.d4p
fi
done
finish
exit 0