2010-06-03 21:24:43 +08:00
|
|
|
#!/bin/sh
|
|
|
|
# This shell script runs the ncdump tests.
|
2019-03-12 23:54:16 +08:00
|
|
|
# Ed Hartnett, Dennis Heimbigner
|
2010-06-03 21:24:43 +08:00
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
2014-09-19 08:26:06 +08:00
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
set -e
|
2010-06-03 21:24:43 +08:00
|
|
|
echo ""
|
|
|
|
echo "*** Testing ncgen and ncdump using some test CDL files."
|
|
|
|
echo "*** creating tst_small.nc from ref_tst_small.cdl..."
|
2017-03-09 08:01:10 +08:00
|
|
|
${NCGEN} -b -o tst_small.nc $srcdir/ref_tst_small.cdl
|
2010-06-03 21:24:43 +08:00
|
|
|
echo "*** creating tst_small.cdl from tst_small.nc..."
|
2017-03-09 08:01:10 +08:00
|
|
|
${NCDUMP} tst_small.nc > tst_small.cdl
|
2012-05-09 03:36:27 +08:00
|
|
|
diff -b -w tst_small.cdl $srcdir/ref_tst_small.cdl
|
2010-06-03 21:24:43 +08:00
|
|
|
|
2017-09-21 01:17:33 +08:00
|
|
|
echo "*** creating test0_ncdump.nc from test0.cdl..."
|
2017-09-21 01:22:33 +08:00
|
|
|
${NCGEN} -o test0_ncdump.nc -b $srcdir/test0.cdl
|
2017-09-21 01:17:33 +08:00
|
|
|
echo "*** creating test1_ncdump.cdl from test0_ncdump.nc..."
|
2017-09-21 01:22:33 +08:00
|
|
|
${NCDUMP} -n test1_ncdump test0_ncdump.nc > test1_ncdump.cdl
|
2017-09-21 01:17:33 +08:00
|
|
|
echo "*** creating test1_ncdump.nc from test1_ncdump.cdl..."
|
|
|
|
${NCGEN} -b test1_ncdump.cdl
|
|
|
|
echo "*** creating test2_ncdump.cdl from test1_ncdump.nc..."
|
|
|
|
${NCDUMP} test1_ncdump.nc > test2_ncdump.cdl
|
|
|
|
echo "*** checking that test1_ncdump.cdl and test2_ncdump.cdl are the same..."
|
|
|
|
diff -b -w test1_ncdump.cdl test2_ncdump.cdl
|
2010-06-03 21:24:43 +08:00
|
|
|
|
|
|
|
echo "*** All tests of ncgen and ncdump using test0.cdl passed!"
|
|
|
|
exit 0
|