speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4] added autotest support


From: Andrei Kholodnyi
Subject: [PATCH 4/4] added autotest support
Date: Sun, 12 Sep 2010 12:43:33 +0200

autotest support is added as described in
http://www.gnu.org/software/autoconf/manual/autoconf.html#Using-Autotest

now it is possible to check the installation with make installcheck.
By doing that series of tests will run automatically on installation

At the moment two sets of tests are defined
- c_api tests
- ssip

the list of tests can be retrieved by
src/tests/testsuite -l

src/tests/testsuite -h gives a list of all supported options
---
 configure.ac           |   47 ++++++++++++++++++++----------------
 src/tests/Makefile.am  |   62 ++++++++++++++++++++++++++++++++++++++++++++++-
 src/tests/c_api.at     |   26 ++++++++++++++++++++
 src/tests/ssip.at      |   26 ++++++++++++++++++++
 src/tests/testsuite.at |   20 +++++++++++++++
 5 files changed, 158 insertions(+), 23 deletions(-)
 create mode 100644 src/tests/c_api.at
 create mode 100644 src/tests/ssip.at
 create mode 100644 src/tests/testsuite.at

diff --git a/configure.ac b/configure.ac
index 8ad25fa..f4812f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,6 +14,10 @@ AM_INIT_AUTOMAKE([foreign])
 
 AM_CONFIG_HEADER(config.h)
 
+# Config test suite
+AC_CONFIG_TESTDIR(src/tests)
+AC_CONFIG_FILES([src/tests/Makefile])
+
 # Command-line arguments.
 AC_ARG_ENABLE([python],
        [AS_HELP_STRING([--disable-python], [do not install python bindings])],
@@ -417,24 +421,25 @@ AC_SUBST(RDYNAMIC)
 localedir=${datadir}/locale
 AC_SUBST(localedir)
 
-AC_OUTPUT([Makefile
-           speech-dispatcher.pc
-           config/Makefile
-           config/modules/Makefile
-           config/clients/Makefile
-           doc/Makefile
-           po/Makefile.in
-           src/Makefile
-           src/server/Makefile
-           src/modules/Makefile
-           src/c/Makefile
-           src/c/api/Makefile
-           src/c/clients/Makefile
-           src/c/clients/say/Makefile
-           src/c/clients/spdsend/Makefile
-           src/tests/Makefile
-           src/audio/Makefile
-           src/audio/static_plugins.c
-           src/python/Makefile
-           src/python/speechd/Makefile
-           src/python/speechd_config/Makefile])
+AC_CONFIG_FILES([Makefile
+                 speech-dispatcher.pc
+                 config/Makefile
+                 config/modules/Makefile
+                 config/clients/Makefile
+                 doc/Makefile
+                 po/Makefile.in
+                 src/Makefile
+                 src/server/Makefile
+                 src/modules/Makefile
+                 src/c/Makefile
+                 src/c/api/Makefile
+                 src/c/clients/Makefile
+                 src/c/clients/say/Makefile
+                 src/c/clients/spdsend/Makefile
+                 src/audio/Makefile
+                 src/audio/static_plugins.c
+                 src/python/Makefile
+                 src/python/speechd/Makefile
+                 src/python/speechd_config/Makefile])
+                 
+AC_OUTPUT
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 6e12c6f..9eeb73d 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -1,3 +1,22 @@
+# Makefile for tests
+
+# Copyright (C) 2010 Brailcom, o.p.s.
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+DISTCLEANFILES = atconfig $(TESTSUITE)
+MAINTAINERCLEANFILES = Makefile.in
 
 localedir = $(datadir)/locale
 inc_local = "-I$(top_srcdir)/intl/"
@@ -5,7 +24,34 @@ c_api = $(top_builddir)/src/c/api
 
 AM_CFLAGS = -I$(top_srcdir)/src/c/api -DLOCALEDIR=\"$(localedir)\" 
$(inc_local) -I../audio/
 
-bin_PROGRAMS = long_message clibrary clibrary2 run_test connection_recovery
+# The `:;' works around a redirected compound command bash exit status bug.
+package.m4: Makefile
+       :;{ \
+         echo '# Signature of the current package.' && \
+         echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])' && \
+         echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])' && \
+         echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])' && \
+         echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])' && \
+         echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])' && \
+         echo 'm4_define([AT_PACKAGE_URL],       [$(PACKAGE_URL)])'; \
+       } > address@hidden
+       mv address@hidden $@
+
+atconfig: $(top_builddir)/config.status
+       cd $(top_builddir) && ./config.status src/tests/$@
+
+CLEANFILES = package.m4
+
+AUTOM4TE = autom4te
+AUTOTEST = $(AUTOM4TE) --language=autotest
+
+TESTSUITE_AT = c_api.at ssip.at
+TESTSUITE = ./testsuite
+$(TESTSUITE): package.m4 testsuite.at $(TESTSUITE_AT)
+       $(AUTOTEST) -I '$(srcdir)' -o address@hidden address@hidden
+       mv address@hidden $@
+
+check_PROGRAMS = long_message clibrary clibrary2 run_test connection_recovery
 
 long_message_SOURCES = long_message.c
 long_message_LDADD = $(c_api)/libspeechd.la -lpthread @EXTRA_SOCKET_LIBS@
@@ -22,6 +68,18 @@ connection_recovery_LDADD = $(c_api)/libspeechd.la -lpthread 
@EXTRA_SOCKET_LIBS@
 run_test_SOURCES = run_test.c
 run_test_LDADD = $(c_api)/libspeechd.la -lpthread @EXTRA_SOCKET_LIBS@
 
-EXTRA_DIST= basic.test general.test keys.test priority_progress.test \
+EXTRA_DIST= testsuite.at $(TESTSUITE_AT) basic.test general.test keys.test 
priority_progress.test \
             pronunciation.test punctuation.test sound_icons.test spelling.test 
\
             ssml.test stop_and_pause.test voices.test yo.wav
+
+clean-local:
+       test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
+       rm -f *.tmp
+       rm -f -r autom4te.cache
+
+check-local: atconfig $(TESTSUITE)
+       $(SHELL) $(TESTSUITE) $(TESTSUITEFLAGS)
+
+# Run the test suite on the *installed* tree.
+installcheck-local: atconfig $(TESTSUITE)
+       $(SHELL) $(TESTSUITE) AUTOTEST_PATH="$(bindir)" $(TESTSUITEFLAGS)
diff --git a/src/tests/c_api.at b/src/tests/c_api.at
new file mode 100644
index 0000000..baebead
--- /dev/null
+++ b/src/tests/c_api.at
@@ -0,0 +1,26 @@
+# Copyright (C) 2010 Andrei Kholodnyi <andrei.kholodnyi at gmail.com>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+AT_BANNER([C API])
+
+AT_SETUP([c_api])
+
+AT_KEYWORDS([clibrary])
+AT_CHECK([${abs_builddir}/clibrary], [0])
+
+AT_KEYWORDS([clibrary2])
+AT_CHECK([${abs_builddir}/clibrary2], [0])
+
+AT_CLEANUP
diff --git a/src/tests/ssip.at b/src/tests/ssip.at
new file mode 100644
index 0000000..fe3e2de
--- /dev/null
+++ b/src/tests/ssip.at
@@ -0,0 +1,26 @@
+# Copyright (C) 2010 Andrei Kholodnyi <andrei.kholodnyi at gmail.com>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+AT_BANNER([SSIP])
+
+AT_SETUP([ssip])
+
+AT_KEYWORDS([basic])
+AT_CHECK([${abs_builddir}/run_test ${abs_builddir}/basic.test])
+
+AT_KEYWORDS([punctuation])
+AT_CHECK([/home/akholodn/wrgit/speechd/src/tests/run_test 
/home/akholodn/wrgit/speechd/src/tests/punctuation.test])
+
+AT_CLEANUP
\ No newline at end of file
diff --git a/src/tests/testsuite.at b/src/tests/testsuite.at
new file mode 100644
index 0000000..cb9890c
--- /dev/null
+++ b/src/tests/testsuite.at
@@ -0,0 +1,20 @@
+# Copyright (C) 2010 Andrei Kholodnyi <andrei.kholodnyi at gmail.com>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+AT_INIT
+AT_COPYRIGHT([Copyright (C) 2010 Andrei Kholodnyi <andrei.kholodnyi at 
gmail.com>])
+
+m4_include([c_api.at])
+m4_include([ssip.at])
-- 
1.6.0.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]