speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH 2/4] added autotest support


From: William Hubbs
Subject: [PATCH 2/4] added autotest support
Date: Mon, 27 Sep 2010 15:57:18 -0500

From: Andrei Kholodnyi <address@hidden>
To: address@hidden

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 a series of tests will run automatically on installation

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           |    3 +++
 src/tests/Makefile.am  |   44 +++++++++++++++++++++++++++++++++++++++++++-
 src/tests/testsuite.at |   22 ++++++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletions(-)
 create mode 100644 src/tests/testsuite.at

diff --git a/configure.ac b/configure.ac
index 944ca6b..640e721 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,6 +15,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
 
 AM_CONFIG_HEADER(config.h)
 
+# Config test suite
+AC_CONFIG_TESTDIR(src/tests)
+
 # Command-line arguments.
 AC_ARG_ENABLE([python],
        [AS_HELP_STRING([--disable-python], [do not install python bindings])],
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 2d556b1..cbc8328 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -1,9 +1,36 @@
 ## Process this file with automake to produce Makefile.in
 
+DISTCLEANFILES = atconfig $(TESTSUITE)
+
 c_api = $(top_builddir)/src/api/c
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/api/c
 
+# 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/$@
+
+AUTOM4TE = autom4te
+AUTOTEST = $(AUTOM4TE) --language=autotest
+
+TESTSUITE_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
@@ -24,4 +51,19 @@ run_test_LDADD = $(c_api)/libspeechd.la -lpthread 
$(EXTRA_SOCKET_LIBS)
 
 EXTRA_DIST= 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
+            ssml.test stop_and_pause.test voices.test yo.wav \
+            testsuite.at $(TESTSUITE_AT)
+
+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)
+
+CLEANFILES = package.m4
diff --git a/src/tests/testsuite.at b/src/tests/testsuite.at
new file mode 100644
index 0000000..dc669ad
--- /dev/null
+++ b/src/tests/testsuite.at
@@ -0,0 +1,22 @@
+# testsuite.at - main file for autotest based tests
+#
+# Copyright (C) 2010 Andrei Kholodnyi <andrei.kholodnyi at gmail.com>
+#
+# This 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 2, or (at your option)
+# any later version.
+#
+# This software 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 package; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+AT_INIT
+AT_COPYRIGHT([Copyright (C) 2010 Andrei Kholodnyi <andrei.kholodnyi at 
gmail.com>])
+
-- 
1.7.2.2




reply via email to

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