-
Notifications
You must be signed in to change notification settings - Fork 266
/
Copy pathtst_mud.sh
executable file
·81 lines (69 loc) · 2.22 KB
/
tst_mud.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
# This shell script tests ncdump and ncgen on netCDF-4 variables with multiple
# unlimited dimensions.
set -e
if test "x$TESTNCZARR" = x1 ; then
. "$srcdir/test_nczarr.sh"
s3isolate "testdir_mud4"
else
isolate "testdir_mud4"
ISOPATH=`pwd`
fi
THISDIR=`pwd`
cd $ISOPATH
echo ""
echo "*** Testing ncdump output for multiple unlimited dimensions"
# This is where the ref files are kept
refdir="${srcdir}/../ncdump"
testcase() {
zext=$1
if test "x$TESTNCZARR" = x1 ; then
fileargs "tmp_mud4_${zext}"
deletemap $zext $file
file="$fileurl"
else
file="tmp_mud4_${zext}.nc"
rm -f $file
fi
echo "*** creating netcdf file $file from ref_tst_mud4.cdl ..."
${NCGEN} -4 -b -o $file $refdir/ref_tst_mud4.cdl
echo "*** creating tmp_mud4.cdl from $file ..."
${NCDUMP} -n tst_mud4 $file > tmp_mud4.cdl
# echo "*** comparing tst_mud4.cdl with ref_tst_mud4.cdl..."
diff -b tmp_mud4.cdl $refdir/ref_tst_mud4.cdl
# echo "*** comparing annotation from ncdump -bc $file with expected output..."
${NCDUMP} -n tst_mud4 -bc $file > tmp_mud4-bc.cdl
diff -b tmp_mud4-bc.cdl $refdir/ref_tst_mud4-bc.cdl
# Now test with char arrays instead of ints
if test "x$TESTNCZARR" = x1 ; then
fileargs "tmp_mud4_chars${zext}"
deletemap $zext $file
file="$fileurl"
else
file="tmp_mud4_chars${zext}.nc"
rm -f $file
fi
echo "*** creating netcdf file $file from ref_tst_mud4_chars.cdl ..."
${NCGEN} -4 -b -o $file $refdir/ref_tst_mud4_chars.cdl
echo "*** creating ${file}.cdl from $file ..."
${NCDUMP} -n tst_mud4_chars $file > tmp_mud4_chars.cdl
# echo "*** comparing tmp_mud4_chars.cdl with ref_tst_mud4_chars.cdl..."
diff -b tmp_mud4_chars.cdl $refdir/ref_tst_mud4_chars.cdl
if test 1 = 0 ; then
# unused
echo "*** comparing annotation from ncdump -bc tst_mud4_chars.nc with expected output..."
${NCDUMP} -n tst_mud4_chars -bc $file > tmp_mud4_chars-bc.cdl
diff -b tmp_mud4_chars-bc.cdl $refdir/ref_tst_mud4_chars-bc.cdl
echo "*** All ncdump test output for multiple unlimited dimensions passed!"
fi
}
if test "x$TESTNCZARR" = x1 ; then
testcase file
if test "x$FEATURE_NCZARR_ZIP" = xyes ; then testcase zip ; fi
if test "x$FEATURE_S3TESTS" = xyes ; then testcase s3 ; fi
else
testcase nc
fi
exit 0