File: lfs-tests

package info (click to toggle)
netcdf 1:4.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 104,952 kB
  • sloc: ansic: 228,683; sh: 10,980; yacc: 2,561; makefile: 1,319; lex: 1,173; xml: 173; awk: 2
file content (54 lines) | stat: -rw-r--r-- 1,598 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
#!/bin/sh
# test ncgen3 for generating classic and 64-bit offset files
# Argument, if any, is a directory into which (large) files are written.

case $# in
    0)  
	LFSDIR=. ;;
    1)
	LFSDIR=$1 ;;
    *)  
        echo too many args
        exit 1
esac

NCGEN=./ncgen3
NCDUMP=../ncdump/ncdump

# test large netCDF files with fixed vars, record vars
for version in 1 2; do  # version 1 is classic, version 2 is 64-bit offset
    for file in bigf$version bigr$version; do
	if $NCGEN -b -x -v $version -o $LFSDIR/$file.nc $file.cdl
        then
	    echo "*** success: $NCGEN -b -x -v $version -o $LFSDIR/$file.nc $file.cdl"
	    rm $LFSDIR/$file.nc
	else
	    echo "### failure: $NCGEN -b -x -v $version -o $LFSDIR/$file.nc $file.cdl"
	    exit 1
	fi
    done
done

# test for detection of variables that are too big for classic format
for file in bigf2 bigr2; do
    if $NCGEN -b -x -v 1 -o $LFSDIR/$file.nc $file.cdl 2>/dev/null
    then
        echo "### failure detecting error: $NCGEN -b -x -v 1 -o $LFSDIR/$file.nc $file.cdl"
        rm -f $file.nc
    else
        echo "*** success detecting error: $NCGEN -b -x -v 1 -o $LFSDIR/$file.nc $file.cdl"
    fi
done

# test for detection of variables that are too big for 64-bit offset format
for file in bigf3 bigr3; do
    if $NCGEN -b -x -v 2 -o $LFSDIR/$file.nc $file.cdl 2>/dev/null
    then
        echo "### failure detecting error: $NCGEN -b -x -v 2 -o $LFSDIR/$file.nc $file.cdl"
        rm -f $file.nc
    else
        echo "*** success detecting error: $NCGEN -b -x -v 2 -o $LFSDIR/$file.nc $file.cdl"
    fi
done

rm -f test.cdl *.nc