Add missing files.

pull/186/head
Fredrik Öhrström 2020-11-12 01:01:22 +01:00
rodzic 5c2c914070
commit e83dc5b248
2 zmienionych plików z 68 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,40 @@
#!/bin/sh
PROG="$1"
if [ "$PROG" = "" ]
then
echo Please supply the binary to be tested as the first argument.
exit 1
fi
TEST=testoutput
LOGFILE=$TEST/logfile
TESTNAME="Test detection of drivers for all telegrams"
TESTRESULT="ERROR"
mkdir -p $TEST
rm -f $LOGFILE
$PROG simulations/simulation_driver_detection.txt 2> $LOGFILE
if [ "$?" != "0" ]
then
echo "ERROR: $TESTNAME"
exit 1
fi
RES=$(grep unknown $LOGFILE)
if [ ! -z "$RES" ]
then
echo "ERROR: $TESTNAME"
echo "Found unknown driver!"
echo -----------------
cat $LOGFILE
echo -----------------
exit 1
else
echo OK: $TESTNAME
fi

28
tests/test_pipe.sh 100755
Wyświetl plik

@ -0,0 +1,28 @@
#!/bin/bash
PROG="$1"
if [ "$PROG" = "" ]
then
echo Please supply the binary to be tested as the first argument.
exit 1
fi
OUTPUT=$( \
for ((i=1;i<=1000;i++)); \
do \
echo "T1;1;1;2019-04-03 19:00:42.000;97;148;88888888;0x2e44333003020100071b7a634820252f2f0265840842658308820165950802fb1aae0142fb1aae018201fb1aa9012f" \
| $PROG --silent stdin:rtlwmbus rum lansenth 00010203 NOKEY \
| grep -q 21.8 ; [ "$?" = "0" ] || echo ERR ; \
done)
if [ -n "$OUTPUT" ]
then
echo ERROR: reading all stdin before closing down
echo $OUTPUT
exit 1
else
echo OK: reading all stdin before closing down
fi
exit 0