File: message_count.sh

package info (click to toggle)
eccodes 2.44.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 150,248 kB
  • sloc: cpp: 163,056; ansic: 26,308; sh: 21,602; f90: 6,854; perl: 6,363; python: 5,087; java: 2,226; javascript: 1,427; yacc: 854; fortran: 543; lex: 359; makefile: 285; xml: 183; awk: 66
file content (33 lines) | stat: -rwxr-xr-x 685 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

# check the fortran against the tools for the support for 
# multi gribs to be consistent

#set -x

. ./include.sh

files="regular_latlon_surface_constant.grib1 \
	regular_latlon_surface_constant.grib2"

# check against tool with support for multi off
function test_multi() {
	for grib_file in `echo $files`; do
		grib_file=${data_dir}/$grib_file

		if [ ! -f $grib_file ]; then
			echo "Data file missing: $grib_file"
			exit 1
		fi

		fn=`${examples_dir}/$1 $grib_file`
		n=`${tools_dir}/$2 -p count $grib_file | wc -l`
		if [ ! $fn = $n ]; then
			false
			exit
		fi
	done
}

test_multi "message_count_multi 0" "grib_get -M"
test_multi "message_count_multi 1" "grib_get"