2010-06-03 21:24:43 +08:00
|
|
|
#!/bin/sh
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
|
|
|
|
2019-11-01 06:08:57 +08:00
|
|
|
verbose=1
|
2010-06-03 21:24:43 +08:00
|
|
|
set -e
|
|
|
|
|
2019-11-01 06:08:57 +08:00
|
|
|
# Setup
|
|
|
|
PASS=1
|
2010-06-03 21:24:43 +08:00
|
|
|
|
2019-11-01 06:08:57 +08:00
|
|
|
# Do some limited testing of the ncgen -lc generated code
|
2010-06-03 21:24:43 +08:00
|
|
|
|
2019-11-01 06:08:57 +08:00
|
|
|
NETCDF4=0
|
|
|
|
if test -f ${top_builddir}/libnetcdf.settings ; then
|
|
|
|
if grep 'HDF5 Support:.*yes' ${top_builddir}/libnetcdf.settings >/dev/null ; then
|
|
|
|
NETCDF4=1
|
2010-06-03 21:24:43 +08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-11-01 06:08:57 +08:00
|
|
|
# Dump classic files two ways and compare
|
|
|
|
dotest() {
|
|
|
|
K=$1
|
|
|
|
SF="_${K}"
|
|
|
|
for f in $2 ; do
|
|
|
|
echo "Testing ${f}"
|
|
|
|
F="${f}${SF}"
|
|
|
|
rm -f ./ctest_${F}.c
|
2019-11-04 03:03:13 +08:00
|
|
|
${NCGEN} -$K -lc ${srcdir}/ref_tst_${f}.cdl > ./ctest_${F}.c
|
2019-11-01 06:08:57 +08:00
|
|
|
diff -w ./ctest_${F}.c ${srcdir}/ref_ctest_${F}.c
|
|
|
|
done
|
|
|
|
}
|
2010-06-03 21:24:43 +08:00
|
|
|
|
2019-11-04 03:03:13 +08:00
|
|
|
#dotest 3 "small"
|
2019-11-01 06:08:57 +08:00
|
|
|
if test "x$NETCDF4" = x1 ; then
|
2019-11-04 03:03:13 +08:00
|
|
|
# dotest 4 "small special_atts"
|
|
|
|
dotest 4 "special_atts"
|
2019-11-01 06:08:57 +08:00
|
|
|
fi
|