Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / Makefile.am
1 ## Makefile for the gettext-tools/tests subdirectory of GNU gettext
2 ## Copyright (C) 1995-1997, 2001-2010, 2015 Free Software Foundation,
3 ## Inc.
4 ##
5 ## This program is free software: you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or
8 ## (at your option) any later version.
9 ##
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ## GNU General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 ## Process this file with automake to produce Makefile.in.
19
20 AUTOMAKE_OPTIONS = 1.11 gnits no-dependencies color-tests
21 EXTRA_DIST =
22 MOSTLYCLEANFILES = core *.stackdump
23
24 TESTS = gettext-1 gettext-2 gettext-3 gettext-4 gettext-5 gettext-6 gettext-7 \
25         gettext-8 \
26         msgattrib-1 msgattrib-2 msgattrib-3 msgattrib-4 msgattrib-5 \
27         msgattrib-6 msgattrib-7 msgattrib-8 msgattrib-9 msgattrib-10 \
28         msgattrib-11 msgattrib-12 msgattrib-13 msgattrib-14 msgattrib-15 \
29         msgattrib-16 msgattrib-17 msgattrib-18 msgattrib-19 \
30         msgattrib-properties-1 \
31         msgcat-1 msgcat-2 msgcat-3 msgcat-4 msgcat-5 msgcat-6 msgcat-7 \
32         msgcat-8 msgcat-9 msgcat-10 msgcat-11 msgcat-12 msgcat-13 msgcat-14 \
33         msgcat-15 msgcat-16 msgcat-17 msgcat-18 msgcat-19 msgcat-20 \
34         msgcat-properties-1 msgcat-properties-2 \
35         msgcat-stringtable-1 \
36         msgcmp-1 msgcmp-2 msgcmp-3 msgcmp-4 \
37         msgcomm-1 msgcomm-2 msgcomm-3 msgcomm-4 msgcomm-5 msgcomm-6 msgcomm-7 \
38         msgcomm-8 msgcomm-9 msgcomm-10 msgcomm-11 msgcomm-12 msgcomm-13 \
39         msgcomm-14 msgcomm-15 msgcomm-16 msgcomm-17 msgcomm-18 msgcomm-19 \
40         msgcomm-20 msgcomm-21 msgcomm-22 msgcomm-23 msgcomm-24 msgcomm-25 \
41         msgcomm-26 msgcomm-27 msgcomm-28 \
42         msgconv-1 msgconv-2 msgconv-3 msgconv-4 msgconv-5 msgconv-6 msgconv-7 \
43         msgen-1 msgen-2 msgen-3 msgen-4 \
44         msgexec-1 msgexec-2 msgexec-3 msgexec-4 msgexec-5 msgexec-6 \
45         msgfilter-1 msgfilter-2 msgfilter-3 msgfilter-4 msgfilter-5 \
46         msgfilter-6 msgfilter-7 msgfilter-8 \
47         msgfilter-sr-latin-1 msgfilter-quote-1 \
48         msgfmt-1 msgfmt-2 msgfmt-3 msgfmt-4 msgfmt-5 msgfmt-6 msgfmt-7 \
49         msgfmt-8 msgfmt-9 msgfmt-10 msgfmt-11 msgfmt-12 msgfmt-13 msgfmt-14 \
50         msgfmt-15 msgfmt-16 msgfmt-17 msgfmt-18 \
51         msgfmt-properties-1 \
52         msgfmt-qt-1 msgfmt-qt-2 \
53         msgfmt-desktop-1 msgfmt-desktop-2 \
54         msgfmt-xml-1 msgfmt-xml-2 \
55         msggrep-1 msggrep-2 msggrep-3 msggrep-4 msggrep-5 msggrep-6 msggrep-7 \
56         msggrep-8 msggrep-9 msggrep-10 msggrep-11 \
57         msginit-1 msginit-2 msginit-3 msginit-4 \
58         msgmerge-1 msgmerge-2 msgmerge-3 msgmerge-4 msgmerge-5 msgmerge-6 \
59         msgmerge-7 msgmerge-8 msgmerge-9 msgmerge-10 msgmerge-11 msgmerge-12 \
60         msgmerge-13 msgmerge-14 msgmerge-15 msgmerge-16 msgmerge-17 \
61         msgmerge-18 msgmerge-19 msgmerge-20 msgmerge-21 msgmerge-22 \
62         msgmerge-23 msgmerge-24 msgmerge-25 \
63         msgmerge-compendium-1 msgmerge-compendium-2 msgmerge-compendium-3 \
64         msgmerge-compendium-4 msgmerge-compendium-5 msgmerge-compendium-6 \
65         msgmerge-properties-1 msgmerge-properties-2 \
66         msgmerge-update-1 msgmerge-update-2 msgmerge-update-3 \
67         msgmerge-update-4 \
68         msgunfmt-1 msgunfmt-2 msgunfmt-3 \
69         msgunfmt-csharp-1 \
70         msgunfmt-java-1 \
71         msgunfmt-properties-1 \
72         msgunfmt-tcl-1 \
73         msguniq-1 msguniq-2 msguniq-3 msguniq-4 msguniq-5 msguniq-6 msguniq-7 \
74         recode-sr-latin-1 recode-sr-latin-2 \
75         xgettext-2 xgettext-3 xgettext-4 xgettext-5 xgettext-6 \
76         xgettext-7 xgettext-8 xgettext-9 xgettext-10 xgettext-11 xgettext-12 \
77         xgettext-13 xgettext-14 \
78         xgettext-appdata-1 \
79         xgettext-awk-1 xgettext-awk-2 \
80         xgettext-c-2 xgettext-c-3 xgettext-c-4 xgettext-c-5 \
81         xgettext-c-6 xgettext-c-7 xgettext-c-8 xgettext-c-9 xgettext-c-10 \
82         xgettext-c-11 xgettext-c-12 xgettext-c-13 xgettext-c-14 xgettext-c-15 \
83         xgettext-c-16 xgettext-c-17 xgettext-c-18 xgettext-c-19 xgettext-c-20 \
84         xgettext-c-21 \
85         xgettext-csharp-1 xgettext-csharp-2 xgettext-csharp-3 \
86         xgettext-csharp-4 xgettext-csharp-5 xgettext-csharp-6 \
87         xgettext-csharp-7 xgettext-csharp-8 \
88         xgettext-elisp-1 xgettext-elisp-2 \
89         xgettext-glade-1 xgettext-glade-2 xgettext-glade-3 xgettext-glade-4 \
90         xgettext-glade-5 xgettext-glade-6 xgettext-glade-7 \
91         xgettext-java-1 xgettext-java-2 xgettext-java-3 xgettext-java-4 \
92         xgettext-java-5 xgettext-java-6 xgettext-java-7 \
93         xgettext-librep-1 xgettext-librep-2 \
94         xgettext-lisp-1 xgettext-lisp-2 \
95         xgettext-objc-1 xgettext-objc-2 \
96         xgettext-perl-1 xgettext-perl-2 xgettext-perl-3 xgettext-perl-4 \
97         xgettext-perl-5 xgettext-perl-6 xgettext-perl-7 xgettext-perl-8 \
98         xgettext-php-1 xgettext-php-2 xgettext-php-3 xgettext-php-4 \
99         xgettext-po-1 \
100         xgettext-properties-1 \
101         xgettext-python-1 xgettext-python-2 xgettext-python-3 \
102         xgettext-python-4 \
103         xgettext-scheme-1 xgettext-scheme-2 xgettext-scheme-3 \
104         xgettext-scheme-4 \
105         xgettext-sh-1 xgettext-sh-2 xgettext-sh-3 xgettext-sh-4 xgettext-sh-5 \
106         xgettext-sh-6 \
107         xgettext-smalltalk-1 xgettext-smalltalk-2 \
108         xgettext-stringtable-1 \
109         xgettext-tcl-1 xgettext-tcl-2 xgettext-tcl-3 xgettext-tcl-4 \
110         xgettext-ycp-1 xgettext-ycp-2 xgettext-ycp-3 xgettext-ycp-4 \
111         xgettext-lua-1 xgettext-lua-2 \
112         xgettext-javascript-1 xgettext-javascript-2 xgettext-javascript-3 \
113         xgettext-javascript-4 xgettext-javascript-5 xgettext-javascript-6 \
114         xgettext-vala-1 \
115         xgettext-gsettings-1 \
116         xgettext-desktop-1 \
117         xgettext-its-1 \
118         format-awk-1 format-awk-2 \
119         format-boost-1 format-boost-2 \
120         format-c-1 format-c-2 format-c-3 format-c-4 format-c-5 \
121         format-csharp-1 format-csharp-2 \
122         format-elisp-1 format-elisp-2 \
123         format-gcc-internal-1 format-gcc-internal-2 \
124         format-gfc-internal-1 format-gfc-internal-2 \
125         format-java-1 format-java-2 \
126         format-kde-1 format-kde-2 \
127         format-kde-kuit-1 format-kde-kuit-2 \
128         format-librep-1 format-librep-2 \
129         format-lisp-1 format-lisp-2 \
130         format-php-1 format-php-2 \
131         format-python-1 format-python-2 \
132         format-python-brace-1 format-python-brace-2 \
133         format-pascal-1 format-pascal-2 \
134         format-perl-1 format-perl-2 \
135         format-perl-brace-1 format-perl-brace-2 \
136         format-perl-mixed-1 format-perl-mixed-2 \
137         format-qt-1 format-qt-2 \
138         format-qt-plural-1 format-qt-plural-2 \
139         format-scheme-1 format-scheme-2 \
140         format-sh-1 format-sh-2 \
141         format-tcl-1 format-tcl-2 \
142         format-ycp-1 format-ycp-2 \
143         format-lua-1 format-lua-2 \
144         format-javascript-1 format-javascript-2 \
145         plural-1 plural-2 \
146         gettextpo-1 sentence \
147         lang-c lang-c++ lang-objc lang-sh lang-bash lang-python-1 \
148         lang-python-2 lang-clisp lang-elisp lang-librep lang-guile \
149         lang-smalltalk lang-java lang-csharp lang-gawk lang-pascal \
150         lang-ycp lang-tcl lang-perl-1 lang-perl-2 lang-php lang-po lang-rst \
151         lang-lua lang-javascript lang-vala \
152         autopoint-1 autopoint-2 autopoint-3 cldr-plurals-1
153
154 EXTRA_DIST += init.sh init.cfg $(TESTS) \
155         test.mo overflow-1.mo overflow-2.mo overflow-3.mo overflow-4.mo \
156         overflow-5.mo overflow-6.mo xg-c-1.ok.po mex-test2.ok \
157         mm-ko.ascii.pot mm-ko.euc-kr.po mm-ko-comp.euc-kr.po \
158         mm-viet.comp.po mm-viet.pot mm-viet.out \
159         msguniq-a.in msguniq-a.inp msguniq-a.out \
160         qttest_pl.po qttest_pl.qm \
161         qttest2_de.po qttest2_de.qm qttest2_de.ts \
162         gettext-3-1.po gettext-3-2.po gettext-4.po gettext-5.po \
163         gettext-6-1.po gettext-6-2.po gettext-7.po \
164         gettextpo-1.de.po \
165         xgettext-1 \
166         xgettext-c-1 xg-c-21.c \
167         common/supplemental/plurals.xml
168
169 XGETTEXT = ../src/xgettext
170
171 # For debugging memory leaks and memory allocation bugs.
172 # You should build with --disable-shared when using valgrind.
173 CHECKER =
174 #CHECKER = valgrind --tool=memcheck --suppressions=$(srcdir)/../gnulib-lib/malloca.valgrind --suppressions=$(srcdir)/../gnulib-lib/libunistring.valgrind --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes
175 #CHECKER = valgrind --tool=massif --format=html --depth=10 --alloc-fn=xmalloc --alloc-fn=xrealloc --stacks=no
176
177 TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) \
178                     abs_srcdir=$(abs_srcdir) \
179                     abs_top_srcdir=$(abs_top_srcdir) \
180                     GETTEXT="$(CHECKER) tstgettext" \
181                     NGETTEXT="$(CHECKER) tstngettext" \
182                     XGETTEXT="$(CHECKER) xgettext" \
183                     MSGATTRIB="$(CHECKER) msgattrib" \
184                     MSGCAT="$(CHECKER) msgcat" \
185                     MSGCMP="$(CHECKER) msgcmp" \
186                     MSGCOMM="$(CHECKER) msgcomm" \
187                     MSGCONV="$(CHECKER) msgconv" \
188                     MSGEN="$(CHECKER) msgen" \
189                     MSGEXEC="$(CHECKER) msgexec" \
190                     MSGFILTER="$(CHECKER) msgfilter" \
191                     MSGFMT="$(CHECKER) msgfmt" \
192                     MSGGREP="$(CHECKER) msggrep" \
193                     MSGINIT="$(CHECKER) msginit" \
194                     MSGMERGE="$(CHECKER) msgmerge" \
195                     MSGUNFMT="$(CHECKER) msgunfmt" \
196                     MSGUNIQ="$(CHECKER) msguniq" \
197                     RECODE="$(CHECKER) recode" \
198                     CONFIG_SHELL='$(SHELL)'
199
200 LOG_COMPILER = $(SHELL)
201
202 # Update the expected test results.
203 update-expected: xg-c-1.ok.po
204 xg-c-1.ok.po: $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c
205         $(XGETTEXT) -d xg-c-1.ok -p $(srcdir) \
206           -k_ --omit-header --no-location \
207           $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c
208
209 # Three auxiliary programs used by the tests.
210 AM_CPPFLAGS = \
211   -I.. \
212   -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \
213   -I../intl
214 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
215 # INTL_MACOSX_LIBS is needed because the programs depend on libintl.la
216 # but libtool doesn't put -Wl,-framework options into .la files.
217 LDADD = $(LDADD_@USE_INCLUDED_LIBINTL@) @INTL_MACOSX_LIBS@
218 LDADD_yes = ../intl/libintl.la @LTLIBTHREAD@
219 LDADD_no = ../intl/libgnuintl.la @LTLIBTHREAD@ @LTLIBINTL@
220 check_PROGRAMS = tstgettext tstngettext testlocale gettext-3-prg gettext-4-prg gettext-5-prg gettext-6-prg gettext-7-prg gettext-8-prg cake fc3 fc4 fc5 gettextpo-1-prg sentence
221 tstgettext_SOURCES = tstgettext.c setlocale.c
222 tstgettext_CFLAGS = -DINSTALLDIR=\".\"
223 tstgettext_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
224 tstngettext_SOURCES = tstngettext.c setlocale.c
225 tstngettext_CFLAGS = -DINSTALLDIR=\".\"
226 tstngettext_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
227 testlocale_SOURCES = testlocale.c
228 gettext_3_prg_SOURCES = gettext-3-prg.c
229 gettext_3_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
230 gettext_4_prg_SOURCES = gettext-4-prg.c
231 gettext_4_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
232 gettext_5_prg_SOURCES = gettext-5-prg.c
233 gettext_5_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
234 gettext_6_prg_SOURCES = gettext-6-prg.c
235 gettext_6_prg_CFLAGS = $(gettext_6_prg_CFLAGS_@HAVE_NEWLOCALE@)
236 gettext_6_prg_CFLAGS_1 = -DUSE_POSIX_THREADS
237 gettext_6_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD) $(gettext_6_prg_LDADD_@HAVE_NEWLOCALE@)
238 gettext_6_prg_LDADD_1 = -lpthread
239 gettext_7_prg_SOURCES = gettext-7-prg.c
240 gettext_7_prg_CFLAGS = $(gettext_7_prg_CFLAGS_@HAVE_NEWLOCALE@)
241 gettext_7_prg_CFLAGS_1 = -DUSE_POSIX_THREADS
242 gettext_7_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD) $(gettext_7_prg_LDADD_@HAVE_NEWLOCALE@)
243 gettext_7_prg_LDADD_1 = -lpthread
244 gettext_8_prg_SOURCES = gettext-8-prg.c
245 gettext_8_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
246 cake_SOURCES = plural-1-prg.c setlocale.c
247 cake_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
248 fc3_SOURCES = format-c-3-prg.c setlocale.c
249 fc3_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
250 fc4_SOURCES = format-c-4-prg.c setlocale.c
251 fc4_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
252 fc5_SOURCES = format-c-5-prg.c
253 fc5_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
254 gettextpo_1_prg_SOURCES = gettextpo-1-prg.c
255 # Don't add 'gnulib-lib' to the include path here.  Some header files
256 # there may interfere with the ones in 'libgettextpo'.
257 gettextpo_1_prg_CPPFLAGS = \
258   -I.. \
259   -I../libgettextpo -I$(top_srcdir)/libgettextpo \
260   -I../intl
261 # Don't add more libraries here. This test must check whether libgettextpo is
262 # self contained.
263 gettextpo_1_prg_LDADD = ../libgettextpo/libgettextpo.la $(LDADD)
264 sentence_SOURCES = sentence.c
265 sentence_CPPFLAGS = $(AM_CPPFLAGS) -I../src -I$(top_srcdir)/src
266 sentence_LDADD = ../src/libgettextsrc.la $(LDADD)
267
268 # Clean up after Solaris cc.
269 clean-local:
270         rm -rf SunWS_cache