netcdf-c/ncdap_test/tst_special.sh

150 lines
5.0 KiB
Bash
Raw Normal View History

2010-06-03 21:24:43 +08:00
#!/bin/sh
Primary change: add dap4 support Specific changes: 1. Add dap4 code: libdap4 and dap4_test. Note that until the d4ts server problem is solved, dap4 is turned off. 2. Modify various files to support dap4 flags: configure.ac, Makefile.am, CMakeLists.txt, etc. 3. Add nc_test/test_common.sh. This centralizes the handling of the locations of various things in the build tree: e.g. where is ncgen.exe located. See nc_test/test_common.sh for details. 4. Modify .sh files to use test_common.sh 5. Obsolete separate oc2 by moving it to be part of netcdf-c. This means replacing code with netcdf-c equivalents. 5. Add --with-testserver to configure.ac to allow override of the servers to be used for --enable-dap-remote-tests. 6. There were multiple versions of nctypealignment code. Try to centralize in libdispatch/doffset.c and include/ncoffsets.h 7. Add a unit test for the ncuri code because of its complexity. 8. Move the findserver code out of libdispatch and into a separate, self contained program in ncdap_test and dap4_test. 9. Move the dispatch header files (nc{3,4}dispatch.h) to .../include because they are now shared by modules. 10. Revamp the handling of TOPSRCDIR and TOPBUILDDIR for shell scripts. 11. Make use of MREMAP if available 12. Misc. minor changes e.g. - #include <config.h> -> #include "config.h" - Add some no-install headers to /include - extern -> EXTERNL and vice versa as needed - misc header cleanup - clean up checking for misc. unix vs microsoft functions 13. Change copyright decls in some files to point to LICENSE file. 14. Add notes to RELEASENOTES.md
2017-03-09 08:01:10 +08:00
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.shs
2010-06-03 21:24:43 +08:00
Primary change: add dap4 support Specific changes: 1. Add dap4 code: libdap4 and dap4_test. Note that until the d4ts server problem is solved, dap4 is turned off. 2. Modify various files to support dap4 flags: configure.ac, Makefile.am, CMakeLists.txt, etc. 3. Add nc_test/test_common.sh. This centralizes the handling of the locations of various things in the build tree: e.g. where is ncgen.exe located. See nc_test/test_common.sh for details. 4. Modify .sh files to use test_common.sh 5. Obsolete separate oc2 by moving it to be part of netcdf-c. This means replacing code with netcdf-c equivalents. 5. Add --with-testserver to configure.ac to allow override of the servers to be used for --enable-dap-remote-tests. 6. There were multiple versions of nctypealignment code. Try to centralize in libdispatch/doffset.c and include/ncoffsets.h 7. Add a unit test for the ncuri code because of its complexity. 8. Move the findserver code out of libdispatch and into a separate, self contained program in ncdap_test and dap4_test. 9. Move the dispatch header files (nc{3,4}dispatch.h) to .../include because they are now shared by modules. 10. Revamp the handling of TOPSRCDIR and TOPBUILDDIR for shell scripts. 11. Make use of MREMAP if available 12. Misc. minor changes e.g. - #include <config.h> -> #include "config.h" - Add some no-install headers to /include - extern -> EXTERNL and vice versa as needed - misc header cleanup - clean up checking for misc. unix vs microsoft functions 13. Change copyright decls in some files to point to LICENSE file. 14. Add notes to RELEASENOTES.md
2017-03-09 08:01:10 +08:00
set -e
2010-06-03 21:24:43 +08:00
#EXTSET="hdr dmp"
EXTSET="dmp"
quiet=0
leakcheck=0
# Pick one
CACHE=""
#CACHE="[cache]"
PARAMS="[netcdf3][log]${CACHE}"
#OCLOGFILE=/dev/null
OCLOGFILE="" ; export OCLOGFILE
# Locate the testdata and expected directory
EXPECTED="${srcdir}/special3"
# get the list of test files
##################################################
# Special test info
##################################################
SPECIALTESTS="\
O2_ann_nobs_1deg.nc;http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA01/english/annual/O2_ann_nobs_1deg.nc \
500m;http://ferret.pmel.noaa.gov/thredds/dodsC/hfrnet/agg/500m \
qscat_high_wind;http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/QSCAT/qscat_high_wind \
TOMS-EP_L3-TOMSEPL3_1997m0107_v8.HDF;http://disc1.sci.gsfc.nasa.gov/opendap/Earth_Probe_TOMS_Level3/TOMSEPL3/1997/TOMS-EP_L3-TOMSEPL3_1997m0107_v8.HDF \
ssta.dods;http://iridl.ldeo.columbia.edu/SOURCES/.ENSOFORECAST/.LDEO2/.12MON/.ssta/dods \
dods;http://ingrid.ldeo.columbia.edu/SOURCES/.OBERHUBER/dods \
d055.nc;http://ilikai.soest.hawaii.edu/cgi-bin/nph-dods/fast/d055.nc \
n15.20091003.2145.usf.sst.hdf;http://www.imars.usf.edu/dods-bin/nph-dods/SST_NEW/husf/products/hdf/2009.10/n15.20091003.2145.usf.sst.hdf \
totalAagg;http://nomads.ncdc.noaa.gov/thredds/dodsC/oisst2/totalAagg \
world-unfilter-monthly.nc;http://dapper.pmel.noaa.gov/dapper/oscar/world-unfilter-monthly.nc \
ocean_atlas_monthly.nc;http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/ocean_atlas_monthly.nc \
coads_wspd.cdf;http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_wspd.cdf \
duacs_global_nrt_msla_merged_h_lr;http://opendap.aviso.oceanobs.com/thredds/dodsC/duacs_global_nrt_msla_merged_h_lr \
"
UNUSED="\
NCAR_Abiotic_equil.nc;http://dods.ipsl.jussieu.fr/cgi-bin/nph-dods/ocmip/phase2/NCAR/Abiotic/equil/NCAR_Abiotic_equil.nc \
NCAR_Biotic_equil.nc;http://dods.ipsl.jussieu.fr/cgi-bin/nph-dods/ocmip/phase2/NCAR/Biotic/NCAR_Biotic_equil.nc \
"
XSPECIALTESTS="\
NCAR_Abiotic_equil.nc;http://dods.ipsl.jussieu.fr/cgi-bin/nph-dods/ocmip/phase2/NCAR/Abiotic/equil/NCAR_Abiotic_equil.nc \
NCAR_Biotic_equil.nc;http://dods.ipsl.jussieu.fr/cgi-bin/nph-dods/ocmip/phase2/NCAR/Biotic/NCAR_Biotic_equil.nc \
O2_ann_nobs_1deg.nc;http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/WOA01/english/annual/O2_ann_nobs_1deg.nc \
500m;http://ferret.pmel.noaa.gov/thredds/dodsC/hfrnet/agg/500m \
qscat_high_wind;http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/QSCAT/qscat_high_wind \
TOMS-EP_L3-TOMSEPL3_1997m0107_v8.HDF;http://disc1.sci.gsfc.nasa.gov/opendap/Earth_Probe_TOMS_Level3/TOMSEPL3/1997/TOMS-EP_L3-TOMSEPL3_1997m0107_v8.HDF \
ssta.dods;http://iridl.ldeo.columbia.edu/SOURCES/.ENSOFORECAST/.LDEO2/.12MON/.ssta/dods \
dods;http://ingrid.ldeo.columbia.edu/SOURCES/.OBERHUBER/dods \
d055.nc;http://ilikai.soest.hawaii.edu/cgi-bin/nph-dods/fast/d055.nc \
"
# Temporarily suppress
XFAILTESTS="qscat_high_wind totalAagg world-unfilter-monthly.nc duacs_global_nrt_msla_merged_h_lr 500m"
RESULTSDIR="./results_tst_special"
2010-06-03 21:24:43 +08:00
# Locate some tools
if test "x$leakcheck" = x1 ; then
VALGRIND="valgrind -q --error-exitcode=2 --leak-check=full"
fi
rm -fr ${RESULTSDIR}
mkdir "${RESULTSDIR}"
passcount=0
xfailcount=0
failcount=0
for ext in $EXTSET ; do
CONLY=
if test "x$ext" = xdmp ; then CONLY="-c"; fi
cd ${RESULTSDIR}
for t in ${SPECIALTESTS} ; do
name=`echo $t | cut -d ';' -f1`
url=`echo $t | cut -d ';' -f2`
url="${PARAMS}${url}"
if test "x$quiet" = "x0" ; then echo "*** Testing: ${name}"; fi
if test "x$quiet" = "x0" ; then echo "*** URL: ${url}"; fi
# Ignore missing cases
if test -f ${EXPECTED}/${name}.${ext}
then ignore=1; else echo "Missing: ${EXPECTED}/${name}.${ext}"; continue; fi
# determine if this is an xfailtest
isxfail=0
for x in ${XFAILTESTS} ; do
if test "x${name}" = "x${x}" ; then isxfail=1; fi
done
status=0
if test "$ext" = hdr ; then H="-h" ; else H=""; fi
if ${VALGRIND} ${NCDUMP} $CONLY $H ${url} > ${name}.${ext}
then status=$status; else status=1; fi
sort <${name}.${ext} >${name}.s${ext}
sort <${EXPECTED}/${name}.${ext} >${name}.s${ext}.expected
if diff -w ${name}.s${ext}.expected ${name}.s${ext} # compare with expected
then status=$status; else status=1; fi
if test "x$status" = "x1" ; then
if test "x$isxfail" = "x1" ; then status=2; fi # xfail
fi
case "$status" in
0)
passcount=`expr $passcount + 1`
if test "x$quiet" = "x" ; then echo "*** SUCCEED: ${name}"; fi
;;
1)
failcount=`expr $failcount + 1`
echo "*** FAIL: ${name}"
;;
2)
xfailcount=`expr $xfailcount + 1`
2012-07-18 04:13:17 +08:00
echo "*** XFAIL : ${name}"
2010-06-03 21:24:43 +08:00
;;
esac
done
cd ..
done
rm -fr ${RESULTSDIR}
2010-06-03 21:24:43 +08:00
totalcount=`expr $passcount + $failcount + $xfailcount`
okcount=`expr $passcount + $xfailcount`
echo "*** PASSED: ${okcount}/${totalcount} ; ${xfailcount} expected failures ; ${failcount} unexpected failures"
# Ignore failures for now
#failcount=0
if test "$failcount" -gt 0 ; then
exit 1
else
exit 0
fi