2010-06-03 21:24:43 +08:00
|
|
|
#!/bin/sh
|
|
|
|
# This shell script runs the ncdump tests.
|
|
|
|
# $Id: run_tests.sh,v 1.18 2010/05/19 13:43:39 ed Exp $
|
|
|
|
|
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
|
|
|
cat $srcdir/ref_tst_small.cdl
|
|
|
|
${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
|
|
|
|
|
|
|
echo "*** creating test0.nc from test0.cdl..."
|
2017-03-09 08:01:10 +08:00
|
|
|
${NCGEN} -b $srcdir/test0.cdl
|
2010-06-03 21:24:43 +08:00
|
|
|
echo "*** creating test1.cdl from test0.nc..."
|
2017-03-09 08:01:10 +08:00
|
|
|
${NCDUMP} -n test1 test0.nc > test1.cdl
|
2010-06-03 21:24:43 +08:00
|
|
|
echo "*** creating test1.nc from test1.cdl..."
|
2017-03-09 08:01:10 +08:00
|
|
|
${NCGEN} -b test1.cdl
|
2010-06-03 21:24:43 +08:00
|
|
|
echo "*** creating test2.cdl from test1.nc..."
|
2017-03-09 08:01:10 +08:00
|
|
|
${NCDUMP} test1.nc > test2.cdl
|
2010-06-03 21:24:43 +08:00
|
|
|
echo "*** checking that test1.cdl and test2.cdl are the same..."
|
2012-05-09 03:36:27 +08:00
|
|
|
diff -b -w test1.cdl test2.cdl
|
2010-06-03 21:24:43 +08:00
|
|
|
|
|
|
|
echo "*** All tests of ncgen and ncdump using test0.cdl passed!"
|
|
|
|
exit 0
|