2010-06-03 21:24:43 +08:00
|
|
|
#!/bin/sh
|
2017-03-09 08:01:10 +08:00
|
|
|
|
2017-09-21 01:22:33 +08:00
|
|
|
set -e
|
|
|
|
|
2017-09-15 04:18:56 +08:00
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
2017-03-09 08:01:10 +08:00
|
|
|
. ../test_common.sh
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
# This shell script runs the ncdump tests.
|
2017-09-15 04:18:56 +08:00
|
|
|
# get some config.h parameters
|
|
|
|
if test -f ${top_builddir}/config.h ; then
|
|
|
|
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
|
|
|
CDF5=1
|
|
|
|
else
|
|
|
|
CDF5=0
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Cannot locate config.h"
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-06-03 21:24:43 +08:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "*** Testing ncgen and ncdump with 64-bit offset format."
|
|
|
|
set -e
|
2017-09-21 01:17:33 +08:00
|
|
|
echo "*** creating test0_offset.nc from test0.cdl..."
|
|
|
|
${NCGEN} -b -k2 -o test0_offset.nc $srcdir/test0.cdl
|
|
|
|
echo "*** creating test1_offset.cdl from test0_offset.nc..."
|
2017-09-21 01:22:33 +08:00
|
|
|
${NCDUMP} -n test1_offset test0_offset.nc > test1_offset.cdl
|
2017-09-21 01:17:33 +08:00
|
|
|
echo "*** creating test1_offset.nc from test1_offset.cdl..."
|
2017-09-21 01:22:33 +08:00
|
|
|
${NCGEN} -b -k2 -o test1_offset.nc test1_offset.cdl
|
2017-09-21 01:17:33 +08:00
|
|
|
echo "*** creating test2_offset.cdl from test1.nc..."
|
|
|
|
${NCDUMP} test1_offset.nc > test2_offset.cdl
|
|
|
|
cmp test1_offset.cdl test2_offset.cdl
|
2010-06-03 21:24:43 +08:00
|
|
|
echo "*** All ncgen and ncdump with 64-bit offset format tests passed!"
|
2015-08-16 06:26:35 +08:00
|
|
|
|
2017-09-15 04:18:56 +08:00
|
|
|
|
2017-09-21 01:17:33 +08:00
|
|
|
if test "x$CDF5" = x1 ; then
|
2015-08-16 06:26:35 +08:00
|
|
|
echo ""
|
|
|
|
echo "*** Testing ncgen and ncdump with CDF5 format."
|
|
|
|
set -e
|
2017-09-21 01:17:33 +08:00
|
|
|
echo "*** creating test0_cdf5.nc from test0.cdl..."
|
2017-09-21 01:22:33 +08:00
|
|
|
${NCGEN} -b -k5 -o test0_cdf5.nc $srcdir/test0.cdl
|
2017-09-21 01:17:33 +08:00
|
|
|
echo "*** creating test1_cdf5.cdl from test0_cdf5.nc..."
|
2017-09-21 01:22:33 +08:00
|
|
|
${NCDUMP} -n test1_cdf5 test0_cdf5.nc > test1_cdf5.cdl
|
2017-09-21 01:17:33 +08:00
|
|
|
echo "*** creating test1_cdf5.nc from test1_cdf5.cdl..."
|
2017-09-21 01:22:33 +08:00
|
|
|
${NCGEN} -b -k5 -o test1_cdf5.nc test1_cdf5.cdl
|
2017-09-21 01:17:33 +08:00
|
|
|
echo "*** creating test2_cdf5.cdl from test1_cdf5.nc..."
|
|
|
|
${NCDUMP} test1_cdf5.nc > test2_cdf5.cdl
|
|
|
|
cmp test1_cdf5.cdl test2_cdf5.cdl
|
2015-08-16 06:26:35 +08:00
|
|
|
echo "*** All ncgen and ncdump with CDF5 format tests passed!"
|
2017-09-15 04:18:56 +08:00
|
|
|
fi
|
2015-08-16 06:26:35 +08:00
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
exit 0
|