Commit 805bbe8d authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

runTest: cleanup.

parent 52f45bd1
......@@ -14,18 +14,16 @@ NTEST=1
#
for STAT in $STATS; do
if [ -z "$1" ] || [ $NTEST == $1 ]; then
RSTAT=0
CDOTEST="$STAT"
IFILE1=$DATAPATH/arith1.srv
IFILE2=$DATAPATH/arithmask.srv
OFILE=arith${STAT}_res
RFILE=$DATAPATH/arith${STAT}_ref
CDOTEST="$STAT"
CDOCOMMAND="$CDO $FORMAT ${STAT} $IFILE1 $IFILE2 $OFILE"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
runTest
rm -f $OFILE
fi
let NTEST+=1
......@@ -33,37 +31,27 @@ done
for STAT in $STATS; do
if [ -z "$1" ] || [ $NTEST == $1 ]; then
RSTAT=0
# expr,instr var
OP=""
if [ "$STAT" = add ] ; then OP='+' ; fi
if [ "$STAT" = sub ] ; then OP='-' ; fi
if [ "$STAT" = mul ] ; then OP='*' ; fi
if [ "$STAT" = div ] ; then OP='/' ; fi
RFILE=$DATAPATH/arith${STAT}_ref
CDOTEST="$STAT"
echo "Running test: $NTEST - expr $CDOTEST"
# expr,instr var
IFILE=$DATAPATH/expr1.srv
OFILE=expr${STAT}_res
OP=""
if [ "$STAT" = add ] ; then OP='+' ; fi
if [ "$STAT" = sub ] ; then OP='-' ; fi
if [ "$STAT" = mul ] ; then OP='*' ; fi
if [ "$STAT" = div ] ; then OP='/' ; fi
INSTR="var215=var215${OP}var3;var216=var216${OP}var3;"
echo $INSTR
CDOCOMMAND="$CDO $FORMAT expr,$INSTR $IFILE $OFILE"
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
RFILE=$DATAPATH/arith${STAT}_ref
IFILE=$DATAPATH/expr1.srv
OFILE=expr${STAT}_res
$CDO diff $OFILE $RFILE
test $? -eq 0 || let RSTAT+=1
INSTR="var215=var215${OP}var3;var216=var216${OP}var3;"
echo $INSTR
rm -f $OFILE
CDOTEST="$STAT"
CDOCOMMAND="$CDO $FORMAT expr,$INSTR $IFILE $OFILE"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
runTest
rm -f $OFILE
fi
let NTEST+=1
......
#! @BASH@
. ./cdoTestFunctions.test
#
echo 1..1 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
STATS="cat"
FORMAT="-f srv -b 32"
RSTAT=0
#
IFILE=$DATAPATH/t21_geosp_tsurf.grb
#
......@@ -20,11 +21,12 @@ cat $IFILE >> ${RFILE}
#
rm -f ${OFILE}
#
NTEST=1
CDOTEST="cat"
CDOCOMMAND="$CDO $STATS $IFILE ${OFILE}"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
#
runTest "1" "$CDOTEST" "$CDODOMMAND" "$TESTCOMMAND"
runTest
#
rm -f $OFILE $RFILE
#
......
......@@ -16,7 +16,6 @@ IFILES="${$}ts_year????"
#
STATS="enspctl"
NTEST=1
RSTAT=0
echo "Running test: $NTEST"
#
for PCTL in $PCTLS; do
......@@ -28,7 +27,7 @@ for PCTL in $PCTLS; do
CDOCOMMAND="$CDO $STATS,${PCTL} $IFILES $OFILE"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
runTest
rm -f $OFILE
fi
let NTEST+=1
......
#! @BASH@
#
. ./cdoTestFunctions.test
#
echo 1..24 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
......@@ -22,8 +22,6 @@ for RUN in 1 2; do
for STAT in $STATS; do
if [ -z "$1" ] || [ $NTEST == $1 ]; then
RSTAT=0
if [ $RUN = 2 ] ; then
RFILE=$DATAPATH/${TYPE}m${STAT}_ref
OFILE=${TYPE}m${STAT}_res
......@@ -37,7 +35,7 @@ for RUN in 1 2; do
CDOCOMMAND="$CDO ${TYPE}${STAT} $IFILES $OFILE"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
runTest
rm -f $OFILE
fi
let NTEST+=1
......
#! @BASH@
. ./cdoTestFunctions.test
#
echo 1..3 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
......@@ -14,16 +16,14 @@ NTEST=1
#
for i in {0..2}; do
if [ -z "$1" ] || [ $NTEST == $1 ]; then
RSTAT=0
RFILE=$DATAPATH/${STATS[i]}_ref
OFILE=${1}_res
CDOTEST="${STATS[i]},${ARGS[i]}"
CDOTEST="${STATS[i]},${ARGS[i]}"
CDOCOMMAND="$CDO $FORMAT ${STATS[i]},${ARGS[i]} $IFILE $OFILE"
TESTCOMMAND="diff $RFILE $OFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
runTest
rm -f $OFILE
fi
let NTEST+=1
......
#! @BASH@
#
. ./cdoTestFunctions.test
#
echo 1..10 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
......@@ -14,7 +14,6 @@ PCTLS="1 20 25 33 50 66 75 80 99 100"
IFILE=$DATAPATH/t21_geosp_tsurf.grb
#
NTEST=1
RSTAT=0
STATS="fldpctl"
echo "Running test: $NTEST"
#
......@@ -27,7 +26,7 @@ for PCTL in $PCTLS; do
CDOCOMMAND="$CDO $FORMAT $STATS,${PCTL} $IFILE $OFILE"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
runTest
rm -f $OFILE
fi
let NTEST+=1
......
#! @BASH@
#
. ./cdoTestFunctions.test
#
echo 1..10 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
......@@ -25,7 +25,8 @@ for TYPE in $OPERTYPES; do
CDOTEST="${TYPE}$STAT"
CDOCOMMAND="$CDO $FORMAT ${TYPE}${STAT},64,32 $IFILE $OFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
runTest
rm -f $OFILE
fi
let NTEST+=1
......
#! @BASH@
. ./cdoTestFunctions.test
#
echo 1..4 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
......@@ -15,16 +17,14 @@ NTEST=1
#
for STAT in $STATS; do
if [ -z "$1" ] || [ $NTEST == $1 ]; then
RSTAT=0
RFILE=$DATAPATH/${STAT}_ref
CDOTEST="$STAT"
OFILE=${STAT}_res
CDOTEST="$STAT"
CDOCOMMAND="$CDO $FORMAT ${STAT} $IFILE1 $IFILE2 $OFILE"
DIFFCOMMAND="$CDO diff $OFILE $RFILE"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$DIFFCOMMAND"
runTest
rm -f $OFILE
let NTEST+=1
......
#! @BASH@
. ./cdoTestFunctions.test
#
echo 1..2 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
......@@ -15,7 +17,6 @@ NTEST=1
#
for X in 1 2; do
if [ -z "$1" ] || [ $NTEST == $1 ]; then
RSTAT=0
RFILE=$DATAPATH/remapeta_ref
VCT=$DATAPATH/VCT.L62
IFILE=$DATAPATH/remapeta${X}.nc
......@@ -26,7 +27,7 @@ for X in 1 2; do
TESTCOMMAND="$CDO diff,abslim=$ABSLIM $OFILE $RFILE"
if [ "${HAS_NETCDF}" = yes ] ; then
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
runTest
else
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST # SKIP netCDF not enabled"
fi
......
#! @BASH@
#
. ./cdoTestFunctions.test
#
echo 1..10 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
......@@ -15,7 +15,6 @@ IFILE=$DATAPATH/ts_mm_5years
#
STATS="runpctl"
NTEST=1
RSTAT=0
#
for PCTL in $PCTLS; do
RFILE=$DATAPATH/runpctl${PCTL}_ref
......@@ -25,7 +24,7 @@ for PCTL in $PCTLS; do
CDOCOMMAND="$CDO $FORMAT $STATS,${PCTL},12 $IFILE $OFILE"
TESTCOMMAND="$CDO diff,abslim=0.004 $OFILE $RFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
runTest
rm -f $OFILE
let NTEST+=1
......
#! /bin/sh
. ./cdoTestFunctions.test
#
echo 1..24 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="/home/oliverheidmann/code/maxp/cdoBuild/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="/home/oliverheidmann/code/maxp/cdoBuild/../cdo/test/data/"
#
......@@ -21,16 +22,14 @@ function seltimeTest(){
#
for STAT in "${ARGS[@]}" ; do
if [ -z "$2" ] || [ "$NTEST" == "$2" ]; then
RSTAT=0
RFILE="$DATAPATH/${OPER}${i}_ref"
CDOTEST="$OPER"
OFILE="${OPER}_res"
CDOTEST="$OPER"
CDOCOMMAND="$CDO $OPER,$STAT $EXTRA $IFILE $OFILE"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
runTest
rm -f $OFILE
fi
let i+=1
......
#! @BASH@
#
. ./cdoTestFunctions.test
#
echo 1..8 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
......@@ -26,7 +26,6 @@ for STAT in $OPERTYPES; do
IFILE=$DATAPATH/ts_mm_5years
fi
#
RSTAT=0
RFILE=$DATAPATH/${OPERATOR}${PCTL}_ref
OFILE=${OPERATOR}${PCTL}_res
......@@ -34,7 +33,7 @@ for STAT in $OPERTYPES; do
CDOCOMMAND="$CDO $FORMAT ${OPERATOR},${PCTL} $IFILE $DATAPATH/${STAT}min_ref $DATAPATH/${STAT}max_ref $OFILE"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
runTest
rm -f $OFILE
fi
let NTEST+=1
......
#! @BASH@
#
. ./cdoTestFunctions.test
#
echo 1..2 # Number of tests to be executed.
#
. ./cdoTestFunctions.test
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
......@@ -23,18 +23,17 @@ for NSETS in 12 60; do
elif [ $NSETS -eq 60 ] ; then
RTYPE=tim
fi
RSTAT=0
RFILE=$DATAPATH/${TYPE}${NSETS}pctl${PCTL}_ref
OFILE=${TYPE}${NSETS}pctl${PCTL}_res
CDOTEST="${TYPE}pctl nsets=${NSETS}"
CDOCOMMAND="$CDO $FORMAT ${TYPE}pctl,${PCTL},${NSETS} $IFILE $DATAPATH/${RTYPE}min_ref $DATAPATH/${RTYPE}max_ref $OFILE"
TESTCOMMAND="$CDO diff $OFILE $RFILE"
runTest "$NTEST" "$CDOTEST" "$CDOCOMMAND" "$TESTCOMMAND"
rm -f $OFILE
runTest
rm -f $OFILE
let NTEST+=1
done
#
......
function runTest
{
test -z "$NTEST" && echo "NTEST undefined"
test -z "$CDOTEST" && echo "CDOTEST undefined"
test -z "$CDOCOMMAND" && echo "CDOCOMMAND undefined"
test -z "$TESTCOMMAND" && echo "TESTCOMMAND undefined"
test -z "$NTEST" && { echo "NTEST undefined"; exit 1; }
test -z "$CDOTEST" && { echo "CDOTEST undefined"; exit 1; }
test -z "$CDOCOMMAND" && { echo "CDOCOMMAND undefined"; exit 1; }
test -z "$TESTCOMMAND" && { echo "TESTCOMMAND undefined"; exit 1; }
local RSTAT=0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment