File: test1.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 (122 lines) | stat: -rwxr-xr-x 2,968 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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/sh

# if this is part of a distcheck action, then this script
# will be executed in a different directory
# than the one containing it; so capture the path to this script
# as the location of the source directory.
srcdir=`dirname $0`
tmp=`echo ${srcdir}|sed -e 's/^\\\\//g'`
if test "${tmp}" = "${srcdir}" ; then
  srcdir=`pwd`/${srcdir}
  tmp=`echo ${srcdir}|sed -e 's/\\\\$//g'`
  srcdir=${tmp}
fi

thisdir=libncdap4

# compute the build directory
# Use a trick to get the proper output when using CYGWIN
# to remove e.g. c: in path
cd `pwd`/..
builddir=`pwd`
cd ${builddir}/${thisdir}

# rewrite srcdir for CYGWIN
cd ${srcdir}/..
srcdir=`pwd`
cd $builddir/${thisdir}

resultsdir="./results"

# Locate some tools
#NCDUMP=${builddir}/ncdump/ncdump
NCDUMP=./ncd

# Locate the testdata and expected directory
testdata="${srcdir}/ncdap_test/testdata3"

# Define the octest options (except -m)
OPTIONS="-h"

##################################################
# Local test info
##################################################

# Define the complete URLS

TESTURLPREFIX="file://${testdata}"

XFAILTESTS=

SYNTHETICDATA="synth1 synth2 synth3 synth4 synth5 synth6"

ACTUALDATA=\
"b31a b31 D1 Drifters \
EOSDB ingrid nestedDAS NestedSeq2 \
NestedSeq OverideExample pbug0001b SimpleDrdsExample \
test.01 test.02 test.03 test.04 \
test.05 test.06a test.06 test.07a \
test.07 test.21 test.22 \
test.23 test.31 test.32 \
test.50 test.53 test.55 \
test.56 test.57 \
test.66 test.67 test.68 test.69 \
test.an1 \
test.dfp1 test.dfr1 test.dfr2 test.dfr3 \
test.gr1 test.gr2 test.gr3 test.gr4 \
test.gr5 test.PointFile test.sds1 \
test.sds2 test.sds3 test.sds4 test.sds5 \
test.sds6 test.sds7 test.vs1 \
test.vs2 test.vs3 test.vs4 test.vs5 whoi \
test.SwathFile \
1990-S1700101.HDF.WVC_Lat 1998-6-avhrr.dat"

TESTSET="${SYNTHETICDATA} ${ACTUALDATA}"

##################################################
# Testing Procedure
##################################################

rm -fr ${resultsdir}
mkdir ${resultsdir}

rm -f ${OCLOGFILE}

passcount=0
xfailcount=0
failcount=0

for x in ${TESTSET} ; do
  url="${TESTURLPREFIX}/$x"
  echo "*** Testing: ${x}"
	# determine if this is an xfailtest
	isxfail=
	for t in ${XFAILTESTS} ; do
	if test "x${t}" = "x${x}" ; then isxfail=1; fi
	done
  ${NCDUMP} ${OPTIONS} ${url} > ${resultsdir}/${x}.dmp
  # compare with expected
if test 0 = 1 ; then
  if diff -w ${expected}/${x}.dmp ${resultsdir}/${x}.dmp ; then
    echo "*** SUCCEED: ${x}"
    passcount=`expr $passcount + 1`
  elif test "x${isxfail}" = "x1" ; then
    echo "*** XFAIL : ${x}"
    xfailcount=`expr $xfailcount + 1`
  else
    echo "*** FAIL: ${x}"
    failcount=`expr $failcount + 1`
  fi
fi
done

totalcount=`expr $passcount + $failcount + $xfailcount`
okcount=`expr $passcount + $xfailcount`

echo "*** PASSED: ${okcount}/${totalcount} ; ${xfailcount} expected failures ; ${failcount} unexpected failures"

if test "$failcount" -gt 0 ; then
  exit 1
else
  exit 0
fi