1#
2# Copyright (C) 2002 - 2018 Brailcom, o.p.s.
3#
4# This is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2, or (at your option)
7# any later version.
8#
9# This software is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program.  If not, see <https://www.gnu.org/licenses/>.
16#
17
18## Process this file with automake to produce Makefile.in
19
20DISTCLEANFILES = atconfig $(TESTSUITE)
21
22c_api = $(top_builddir)/src/api/c
23
24AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/api/c $(GLIB_CFLAGS)
25
26# The `:;' works around a redirected compound command bash exit status bug.
27package.m4: Makefile
28	:;{ \
29	  echo '# Signature of the current package.' && \
30	  echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])' && \
31	  echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])' && \
32	  echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])' && \
33	  echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])' && \
34	  echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])' && \
35	  echo 'm4_define([AT_PACKAGE_URL],       [$(PACKAGE_URL)])'; \
36	} > $@-t
37	mv $@-t $@
38
39atconfig: $(top_builddir)/config.status
40	cd $(top_builddir) && ./config.status src/tests/$@
41
42AUTOM4TE = autom4te
43AUTOTEST = $(AUTOM4TE) --language=autotest
44
45TESTSUITE_AT = c_api.at
46TESTSUITE = ./testsuite
47$(TESTSUITE): package.m4 testsuite.at $(TESTSUITE_AT)
48	$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
49	mv $@.tmp $@
50
51check_PROGRAMS = long_message clibrary clibrary2 run_test connection_recovery \
52               spd_cancel_long_message spd_set_notifications_all
53
54long_message_SOURCES = long_message.c
55long_message_LDADD = $(c_api)/libspeechd.la $(EXTRA_SOCKET_LIBS)
56
57clibrary_SOURCES = clibrary.c
58clibrary_LDADD = $(c_api)/libspeechd.la $(EXTRA_SOCKET_LIBS)
59
60clibrary2_SOURCES = clibrary2.c
61clibrary2_LDADD = $(c_api)/libspeechd.la $(EXTRA_SOCKET_LIBS)
62
63connection_recovery_SOURCES = connection-recovery.c
64connection_recovery_LDADD = $(c_api)/libspeechd.la $(EXTRA_SOCKET_LIBS)
65
66spd_cancel_long_message_SOURCES = spd_cancel_long_message.c
67spd_cancel_long_message_LDADD = $(c_api)/libspeechd.la $(EXTRA_SOCKET_LIBS)
68
69spd_set_notifications_all_SOURCES = spd_set_notifications_all.c
70spd_set_notifications_all_LDADD = $(c_api)/libspeechd.la $(EXTRA_SOCKET_LIBS)
71
72run_test_SOURCES = run_test.c
73run_test_LDADD = $(c_api)/libspeechd.la $(GLIB_LIBS) $(EXTRA_SOCKET_LIBS)
74
75EXTRA_DIST= basic.test general.test keys.test priority_progress.test \
76            pronunciation.test punctuation.test sound_icons.test spelling.test \
77            ssml.test stop_and_pause.test voices.test yo.wav \
78            testsuite.at $(TESTSUITE_AT) sayfortune.sh
79
80clean-local:
81	test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
82	rm -f *.tmp
83	rm -f -r autom4te.cache
84
85# Run the test suite on the *installed* tree.
86testinstall: atconfig $(TESTSUITE)
87	$(SHELL) $(TESTSUITE) AUTOTEST_PATH="$(bindir)" $(TESTSUITEFLAGS)
88
89CLEANFILES = package.m4
90
91-include $(top_srcdir)/git.mk
92