Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
cdo
Commits
d847f747
Commit
d847f747
authored
10 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
added test/Arith.test
parent
5a55c5ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
test/Arith.test.in
+80
-0
80 additions, 0 deletions
test/Arith.test.in
with
81 additions
and
0 deletions
.gitattributes
+
1
−
0
View file @
d847f747
...
...
@@ -643,6 +643,7 @@ src/vinterp.h -text
src/yacc_lex -text
src/zaxis.c -text
test/.checklib_pyunittest -text
test/Arith.test.in -text
test/Cat.test.in -text
test/Copy_netcdf.test.in -text
test/Detrend.test.in -text
...
...
This diff is collapsed.
Click to expand it.
test/Arith.test.in
0 → 100644
+
80
−
0
View file @
d847f747
#! @SHELL@
echo 1..4 # Number of tests to be executed.
#
test -n "$CDO" || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
#
CDOOUT=cout
CDOERR=cerr
FORMAT="-f srv -b 32"
STATS="add sub mul div"
#
IFILE=$DATAPATH/pl_data
NTEST=1
#
for STAT in $STATS; do
RSTAT=0
OFILE=stat${STAT}_res
for VAR in -1000 -77 -1 0 1 77 1000; do
VAL=1
CFILE=constval
$CDO -f srv -b 64 const,$VAL,$IFILE $CFILE
# stat var const
CDOTEST="$STAT"
CDOCOMMAND="$CDO $FORMAT ${STAT} $IFILE $CFILE $OFILE"
echo "Running test: $NTEST"
echo "$CDOCOMMAND"
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
# stat,const var
OFILE2=stat${STAT}c_res
CDOCOMMAND="$CDO $FORMAT ${STAT}c,$VAL $IFILE $OFILE2"
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
$CDO diff $OFILE $OFILE2 > $CDOOUT 2> $CDOERR
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
# stat,const 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
OFILE3=expr${STAT}_res
INSTR="var130=var130${OP}${VAL};var152=var152${OP}${VAL};var129=var129${OP}${VAL};"
echo $INSTR
CDOCOMMAND="$CDO $FORMAT expr,$INSTR $IFILE $OFILE3"
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
$CDO diff $OFILE $OFILE3 > $CDOOUT 2> $CDOERR
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
rm -f $OFILE $OFILE2 $CFILE
done
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
let NTEST+=1
done
#
rm -f $CDOOUT $CDOERR
#
exit 0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment