Commit b7a9e6fc authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

test/File.test: added function fileformat()

parent 1408612d
......@@ -10,6 +10,30 @@ FORMATS="srv ext ieg grb grb2 nc nc2 nc4"
#
NTEST=1
#
function fileformat()
{
FILEFORMAT=undefined
ENABLE_TEST=yes
if [ "${FORMAT}" = srv ] ; then FILEFORMAT=SERVICE; fi
if [ "${FORMAT}" = ext ] ; then FILEFORMAT=EXTRA; fi
if [ "${FORMAT}" = ieg ] ; then FILEFORMAT=IEG; fi
if [ "${FORMAT}" = grb ] ; then FILEFORMAT=GRIB; fi
if [ "${FORMAT}" = grb2 ] ; then FILEFORMAT=GRIB_API; fi
if [ "${FORMAT}" = nc ] ; then FILEFORMAT=netCDF; fi
if [ "${FORMAT}" = nc2 ] ; then FILEFORMAT=netCDF2; fi
if [ "${FORMAT}" = nc4 ] ; then FILEFORMAT=netCDF4; fi
if [ "@ENABLE_SERVICE@" = no -a "${FORMAT}" = srv ] ; then ENABLE_TEST=no; fi
if [ "@ENABLE_EXTRA@" = no -a "${FORMAT}" = ext ] ; then ENABLE_TEST=no; fi
if [ "@ENABLE_IEG@" = no -a "${FORMAT}" = ieg ] ; then ENABLE_TEST=no; fi
if [ "@ENABLE_GRIB@" = no -a "${FORMAT}" = grb ] ; then ENABLE_TEST=no; fi
if [ "@ENABLE_GRIBAPI@" = no -a "${FORMAT}" = grb2 ] ; then ENABLE_TEST=no; fi
if [ "@ENABLE_NETCDF@" = no -a "${FORMAT}" = nc ] ; then ENABLE_TEST=no; fi
if [ "@ENABLE_NETCDF@" = no -a "${FORMAT}" = nc2 ] ; then ENABLE_TEST=no; fi
if [ "@ENABLE_NC4@" = no -a "${FORMAT}" = nc4 ] ; then ENABLE_TEST=no; fi
}
#
for OPERATOR in write copy; do
for FORMAT in $FORMATS; do
RSTAT=0
......@@ -17,40 +41,10 @@ for OPERATOR in write copy; do
CDOTEST="$OPERATOR $FORMAT"
echo "Running test: $NTEST"
FILEFORMAT=undefined
ENABLE_TEST=yes
if [ "@ENABLE_SERVICE@" = no -a "${FORMAT}" = srv ] ; then
FILEFORMAT=SERVICE
ENABLE_TEST=no
fi
if [ "@ENABLE_EXTRA@" = no -a "${FORMAT}" = ext ] ; then
FILEFORMAT=EXTRA
ENABLE_TEST=no
fi
if [ "@ENABLE_IEG@" = no -a "${FORMAT}" = ieg ] ; then
FILEFORMAT=IEG
ENABLE_TEST=no
fi
if [ "@ENABLE_GRIB@" = no -a "${FORMAT}" = grb ] ; then
FILEFORMAT=GRIB
ENABLE_TEST=no
fi
if [ "@ENABLE_GRIBAPI@" = no -a "${FORMAT}" = grb2 ] ; then
FILEFORMAT=GRIB_API
ENABLE_TEST=no
fi
if [ "@ENABLE_NETCDF@" = no -a "${FORMAT}" = nc ] ; then
FILEFORMAT=netCDF
ENABLE_TEST=no
fi
if [ "@ENABLE_NETCDF@" = no -a "${FORMAT}" = nc2 ] ; then
FILEFORMAT=netCDF2
ENABLE_TEST=no
fi
if [ "@ENABLE_NC4@" = no -a "${FORMAT}" = nc4 ] ; then
FILEFORMAT=netCDF4
ENABLE_TEST=no
fi
fileformat
if [ "${ENABLE_TEST}" = yes ] ; then
for DATATYPE in F32 F64; do
......
......@@ -6,7 +6,7 @@ test -n "$DATAPATH" || DATAPATH=./data
#
CDOOUT=cout$$
CDOERR=cerr$$
FORMAT="-f srv -b 32"
OFORMAT="-f srv -b 32"
#
IFILE=$DATAPATH/pl_data
NTEST=1
......@@ -21,7 +21,7 @@ function testfunc()
RFILE=$DATAPATH/thread${NTEST}_ref
OFILE=thread${NTEST}_res
CDOCOMMAND="$CDO $FORMAT $INSTR $IFILE $OFILE"
CDOCOMMAND="$CDO $OFORMAT $INSTR $IFILE $OFILE"
echo "$CDOCOMMAND"
......
Supports Markdown
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