netcdf-c/ncdap_test/tst_ncdap3.sh
Dennis Heimbigner 05d078a8b0 The ncdap_tests were a mess, so I decided to clean them up
to remove cruft and to remove unused site tests
and make the tests somewhat more understandable.

Also did a fix to libdispatch/dwinpath to convert
relative paths to absolute paths. This will, I hope,
take care of some windows path problems when using
$srcdir in shell scripts.
2018-03-20 21:31:31 -06:00

49 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
if test "x$SETX" = x1 ; then set -x ; fi
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
set -e
. ${srcdir}/tst_utils.sh
# get the list of test files
. ${srcdir}/tst_filelists.sh
# Test executor
dotests() {
for x in ${FILETESTS} ; do
url="${PARAMS}${FILEURL}/$x"
if test "x$quiet" = "x0" ; then echo "*** Testing: ${x} ; url=$url" ; fi
# determine if this is an xfailtest
isxfail=0
if test "x${XFAILTESTS}" != x ; then
if IGNORE=`echo -n " ${XFAILTESTS} " | fgrep " ${x} "`; then isxfail=1; fi
fi
ok=1
if ${NCDUMP} ${FLAGS} "${url}" | sed 's/\\r//g' > ${x}.dmp ; then ok=$ok; else ok=0; fi
# compare with expected
if diff -w ${EXPECTED}/${x}.dmp ${x}.dmp ; then ok=$ok; else ok=0; fi
processstatus
done
}
TITLE="DAP to netCDF-3 translation using files"
EXPECTED="$expected3"
RESULTSDIR="file_results"
rm -fr ${RESULTSDIR}
mkdir "${RESULTSDIR}"
echo "*** Testing $TITLE "
echo " Base URL: ${TESTURL}"
echo " Client Parameters: ${PARAMS}"
cd ${RESULTSDIR}
dotests file
cd ..
summarize
cleanup
doexit