[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] added autotest support
From: |
Andrei Kholodnyi |
Subject: |
[PATCH 1/3] added autotest support |
Date: |
Sun, 26 Sep 2010 23:10:51 +0200 |
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 | 46 ++++++++++++++++++++++++++++++++++++++++++++--
src/tests/testsuite.at | 22 ++++++++++++++++++++++
3 files changed, 69 insertions(+), 2 deletions(-)
create mode 100644 src/tests/testsuite.at
diff --git a/configure.ac b/configure.ac
index 2441474..b2968e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,6 +14,9 @@ AM_INIT_AUTOMAKE([foreign])
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 a4d25a6..470fc5e 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -1,10 +1,37 @@
## 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
-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/$@
+
+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
long_message_LDADD = $(c_api)/libspeechd.la -lpthread $(EXTRA_SOCKET_LIBS)
@@ -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.6.0.4
- [PATCH 1/3] added autotest support,
Andrei Kholodnyi <=
[PATCH 1/3] added autotest support, William Hubbs, 2010/09/26