netcdf-c/nczarr_test/run_ut_mapapi.sh
Dennis Heimbigner d85bb6fe20 The big change for this commit is complete the
disengagement of enable-netcdf4 from enable-hdf5.
That is, with the advent of nczarr, it is possible
to turn off hdf5 but still need netcdf-4 enabled
because nczarr uses libsrc4, but not libhdf5.
This change involves a bunch of things:
1. Modify configure.ac and CMakelist to make enable_hdf5
   control if hdf5 support is provided. For back compatibility,
   disable-netcdf4 is treated as disable-hdf5. But internally,
   netcdf4 support is controlled only by the enabling of formats
   that require it.
2. In support of #1, modify .travis.yml to use enable/disable-hdf5
   instead of enable/disable-netcdf4.
3. test_common.in is modified to track selected features,
   including enable-hdf5 and enable-s3-tests. This is used in
   selected tests that mix netcdf-3 and netcdf4 tests.
4. The conflation of USE_HDF5 and USE_NETCDF4 is common in
   code, tests, and build files, so all of those had to be weeded out.
5. It turns out that some of the NC4_dim functions really are HDF5 specific,
   but are not treated as such. So they are moved from nc4dim.c to
   hdf5dim.c or hdf5dispatch.c
6. Some generic functions in libhdf5 can be (and were) moved to libsrc4.
2020-08-12 15:42:50 -06:00

91 lines
2.0 KiB
Bash
Executable File

#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
. "$srcdir/test_nczarr.sh"
set -e
# Test map implementations for consistency at the zmap API
# level. This allows testing of implementations that do not admit
# of easy examination of the actual storage. For example it is
# not easy to look inside S3 storage except using the aws-cli, if
# available.
CMD="${execdir}/ut_mapapi${ext}"
testmapcreate() {
echo ""; echo "*** Test zmap create -k $1"
extfor "$1"
tag="mapapi"
fileargs
deletemap $1 $file
# Create the test file
$CMD -k$1 -x create -f $file
cdl="ut_${tag}_create_${zext}.cdl"
${ZMD} $fileurl > ./$cdl
diff -wb ${srcdir}/ref_$cdl ./$cdl
# delete the test file
$CMD -k$1 -x delete -f $file
rm -f $cdl
mapexists $1
if test mapexists = 0 ; then exit 1; fi
# re-create the test file
$CMD -k$1 -x create -o $file
}
testmapmeta() {
echo ""; echo "*** Test zmap read/write meta -k $1"
extfor "$1"
tag="mapapi"
fileargs
$CMD -k$1 -x simplemeta -f $file
cdl="ut_${tag}_meta_${zext}.cdl"
${ZMD} $fileurl > ./$cdl
diff -wb ${srcdir}/ref_$cdl ./$cdl
}
testmapdata() {
echo ""; echo "*** Test zmap read/write data -k $1"
extfor "$1"
tag="mapapi"
fileargs
$CMD -k$1 -x "simpledata" -f $file
cdl="ut_${tag}_data_${zext}.cdl"
${ZMD} $fileurl > ./$cdl
diff -wb ${srcdir}/ref_$cdl ./$cdl
}
testmapsearch() {
echo ""; echo "*** Test zmap search -k $1"
extfor "$1"
tag="mapapi"
fileargs
txt=ut_${tag}_search_$zext.txt
rm -f $txt
$CMD -k$1 -x "search" -f $file > $txt
diff -wb ${srcdir}/ref_$txt ./$txt
}
main() {
echo ""
echo "*** Map Unit Testing"
echo ""; echo "*** Test zmap_nzf"
testmapcreate nzf; testmapmeta nzf; testmapdata nzf; testmapsearch nzf
if test "x$FEATURE_HDF5" = xyes ; then
echo ""; echo "*** Test zmap_nz4"
testmapcreate nz4; testmapmeta nz4; testmapdata nz4; testmapsearch nz4
fi
if test "x$FEATURE_S3TESTS" = xyes ; then
echo ""; echo "*** Test zmap_s3sdk"
testmapcreate s3; testmapmeta s3; testmapdata s3; testmapsearch s3
fi
}
main