Commit 17f9263a authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

added tests for manual user input

parent a22f9683
...@@ -328,6 +328,7 @@ AC_CONFIG_FILES([ ...@@ -328,6 +328,7 @@ AC_CONFIG_FILES([
test/Timselpctl.test test/Timselpctl.test
test/Timstat.test test/Timstat.test
test/Timstat2.test test/Timstat2.test
test/UserInput.test
test/Varsstat.test test/Varsstat.test
test/Vertint.test test/Vertint.test
test/Vertstat.test test/Vertstat.test
......
...@@ -61,6 +61,7 @@ TESTS =\ ...@@ -61,6 +61,7 @@ TESTS =\
Timselstat.test \ Timselstat.test \
Timstat.test \ Timstat.test \
Timstat2.test \ Timstat2.test \
UserInput.test \
Varsstat.test \ Varsstat.test \
Vertint.test \ Vertint.test \
Vertstat.test \ Vertstat.test \
......
#! @BASH@
. ./cdoTestFunctions.test
echo 1..3 # Number of tests to be executed.
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
rm -f ut_f*
#
FORMAT="-f srv -b 32"
declare -a INPUT
#
NTEST=1
RSTAT=0
#
INPUT=("1337,global_1" "1337 global_1" "1337 \\global_1")
RES="userInputRes.srv"
OUTPUT_FILE="userInputOutput.srv"
USER_INPUT="userInput_testFile"
#
$CDO $FORMAT const,1337,global_1 $RES
for i in {0..2};
do
if [ -z "$1" ] || [ $NTEST == $1 ]; then
echo ${INPUT[$i]} >> $USER_INPUT
$CDO $FORMAT const $OUTPUT_FILE < $USER_INPUT
test $? -eq 0 || let RSTAT+=1
$CDO $FORMAT diff $RES $OUTPUT_FILE
test $? -eq 0 || let RSTAT+=1
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
rm -f $USER_INPUT
fi
let NTEST+=1
done
rm -f $OUTPUT_FILE
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