Time start of test to avoid spurious errors due to second flip.

pull/331/head
Fredrik Öhrström 2021-08-27 11:22:08 +02:00
rodzic 4ab43ff962
commit de91a30853
1 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -12,9 +12,15 @@ METERS="Votten aventieswm 61070071 A004EB23329A477F1DD2D7820B56EB3D"
cat simulations/simulation_unix_timestamp.txt | grep '^{' > $TEST/test_expected.txt
NOW=$(date +%s)
# Wait for the second to switch before starting the run. This will avoid spurious errors
# where the second barrier switches inside the test.
PREV=$(date +%s)
NOW=$PREV
while [ "$NOW" = "$PREV" ] ; do NOW=$(date "+%s") ; done
cat simulations/simulation_unix_timestamp.txt | grep '^|' | sed 's/^|//' | sed "s/UT/${NOW}/" > $TEST/test_expected.txt
$PROG --format=fields --separator='*' --field_extra=extra_info --selectfields=total_m3,timestamp_ut,timestamp_utc,timestamp_lt,name,id,extra simulations/simulation_t1.txt $METERS > $TEST/test_output.txt 2> $TEST/test_stderr.txt
if [ "$?" = "0" ]
then
cat $TEST/test_output.txt | \
@ -27,7 +33,7 @@ then
echo OK fields: $TESTNAME
TESTRESULT="OK"
else
meld $TEST/test_expected.txt $TEST/test_responses.txt
diff $TEST/test_expected.txt $TEST/test_responses.txt
TESTRESULT="ERROR"
fi
else