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