diff --git a/Makefile.am b/Makefile.am index af437a6..a459377 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1 @@ -SUBDIRS = src +SUBDIRS = src tests diff --git a/Makefile.in b/Makefile.in index dbc83b3..0260e3f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -191,7 +191,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = src +SUBDIRS = src tests all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/configure b/configure index e8fd662..4c050eb 100755 --- a/configure +++ b/configure @@ -3603,7 +3603,7 @@ fi # Checks for library functions. # AC_FUNC_FORK -ac_config_files="$ac_config_files Makefile src/Makefile src/minimodem.1" +ac_config_files="$ac_config_files Makefile src/Makefile src/minimodem.1 tests/Makefile" # testdata/Makefile cat >confcache <<\_ACEOF @@ -4340,6 +4340,7 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/minimodem.1") CONFIG_FILES="$CONFIG_FILES src/minimodem.1" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.ac b/configure.ac index b8b83bc..d73f9a6 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,7 @@ AC_CONFIG_FILES([ Makefile src/Makefile src/minimodem.1 + tests/Makefile ]) # testdata/Makefile AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 07c3eef..0e241d6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,9 +26,7 @@ bin_PROGRAMS = minimodem dist_man_MANS = minimodem.1 -EXTRA_DIST = minimodem.1.html self-test self-test-perfect testcases/* # run-test - -TESTS = testcases/test-* +EXTRA_DIST = minimodem.1.html SIMPLEAUDIO_SRC = \ simpleaudio.h \ diff --git a/src/Makefile.in b/src/Makefile.in index 6e0752d..50f3edd 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -117,8 +117,6 @@ NROFF = nroff MANS = $(dist_man_MANS) ETAGS = etags CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -211,8 +209,7 @@ top_srcdir = @top_srcdir@ AM_CFLAGS = -Wall # -Werror INCLUDES = $(DEPS_CFLAGS) dist_man_MANS = minimodem.1 -EXTRA_DIST = minimodem.1.html self-test self-test-perfect testcases/* # run-test -TESTS = testcases/test-* +EXTRA_DIST = minimodem.1.html SIMPLEAUDIO_SRC = \ simpleaudio.h \ simpleaudio_internal.h \ @@ -422,99 +419,6 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - $(am__tty_colors); \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - col=$$red; res=XPASS; \ - ;; \ - *) \ - col=$$grn; res=PASS; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xfail=`expr $$xfail + 1`; \ - col=$$lgn; res=XFAIL; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - col=$$red; res=FAIL; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - col=$$blu; res=SKIP; \ - fi; \ - echo "$${col}$$res$${std}: $$tst"; \ - done; \ - if test "$$all" -eq 1; then \ - tests="test"; \ - All=""; \ - else \ - tests="tests"; \ - All="All "; \ - fi; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="$$All$$all $$tests passed"; \ - else \ - if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ - banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all $$tests failed"; \ - else \ - if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ - banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ - fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - if test "$$skip" -eq 1; then \ - skipped="($$skip test was not run)"; \ - else \ - skipped="($$skip tests were not run)"; \ - fi; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - if test "$$failed" -eq 0; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - fi; \ - echo "$${col}$$dashes$${std}"; \ - echo "$${col}$$banner$${std}"; \ - test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ - test -z "$$report" || echo "$${col}$$report$${std}"; \ - echo "$${col}$$dashes$${std}"; \ - test "$$failed" -eq 0; \ - else :; fi - distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ @@ -559,7 +463,6 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: @@ -667,20 +570,20 @@ uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 -.MAKE: check-am install-am install-strip +.MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-binPROGRAMS clean-generic ctags distclean \ - distclean-compile distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-man1 install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ - ps ps-am tags uninstall uninstall-am uninstall-binPROGRAMS \ +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 diff --git a/src/testcases/self-test-ascii.txt b/src/testcases/self-test-ascii.txt deleted file mode 100644 index 1943a92..0000000 --- a/src/testcases/self-test-ascii.txt +++ /dev/null @@ -1,112 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH MINIMODEM 1 "June 22, 2011" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -minimodem \- software audio Bell-type or RTTY FSK modem -.SH SYNOPSIS -.B minimodem --tx -.RI [ options ] -.I {baudmode} -.br -.B minimodem --rx -.RI [ options ] -.I {baudmode} -.SH DESCRIPTION -.B minimodem -is a command-line program which generates (or decodes) audio modem tones, -emulating an old Bell-type or radio-teletype FSK modem. -The tones can be played to (or recorded from) the PulseAudio system -or to an audio file. -.PP -.B minimodem -can be used to transfer data between nearby computers using an audio -cable (or just via sound waves), or between remote computers using radio, -telephone, or another audio communications medium. -.SH "TX/RX MODE" -.TP -.B \-t, \-\-tx, \-\-transmit, \-\-write -transmit mode: generate audio tones -.TP -.B \-r, \-\-rx, \-\-receive, \-\-read -receive mode: decode audio tones -.SH OPTIONS -.TP -.B \-8, \-\-ascii -ASCII 8\-N\-1 -.TP -.B \-5, \-\-baudot -Baudot 5\-N\-1.5 -.TP -.B \-f, \-\-file filename.wav -encode or decode an audio file (extension sets audio format) -.TP -.B \-b, \-\-bandwidth {rx_bandwidth} -.TP -.B \-M, \-\-mark {mark_freq} -.TP -.B \-S, \-\-space {space_freq} -.TP -.B \-T, \-\-txstopbits {m.n} -.TP -.B \-V, \-\-version -print program version -.SH {baudmode} -The required \fI{baudmode}\fR parameter may be any floating-point value to -specify a baud rate, or the string "rtty". -The \fI{baudmode}\fR also implies certain other parameter defaults -depending on the rate. -.TP -.B 1200 - : Bell202 1200 bps \-\-ascii -.TP -.B 300 - : Bell103 300 bps \-\-ascii (auto-rx-carrier) -.TP -.B N>=100 - : Bellxxx N bps \-\-ascii -.TP -.B N<100 - : RTTY N bps \-\-baudot -.TP -.B rtty - : RTTY 45.45 bps \-\-baudot -.SH EXAMPLES -.TP -.B minimodem --tx 100 -Transmit 100 baud tones from one computer ... -.TP -.B minimodem --rx 100 -and receive 100 baud tones on another nearby computer. -.TP -.B minimodem --rx rtty -Decode amateur radio RTTY signals (listen near 14.085 MHz). -.SH NOTES -.B minimodem -does not decode AX.25 framed packets. -.PP -.B minimodem -does not support modem control ("AT") commands, nor does it produce -DTMF telephone dialing tones. -.SH AUTHOR -.B minimodem -was written by Kamal Mostafa . -.SH COPYRIGHT -Copyright \(co 2011 by Kamal Mostafa . -License GPLv3+: GNU GPL version 3 or later . -.br -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. diff --git a/src/testcases/test-01-self-test-1200 b/src/testcases/test-01-self-test-1200 deleted file mode 100755 index c0a0f04..0000000 --- a/src/testcases/test-01-self-test-1200 +++ /dev/null @@ -1,2 +0,0 @@ -# use fsk.c as the sample text file -exec ./self-test fsk.c 1200 diff --git a/src/testcases/test-02-self-test-300 b/src/testcases/test-02-self-test-300 deleted file mode 100755 index d1f5c6d..0000000 --- a/src/testcases/test-02-self-test-300 +++ /dev/null @@ -1 +0,0 @@ -exec ./self-test testcases/self-test-ascii.txt 300 diff --git a/src/testcases/test-03-self-test-rtty b/src/testcases/test-03-self-test-rtty deleted file mode 100755 index 60b45f5..0000000 --- a/src/testcases/test-03-self-test-rtty +++ /dev/null @@ -1,2 +0,0 @@ -# use self-test-baudot.txt as the sample text file -exec ./self-test testcases/self-test-baudot.txt rtty diff --git a/src/testcases/test-05-self-test-12000 b/src/testcases/test-05-self-test-12000 deleted file mode 100755 index 21c6994..0000000 --- a/src/testcases/test-05-self-test-12000 +++ /dev/null @@ -1 +0,0 @@ -exec ./self-test testcases/self-test-ascii.txt 12000 diff --git a/src/testcases/test-06-self-test-float-samples b/src/testcases/test-06-self-test-float-samples deleted file mode 100755 index cf50e44..0000000 --- a/src/testcases/test-06-self-test-float-samples +++ /dev/null @@ -1 +0,0 @@ -exec ./self-test testcases/self-test-ascii.txt --float-samples 12000 diff --git a/src/testcases/test-07-self-test-no-lut b/src/testcases/test-07-self-test-no-lut deleted file mode 100755 index fb4def6..0000000 --- a/src/testcases/test-07-self-test-no-lut +++ /dev/null @@ -1 +0,0 @@ -exec ./self-test fsk.c 1200 --lut=0 diff --git a/src/testcases/test-08-self-test-lut16 b/src/testcases/test-08-self-test-lut16 deleted file mode 100755 index a63315c..0000000 --- a/src/testcases/test-08-self-test-lut16 +++ /dev/null @@ -1 +0,0 @@ -exec ./self-test fsk.c 1200 --lut=16 diff --git a/src/testcases/test-09-self-test-lut16-float b/src/testcases/test-09-self-test-lut16-float deleted file mode 100755 index 08f9108..0000000 --- a/src/testcases/test-09-self-test-lut16-float +++ /dev/null @@ -1 +0,0 @@ -exec ./self-test fsk.c 1200 --lut=16 --float-samples diff --git a/src/testcases/test-11-verify-perfect-nolut b/src/testcases/test-11-verify-perfect-nolut deleted file mode 100755 index bd8f031..0000000 --- a/src/testcases/test-11-verify-perfect-nolut +++ /dev/null @@ -1,2 +0,0 @@ -exec ./self-test-perfect testcases/self-test-ascii.txt \ - 1200 --samplerate 24000 -M 1200 -S 2400 --lut=0 diff --git a/src/testcases/test-12-verify-perfect-lut16 b/src/testcases/test-12-verify-perfect-lut16 deleted file mode 100755 index ed465ad..0000000 --- a/src/testcases/test-12-verify-perfect-lut16 +++ /dev/null @@ -1,2 +0,0 @@ -exec ./self-test-perfect testcases/self-test-ascii.txt \ - 1200 --samplerate 24000 -M 1200 -S 2400 --lut=16 diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..baabe68 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,28 @@ +# +# Makefile.am +# +# Copyright (C) 2011-2012 Kamal Mostafa +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +EXTRA_DIST = \ + run-self-tests \ + self-test \ + self-test-perfect \ + test-* \ + testdata-* + +TESTS = test-* + diff --git a/tests/Makefile.in b/tests/Makefile.in new file mode 100644 index 0000000..ab4541a --- /dev/null +++ b/tests/Makefile.in @@ -0,0 +1,444 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile.am +# +# Copyright (C) 2011-2012 Kamal Mostafa +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__tty_colors = \ +red=; grn=; lgn=; blu=; std= +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPS_CFLAGS = @DEPS_CFLAGS@ +DEPS_LIBS = @DEPS_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + run-self-tests \ + self-test \ + self-test-perfect \ + test-* \ + testdata-* + +TESTS = test-* +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + $(am__tty_colors); \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + col=$$red; res=XPASS; \ + ;; \ + *) \ + col=$$grn; res=PASS; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xfail=`expr $$xfail + 1`; \ + col=$$lgn; res=XFAIL; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + col=$$red; res=FAIL; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + col=$$blu; res=SKIP; \ + fi; \ + echo "$${col}$$res$${std}: $$tst"; \ + done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="$$All$$all $$tests passed"; \ + else \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all $$tests failed"; \ + else \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + if test "$$failed" -eq 0; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + fi; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-TESTS check-am clean clean-generic \ + distclean distclean-generic distdir dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ + uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/run-self-tests b/tests/run-self-tests new file mode 100755 index 0000000..36205fb --- /dev/null +++ b/tests/run-self-tests @@ -0,0 +1,11 @@ +#!/bin/bash + +for testcase in ./test-* +do + $testcase + if [ $? -eq 0 ] + then echo "PASS: $testcase" + else echo "FAIL: $testcase" + fi +done + diff --git a/src/self-test b/tests/self-test similarity index 73% rename from src/self-test rename to tests/self-test index 287b4e9..a4dde4c 100755 --- a/src/self-test +++ b/tests/self-test @@ -1,6 +1,13 @@ #!/bin/bash MINIMODEM="${MINIMODEM-./minimodem}" +[ -f "$MINIMODEM" ] || { + MINIMODEM="../src/minimodem" + [ -f "$MINIMODEM" ] || { + echo "E: cannot find minimodem in ./ or ../src/" 1>&2 + exit 1 + } +} [ $# -ge 2 ] || { echo "usage: self-test textfile minimodem_args" 1>&2 diff --git a/src/self-test-perfect b/tests/self-test-perfect similarity index 100% rename from src/self-test-perfect rename to tests/self-test-perfect diff --git a/tests/test-01-self-test-1200 b/tests/test-01-self-test-1200 new file mode 100755 index 0000000..11cbe1f --- /dev/null +++ b/tests/test-01-self-test-1200 @@ -0,0 +1 @@ +exec ./self-test testdata-ascii.txt 1200 diff --git a/tests/test-02-self-test-300 b/tests/test-02-self-test-300 new file mode 100755 index 0000000..44d7acc --- /dev/null +++ b/tests/test-02-self-test-300 @@ -0,0 +1 @@ +exec ./self-test testdata-ascii.txt 300 diff --git a/tests/test-03-self-test-rtty b/tests/test-03-self-test-rtty new file mode 100755 index 0000000..d4a0d02 --- /dev/null +++ b/tests/test-03-self-test-rtty @@ -0,0 +1,2 @@ +# use testdata-ascii-baudot.txt as the sample text file +exec ./self-test testdata-baudot.txt rtty diff --git a/src/testcases/test-04-self-test-0.5 b/tests/test-04-self-test-0.5 similarity index 100% rename from src/testcases/test-04-self-test-0.5 rename to tests/test-04-self-test-0.5 diff --git a/tests/test-05-self-test-12000 b/tests/test-05-self-test-12000 new file mode 100755 index 0000000..f66ee45 --- /dev/null +++ b/tests/test-05-self-test-12000 @@ -0,0 +1 @@ +exec ./self-test testdata-ascii.txt 12000 diff --git a/tests/test-06-self-test-float-samples b/tests/test-06-self-test-float-samples new file mode 100755 index 0000000..716c908 --- /dev/null +++ b/tests/test-06-self-test-float-samples @@ -0,0 +1 @@ +exec ./self-test testdata-ascii.txt --float-samples 12000 diff --git a/tests/test-07-self-test-no-lut b/tests/test-07-self-test-no-lut new file mode 100755 index 0000000..d349dd9 --- /dev/null +++ b/tests/test-07-self-test-no-lut @@ -0,0 +1 @@ +exec ./self-test testdata-ascii.txt 1200 --lut=0 diff --git a/tests/test-08-self-test-lut16 b/tests/test-08-self-test-lut16 new file mode 100755 index 0000000..457e235 --- /dev/null +++ b/tests/test-08-self-test-lut16 @@ -0,0 +1 @@ +exec ./self-test testdata-ascii.txt 1200 --lut=16 diff --git a/tests/test-09-self-test-lut16-float b/tests/test-09-self-test-lut16-float new file mode 100755 index 0000000..0e1c5ab --- /dev/null +++ b/tests/test-09-self-test-lut16-float @@ -0,0 +1 @@ +exec ./self-test testdata-ascii.txt 1200 --lut=16 --float-samples diff --git a/src/testcases/test-10-verify-perfect b/tests/test-10-verify-perfect similarity index 66% rename from src/testcases/test-10-verify-perfect rename to tests/test-10-verify-perfect index 40e961d..6af5926 100755 --- a/src/testcases/test-10-verify-perfect +++ b/tests/test-10-verify-perfect @@ -1,4 +1,4 @@ # test for confidence=1.00 when using exact integer multiple frequencies -exec ./self-test-perfect testcases/self-test-ascii.txt \ +exec ./self-test-perfect testdata-ascii.txt \ 1200 --samplerate 24000 -M 1200 -S 2400 diff --git a/tests/test-11-verify-perfect-nolut b/tests/test-11-verify-perfect-nolut new file mode 100755 index 0000000..904adcc --- /dev/null +++ b/tests/test-11-verify-perfect-nolut @@ -0,0 +1,2 @@ +exec ./self-test-perfect testdata-ascii.txt \ + 1200 --samplerate 24000 -M 1200 -S 2400 --lut=0 diff --git a/tests/test-12-verify-perfect-lut16 b/tests/test-12-verify-perfect-lut16 new file mode 100755 index 0000000..7f56791 --- /dev/null +++ b/tests/test-12-verify-perfect-lut16 @@ -0,0 +1,2 @@ +exec ./self-test-perfect testdata-ascii.txt \ + 1200 --samplerate 24000 -M 1200 -S 2400 --lut=16 diff --git a/src/testcases/test-13-verify-perfect-nolut-float b/tests/test-13-verify-perfect-nolut-float similarity index 53% rename from src/testcases/test-13-verify-perfect-nolut-float rename to tests/test-13-verify-perfect-nolut-float index cbb7229..5a6ee1e 100755 --- a/src/testcases/test-13-verify-perfect-nolut-float +++ b/tests/test-13-verify-perfect-nolut-float @@ -1,2 +1,2 @@ -exec ./self-test-perfect testcases/self-test-ascii.txt \ +exec ./self-test-perfect testdata-ascii.txt \ 1200 --samplerate 24000 -M 1200 -S 2400 --lut=0 --float-samples diff --git a/src/testcases/test-14-verify-perfect-lut16-float b/tests/test-14-verify-perfect-lut16-float similarity index 53% rename from src/testcases/test-14-verify-perfect-lut16-float rename to tests/test-14-verify-perfect-lut16-float index 626295e..a825cad 100755 --- a/src/testcases/test-14-verify-perfect-lut16-float +++ b/tests/test-14-verify-perfect-lut16-float @@ -1,2 +1,2 @@ -exec ./self-test-perfect testcases/self-test-ascii.txt \ +exec ./self-test-perfect testdata-ascii.txt \ 1200 --samplerate 24000 -M 1200 -S 2400 --lut=16 --float-samples diff --git a/src/testcases/test-15-verify-perfect-float b/tests/test-15-verify-perfect-float similarity index 50% rename from src/testcases/test-15-verify-perfect-float rename to tests/test-15-verify-perfect-float index b2e38bf..ba06e74 100755 --- a/src/testcases/test-15-verify-perfect-float +++ b/tests/test-15-verify-perfect-float @@ -1,2 +1,2 @@ -exec ./self-test-perfect testcases/self-test-ascii.txt \ +exec ./self-test-perfect testdata-ascii.txt \ 1200 --samplerate 24000 -M 1200 -S 2400 --float-samples diff --git a/tests/testdata-ascii.txt b/tests/testdata-ascii.txt new file mode 100644 index 0000000..153f96b --- /dev/null +++ b/tests/testdata-ascii.txt @@ -0,0 +1,48 @@ +This is a minimodem ascii data test file. + +http://www.whence.com/minimodem/ + +THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG +the quick brown fox jumps over the lazy dog +1234567890 !@#$%^&*()-=_+`~[]\;',./{}|:"<>? tab> + + Aluminum tube + Three hundred twenty sardines + Earning our SkyMiles + +---------------------------------------------------------------------------- + +minimodem - software audio Bell-type or RTTY FSK modem +Copyright (C) 2011-2012 Kamal Mostafa + +Minimodem is a command-line program which generates (or decodes) audio +modem tones at any specified baud rate, emulating an old Bell-type or +radio-teletype FSK modem. The tones can be played to (or recorded from) +the system audio (PulseAudio or ALSA) or to an audio file. + +Minimodem can be used to transfer data between nearby computers using an +audio cable (or just via sound waves), or between remote computers using +radio, telephone, or another audio communications medium. + +---------------------------------------------------------------------------- + +minimodem - software audio Bell-type or RTTY FSK modem +Copyright (C) 2011-2012 Kamal Mostafa + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + diff --git a/src/testcases/self-test-baudot.txt b/tests/testdata-baudot.txt similarity index 100% rename from src/testcases/self-test-baudot.txt rename to tests/testdata-baudot.txt