self-test script

This commit is contained in:
Kamal Mostafa 2011-06-19 09:41:19 -07:00
parent 5c281ad28f
commit 38fa4c71a4
3 changed files with 19 additions and 2 deletions

View File

@ -14,7 +14,7 @@ INCLUDES = $(DEPS_CFLAGS)
bin_PROGRAMS = minimodem
EXTRA_DIST = run-test
EXTRA_DIST = run-test self-test
SIMPLEAUDIO_SRC = \

View File

@ -166,7 +166,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = -Wall -Werror
INCLUDES = $(DEPS_CFLAGS)
EXTRA_DIST = run-test
EXTRA_DIST = run-test self-test
SIMPLEAUDIO_SRC = \
simpleaudio.h \
simpleaudio_internal.h \

17
src/self-test Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
[ $# -eq 2 ] || {
echo "usage: self-test baudmode textfile" 1>&2
exit 1
}
baudmode="$1"
textfile="$2"
TMPF="/tmp/minimodem-test-$$.flac"
trap "rm -f $TMPF" 0
set -e
./minimodem -T "$baudmode" $TMPF < "$textfile"
ls -l $TMPF
./minimodem "$baudmode" $TMPF | diff "$textfile" -