Enspctl.test.in 912 Bytes
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
#! @BASH@
2
3
4
5
6
echo 1..1 # Number of tests to be executed.
#
test -n "$CDO"      || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
#
7
8
CDOOUT=cout$$
CDOERR=cerr$$
9
10
11
12
PCTLS="1 20 25 33 50 66 75 80 99 100"
#
IFILE=$DATAPATH/ts_mm_5years
export CDO_FILE_SUFFIX=NULL
13
14
$CDO splityear $IFILE ${$}ts_year
IFILES="${$}ts_year????"
15
16
17
18
19
20
21
22
23
24
#
NTEST=1
RSTAT=0
echo "Running test: $NTEST"
#
for PCTL in $PCTLS; do
  RFILE=$DATAPATH/enspctl${PCTL}_ref
  OFILE=enspctl${STAT}_res

  CDOTEST="enspctl"
25
  CDOCOMMAND="$CDO enspctl,${PCTL} $IFILES $OFILE"
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

  echo "$CDOCOMMAND"

  $CDOCOMMAND
  test $? -eq 0 || let RSTAT+=1

  $CDO diff $OFILE $RFILE > $CDOOUT 2> $CDOERR
  test $? -eq 0 || let RSTAT+=1
  test -s $CDOOUT && let RSTAT+=1
  cat $CDOOUT $CDOERR

#  let NTEST+=1
  rm -f $OFILE
done
#
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
#
rm -f $CDOOUT $CDOERR
45
rm -f $IFILES
46
47
#
exit 0