diff --git a/src/Makefile.am b/src/Makefile.am index 3d1240d..5f497d9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,7 +14,7 @@ INCLUDES = $(DEPS_CFLAGS) bin_PROGRAMS = minimodem -EXTRA_DIST = run-test +EXTRA_DIST = run-test self-test SIMPLEAUDIO_SRC = \ diff --git a/src/Makefile.in b/src/Makefile.in index 165b7b1..932293c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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 \ diff --git a/src/self-test b/src/self-test new file mode 100755 index 0000000..ed4d647 --- /dev/null +++ b/src/self-test @@ -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" - +