File: tst_parse.sh

package info (click to toggle)
netcdf 1%3A4.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • 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 (42 lines) | stat: -rwxr-xr-x 1,103 bytes parent folder | download | duplicates (9)
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
#!/bin/sh

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

. ${srcdir}/d4test_common.sh

cd ${DMRTESTFILES}
F=`ls -1 *.dmr | sed -e 's/[.]dmr//' |tr '\r\n' '  '`
cd $WD

if test "x${RESET}" = x1 ; then rm -fr ${BASELINE}/*.d4p ; fi
for f in $F ; do
    echo "testing: $f"
    if ! ${VG} ${execdir}/test_parse ${DMRTESTFILES}/${f}.dmr > ./results/${f}.d4p ; then
	failure "${f}"
    fi
    if test "x${TEST}" = x1 ; then
	if ! diff -wBb ${BASELINE}/${f}.d4p ./results/${f}.d4p ; then
	    failure "${f}"
	fi
    elif test "x${DIFF}" = x1 ; then
	echo "diff -wBb ${DMRTESTFILES}/${f}.dmr ./results/${f}.d4p"
	rm -f ./tmp
	cat ./results/${f}.d4p \
	| sed -e '/<Dimensions>/d' -e '/<Types>'/d -e '/<Variables>'/d -e '/<Groups>'/d \
	| sed -e '/<\/Dimensions>/d' -e '/<\/Types>'/d -e '/<\/Variables>'/d -e '/<\/Groups>'/d  \
	| sed -e '/_edu.ucar.opaque.size/,+2d' \
	| cat > ./tmp
	if ! diff -wBb ${DMRTESTFILES}/${f}.dmr ./tmp ; then
	    failure "${f}" 
	fi
    elif test "x${RESET}" = x1 ; then
	echo "${f}:" 
	cp ./results/${f}.d4p ${BASELINE}/${f}.d4p	
    fi
done

finish

exit 0