File: tst_formatx3.sh

package info (click to toggle)
netcdf-parallel 1%3A4.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 105,352 kB
  • sloc: ansic: 229,114; sh: 11,180; yacc: 2,561; makefile: 1,390; lex: 1,173; xml: 173; awk: 2
file content (60 lines) | stat: -rwxr-xr-x 1,689 bytes parent folder | download | duplicates (6)
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
#!/bin/sh

if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh

# This shell script runs the ncdump tests.
# get some config.h parameters
if test -f ${top_builddir}/config.h ; then
  if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
    ENABLE_CDF5=1
  else
    ENABLE_CDF5=0
  fi
else
  echo "Cannot locate config.h"
  exit 1
fi

# This shell script tests the output several previous tests.

ECODE=0

echo ""
echo "*** Testing extended file format output."
set -e
echo "Test extended format output for a netcdf-3 file"
rm -f tmp_tst_formatx3
${NCGEN} -k nc3 -b -o ./tst_formatx3.nc $srcdir/ref_tst_small.cdl
${NCDUMP} -K tst_formatx3.nc >tmp_tst_formatx3
if ! grep 'classic mode=00000000' <tmp_tst_formatx3 ; then
echo "*** Fail: extended format for a classic file"
ECODE=1
fi

echo "Test extended format output for a 64-bit offset netcdf-3 file"
rm -f tmp_tst_formatx3
${NCGEN} -k nc6 -b -o ./tst_formatx3.nc $srcdir/ref_tst_small.cdl
${NCDUMP} -K tst_formatx3.nc >tmp_tst_formatx3
if ! grep '64-bit offset mode=00000200' <tmp_tst_formatx3 ; then
echo "*** Fail: extended format for a 64-bit classic file"
ECODE=1
fi


# Only do following test if ENABLE_CDF5 is true.

if test "x$ENABLE_CDF5" = x1 ; then
    echo "Test extended format output for a 64-bit CDF-5 classic file"
    rm -f tmp_tst_formatx3
    ${NCGEN} -k5 -b -o ./tst_formatx3.nc $srcdir/ref_tst_small.cdl
    ${NCDUMP} -K tst_formatx3.nc >tmp_tst_formatx3
    if ! grep -F '64-bit data mode=00000020' <tmp_tst_formatx3 ; then
        echo "*** Fail: extended format for a 64-bit CDF-5 classic file"
        ECODE=1
    fi
fi

rm -f tmp_tst_formatx3 tst_formatx3.nc

exit $ECODE