make check: runs testcases/
This commit is contained in:
parent
12565ff39a
commit
8ba07cb81a
@ -14,8 +14,9 @@ INCLUDES = $(DEPS_CFLAGS)
|
|||||||
|
|
||||||
bin_PROGRAMS = minimodem
|
bin_PROGRAMS = minimodem
|
||||||
|
|
||||||
EXTRA_DIST = self-test self-test-baudot.txt # run-test
|
EXTRA_DIST = self-test testcases/* # run-test
|
||||||
|
|
||||||
|
TESTS = testcases/test.*
|
||||||
|
|
||||||
SIMPLEAUDIO_SRC = \
|
SIMPLEAUDIO_SRC = \
|
||||||
simpleaudio.h \
|
simpleaudio.h \
|
||||||
@ -32,16 +33,3 @@ BAUDOT_SRC = baudot.h baudot.c
|
|||||||
minimodem_LDADD = $(DEPS_LIBS)
|
minimodem_LDADD = $(DEPS_LIBS)
|
||||||
minimodem_SOURCES = minimodem.c $(BAUDOT_SRC) $(FSK_SRC) $(SIMPLEAUDIO_SRC)
|
minimodem_SOURCES = minimodem.c $(BAUDOT_SRC) $(FSK_SRC) $(SIMPLEAUDIO_SRC)
|
||||||
|
|
||||||
|
|
||||||
test:
|
|
||||||
for file in simpleaudio.[ch] ; \
|
|
||||||
do { for rate in 1200 300 50; \
|
|
||||||
do ./self-test $$rate $$file || exit; \
|
|
||||||
done }; \
|
|
||||||
done
|
|
||||||
./self-test rtty self-test-baudot.txt
|
|
||||||
[ ! -f ./run-test ] || ./run-test
|
|
||||||
@echo
|
|
||||||
@echo "minimodem: ALL TESTS PASS"
|
|
||||||
@echo
|
|
||||||
|
|
||||||
|
136
src/Makefile.in
136
src/Makefile.in
@ -75,6 +75,8 @@ SOURCES = $(minimodem_SOURCES)
|
|||||||
DIST_SOURCES = $(minimodem_SOURCES)
|
DIST_SOURCES = $(minimodem_SOURCES)
|
||||||
ETAGS = etags
|
ETAGS = etags
|
||||||
CTAGS = ctags
|
CTAGS = ctags
|
||||||
|
am__tty_colors = \
|
||||||
|
red=; grn=; lgn=; blu=; std=
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
ACLOCAL = @ACLOCAL@
|
ACLOCAL = @ACLOCAL@
|
||||||
AMTAR = @AMTAR@
|
AMTAR = @AMTAR@
|
||||||
@ -166,7 +168,8 @@ top_builddir = @top_builddir@
|
|||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
AM_CFLAGS = -Wall -Werror
|
AM_CFLAGS = -Wall -Werror
|
||||||
INCLUDES = $(DEPS_CFLAGS)
|
INCLUDES = $(DEPS_CFLAGS)
|
||||||
EXTRA_DIST = self-test self-test-baudot.txt # run-test
|
EXTRA_DIST = self-test testcases/* # run-test
|
||||||
|
TESTS = testcases/test.*
|
||||||
SIMPLEAUDIO_SRC = \
|
SIMPLEAUDIO_SRC = \
|
||||||
simpleaudio.h \
|
simpleaudio.h \
|
||||||
simpleaudio_internal.h \
|
simpleaudio_internal.h \
|
||||||
@ -334,6 +337,98 @@ GTAGS:
|
|||||||
distclean-tags:
|
distclean-tags:
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH 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 \
|
||||||
|
echo "$$grn$$dashes"; \
|
||||||
|
else \
|
||||||
|
echo "$$red$$dashes"; \
|
||||||
|
fi; \
|
||||||
|
echo "$$banner"; \
|
||||||
|
test -z "$$skipped" || echo "$$skipped"; \
|
||||||
|
test -z "$$report" || echo "$$report"; \
|
||||||
|
echo "$$dashes$$std"; \
|
||||||
|
test "$$failed" -eq 0; \
|
||||||
|
else :; fi
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
distdir: $(DISTFILES)
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
@ -365,6 +460,7 @@ distdir: $(DISTFILES)
|
|||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
check-am: all-am
|
check-am: all-am
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
|
||||||
check: check-am
|
check: check-am
|
||||||
all-am: Makefile $(PROGRAMS)
|
all-am: Makefile $(PROGRAMS)
|
||||||
installdirs:
|
installdirs:
|
||||||
@ -465,34 +561,22 @@ ps-am:
|
|||||||
|
|
||||||
uninstall-am: uninstall-binPROGRAMS
|
uninstall-am: uninstall-binPROGRAMS
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
.MAKE: check-am install-am install-strip
|
||||||
|
|
||||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
|
||||||
clean-generic ctags distclean distclean-compile \
|
clean-binPROGRAMS clean-generic ctags distclean \
|
||||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
distclean-compile distclean-generic distclean-tags distdir dvi \
|
||||||
html-am info info-am install install-am install-binPROGRAMS \
|
dvi-am html html-am info info-am install install-am \
|
||||||
install-data install-data-am install-dvi install-dvi-am \
|
install-binPROGRAMS install-data install-data-am install-dvi \
|
||||||
install-exec install-exec-am install-html install-html-am \
|
install-dvi-am install-exec install-exec-am install-html \
|
||||||
install-info install-info-am install-man install-pdf \
|
install-html-am install-info install-info-am install-man \
|
||||||
install-pdf-am install-ps install-ps-am install-strip \
|
install-pdf install-pdf-am install-ps install-ps-am \
|
||||||
installcheck installcheck-am installdirs maintainer-clean \
|
install-strip installcheck installcheck-am installdirs \
|
||||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
|
||||||
uninstall-am uninstall-binPROGRAMS
|
tags uninstall uninstall-am uninstall-binPROGRAMS
|
||||||
|
|
||||||
|
|
||||||
test:
|
|
||||||
for file in simpleaudio.[ch] ; \
|
|
||||||
do { for rate in 1200 300 50; \
|
|
||||||
do ./self-test $$rate $$file || exit; \
|
|
||||||
done }; \
|
|
||||||
done
|
|
||||||
./self-test rtty self-test-baudot.txt
|
|
||||||
[ ! -f ./run-test ] || ./run-test
|
|
||||||
@echo
|
|
||||||
@echo "minimodem: ALL TESTS PASS"
|
|
||||||
@echo
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# 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.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
.NOEXPORT:
|
.NOEXPORT:
|
||||||
|
2
src/testcases/test.01-self-test-1200
Executable file
2
src/testcases/test.01-self-test-1200
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
# use fsk.c as the sample text file
|
||||||
|
exec ./self-test 1200 fsk.c
|
2
src/testcases/test.02-self-test-300
Executable file
2
src/testcases/test.02-self-test-300
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
# use fsk.c as the sample text file
|
||||||
|
exec ./self-test 300 fsk.c
|
2
src/testcases/test.03-self-test-rtty
Executable file
2
src/testcases/test.03-self-test-rtty
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
# use self-test-baudot.txt as the sample text file
|
||||||
|
exec ./self-test rtty testcases/self-test-baudot.txt
|
5
src/testcases/test.04-self-test-0.5
Executable file
5
src/testcases/test.04-self-test-0.5
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
TMPF=/tmp/minimodem-test.$$
|
||||||
|
trap "rm -f $TMPF" 0
|
||||||
|
echo "KAMAL" > $TMPF
|
||||||
|
./self-test 0.5 $TMPF
|
Loading…
x
Reference in New Issue
Block a user