test driver script: fix off-by-one error when calculating the number of timesteps

(the initial solution also counts but was not counted.)
This commit is contained in:
Andreas Lauser 2014-04-27 21:41:03 +02:00
parent 81ae2566d7
commit f3e2454b4e

View File

@ -91,7 +91,7 @@ case "$TEST_TYPE" in
echo "RND: '$RND'"
SIM_NAME=$(grep "Applying the initial solution of the" "test-$RND.log" | sed "s/.*\"\(.*\)\".*/\1/" | head -n1)
NUM_TIMESTEPS=$(grep "Time step [0-9]* done" "test-$RND.log" | wc -l)
NUM_TIMESTEPS=$(( $(grep "Time step [0-9]* done" "test-$RND.log" | wc -l) + 1))
TEST_RESULT=$(printf "%s-%05i" "$SIM_NAME" "$NUM_TIMESTEPS")
TEST_RESULT=$(ls -- "$TEST_RESULT".*)
rm "test-$RND.log"
@ -120,7 +120,7 @@ case "$TEST_TYPE" in
fi
SIM_NAME=$(grep "Applying the initial solution of the" "test-$RND.log" | sed "s/.*\"\(.*\)\".*/\1/" | head -n1)
NUM_TIMESTEPS=$(grep "Time step [0-9]* done" "test-$RND.log" | wc -l)
NUM_TIMESTEPS=$(( $(grep "Time step [0-9]* done" "test-$RND.log" | wc -l) + 1))
rm "test-$RND.log"
echo "Simulation name: '$SIM_NAME'"