kopia lustrzana https://github.com/weetmuts/wmbusmeters
Time start of test to avoid spurious errors due to second flip.
rodzic
4ab43ff962
commit
de91a30853
|
@ -12,9 +12,15 @@ METERS="Votten aventieswm 61070071 A004EB23329A477F1DD2D7820B56EB3D"
|
||||||
|
|
||||||
cat simulations/simulation_unix_timestamp.txt | grep '^{' > $TEST/test_expected.txt
|
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
|
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
|
$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" ]
|
if [ "$?" = "0" ]
|
||||||
then
|
then
|
||||||
cat $TEST/test_output.txt | \
|
cat $TEST/test_output.txt | \
|
||||||
|
@ -27,7 +33,7 @@ then
|
||||||
echo OK fields: $TESTNAME
|
echo OK fields: $TESTNAME
|
||||||
TESTRESULT="OK"
|
TESTRESULT="OK"
|
||||||
else
|
else
|
||||||
meld $TEST/test_expected.txt $TEST/test_responses.txt
|
diff $TEST/test_expected.txt $TEST/test_responses.txt
|
||||||
TESTRESULT="ERROR"
|
TESTRESULT="ERROR"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
Ładowanie…
Reference in New Issue