2015-05-29 05:03:02 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
2015-05-29 05:03:02 +08:00
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
verbose=1
|
|
|
|
set -e
|
2015-05-29 05:03:02 +08:00
|
|
|
|
|
|
|
# Setup
|
|
|
|
PASS=1
|
|
|
|
|
|
|
|
# Define the .cdl files to test
|
|
|
|
CLASSIC="small ref_tst_nans ref_tst_utf8"
|
|
|
|
EXTENDED="ref_nc_test_netcdf4 ref_tst_comp ref_tst_opaque_data"
|
|
|
|
|
2017-11-17 23:22:49 +08:00
|
|
|
rm -fr ./results_tst_inmemory_nc3
|
|
|
|
mkdir ./results_tst_inmemory_nc3
|
2015-05-29 05:03:02 +08:00
|
|
|
|
|
|
|
# Dump classic files two ways and compare
|
|
|
|
dotest() {
|
|
|
|
K=$1
|
|
|
|
for f in $2 ; do
|
|
|
|
echo "Testing ${f}"
|
2017-11-17 23:22:49 +08:00
|
|
|
${NCGEN} -$K -o ./results_tst_inmemory_nc3/${f}.nc ${srcdir}/${f}.cdl
|
|
|
|
${NCDUMP} ./results_tst_inmemory_nc3/${f}.nc > ./results_tst_inmemory_nc3/${f}.cdl
|
|
|
|
${NCDUMP} -Xm ./results_tst_inmemory_nc3/${f}.nc > ./results_tst_inmemory_nc3/${f}.cdx
|
|
|
|
diff -w ./results_tst_inmemory_nc3/${f}.cdl ./results_tst_inmemory_nc3/${f}.cdx &> ./results_tst_inmemory_nc3/${f}.diff
|
|
|
|
if test -s ./results_tst_inmemory_nc3/${f}.diff ; then
|
2015-05-29 05:03:02 +08:00
|
|
|
echo "***FAIL: $f"
|
|
|
|
PASS=0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2015-05-29 09:23:33 +08:00
|
|
|
dotest "3" "$CLASSIC"
|
2015-05-29 05:03:02 +08:00
|
|
|
|
|
|
|
# Cleanup
|
2017-11-17 23:22:49 +08:00
|
|
|
rm -fr results_tst_inmemory_nc3
|
2015-05-29 05:03:02 +08:00
|
|
|
|
|
|
|
if test "x$PASS" = x1 ; then
|
|
|
|
echo "*** PASS all tests"
|
|
|
|
CODE=0
|
|
|
|
else
|
|
|
|
CODE=1
|
|
|
|
fi
|
|
|
|
exit $CODE
|