minimodem-mirror/src/run-test

52 lines
877 B
Plaintext
Raw Normal View History

2011-06-04 18:57:42 +02:00
#!/bin/bash
2011-06-08 23:00:22 +02:00
#
# run-test
#
2012-08-14 06:51:53 +02:00
# Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
2011-06-08 23:00:22 +02:00
#
# NO LICENSE HAS BEEN SPECIFIED OR GRANTED FOR THIS WORK.
#
#
2011-07-08 17:53:06 +02:00
MINIMODEM="${MINIMODEM-./minimodem}"
2011-06-04 18:57:42 +02:00
TMPDIR=/tmp/run-test-$$
mkdir "$TMPDIR" || exit
trap "rm -rf $TMPDIR" 0
let nfail=0
2011-06-11 06:17:53 +02:00
for i in ../testdata/*/*.flac
2011-06-04 18:57:42 +02:00
do
2011-06-11 03:03:52 +02:00
dir="${i%/*}"
2011-06-04 18:57:42 +02:00
f="${i##*/}"
rate="${f#*-}"
rate="${rate%%-*}"
2011-06-11 03:03:52 +02:00
txtnum="${i##*/}"
txtnum="${txtnum%%-*}"
unset flags
[ $rate = rtty ] || [ $rate -le 300 ] && flags="--auto-carrier"
echo TEST $MINIMODEM $flags -f "$i" "$rate"
$MINIMODEM $flags -f "$i" "$rate" >$TMPDIR/out 2>$TMPDIR/err
2011-06-04 18:57:42 +02:00
t="${f%%-*}"
2011-06-07 06:28:14 +02:00
egrep 'CARRIER|TONE' $TMPDIR/err
2011-06-11 03:03:52 +02:00
cmp $dir/${txtnum}-*.txt $TMPDIR/out
2011-06-04 18:57:42 +02:00
if [ $? -eq 0 ]
then
echo "@@@ PASS $f"
else
echo " @@@ FAIL $f"
let nfail=nfail+1
fi
echo
done
exit $nfail