• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Process this file with automake to produce Makefile.in
2
3NULL =
4EXTRA_DIST =
5CLEANFILES =
6DISTCLEANFILES =
7MAINTAINERCLEANFILES =
8
9# Convenience targets:
10lib:
11	@$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src lib
12libs:
13	@$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src libs
14
15EXTRA_DIST += CMakeLists.txt
16
17EXTRA_DIST += fonts
18
19LINK = $(CXXLINK)
20
21if HAVE_GLIB
22AM_CPPFLAGS = -DSRCDIR="\"$(srcdir)\"" -I$(top_srcdir)/src/ -I$(top_builddir)/src/ $(GLIB_CFLAGS)
23LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS)
24
25EXTRA_DIST += hb-test.h hb-subset-test.h
26
27check_PROGRAMS = $(TEST_PROGS)
28noinst_PROGRAMS = $(TEST_PROGS)
29
30TEST_PROGS = \
31	test-aat-layout \
32	test-baseline \
33	test-blob \
34	test-buffer \
35	test-collect-unicodes \
36	test-common \
37	test-font \
38	test-map \
39	test-object \
40	test-ot-face \
41	test-set \
42	test-shape \
43	test-subset \
44	test-subset-cmap \
45	test-subset-drop-tables \
46	test-subset-glyf \
47	test-subset-hdmx \
48	test-subset-hmtx \
49	test-subset-os2 \
50	test-subset-post \
51	test-subset-vmtx \
52	test-subset-cff1 \
53	test-subset-cff2 \
54	test-unicode \
55	test-version \
56	test-subset-nameids \
57	$(NULL)
58
59test_subset_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
60test_subset_cmap_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
61test_subset_drop_tables_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
62test_subset_glyf_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
63test_subset_hdmx_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
64test_subset_hmtx_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
65test_subset_os2_LDADD  = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
66test_subset_post_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
67test_subset_vmtx_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
68test_subset_cff1_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
69test_subset_cff2_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
70test_subset_nameids_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
71
72test_unicode_CPPFLAGS = \
73	$(AM_CPPFLAGS) \
74	$(GLIB_CFLAGS) \
75	$(NULL)
76test_unicode_LDADD = $(LDADD)
77if HAVE_ICU
78test_unicode_CPPFLAGS += $(ICU_CFLAGS)
79test_unicode_LDADD += $(top_builddir)/src/libharfbuzz-icu.la $(ICU_LIBS)
80endif
81
82
83TEST_PROGS += \
84	test-ot-color \
85	test-ot-ligature-carets \
86	test-ot-name \
87	test-ot-meta \
88	test-ot-metrics \
89	test-ot-tag \
90	test-ot-extents-cff \
91	test-ot-metrics-tt-var \
92	$(NULL)
93
94
95if HAVE_PTHREAD
96if HAVE_FREETYPE
97TEST_PROGS += test-multithread
98test_multithread_CFLAGS = $(CFLAGS) $(PTHREAD_CFLAGS) $(FREETYPE_CFLAGS)
99test_multithread_LDADD = $(LDADD) $(PTHREAD_LIBS) $(FREETYPE_LIBS)
100# The auto-generated link rule somehow includes CFLAGS as well.  Without
101# it, pthread link fails, because, who knows why, $PTHREAD_LIBS is empty.
102test_multithread_LINK = $(LINK) $(PTHREAD_CFLAGS)
103endif
104endif
105
106if HAVE_FREETYPE
107TEST_PROGS += \
108	test-ot-math \
109	$(NULL)
110test_ot_math_LDADD = $(LDADD) $(FREETYPE_LIBS)
111test_ot_math_CPPFLAGS = $(AM_CPPFLAGS) $(FREETYPE_CFLAGS)
112endif # HAVE_FREETYPE
113
114
115# Tests for header compilation
116TEST_PROGS += \
117	test-c \
118	test-cplusplus \
119	$(NULL)
120test_cplusplus_SOURCES = test-cplusplus.cc
121test_c_CPPFLAGS = $(AM_CPPFLAGS)
122test_cplusplus_CPPFLAGS = $(AM_CPPFLAGS)
123if HAVE_ICU
124test_c_CPPFLAGS += $(ICU_CFLAGS)
125test_cplusplus_CPPFLAGS += $(ICU_CFLAGS)
126endif
127if HAVE_FREETYPE
128test_c_CPPFLAGS += $(FREETYPE_CFLAGS)
129test_cplusplus_CPPFLAGS += $(FREETYPE_CFLAGS)
130endif
131
132# Default test running environment
133TESTS = $(TEST_PROGS)
134TESTS_ENVIRONMENT = \
135	MALLOC_CHECK_=2 \
136	MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) \
137	G_DEBUG=gc-friendly \
138	G_SLICE=always-malloc \
139	srcdir=$(srcdir) \
140	G_TEST_SRCDIR=$(abs_srcdir) \
141	G_TEST_BUILDDIR=$(abs_builddir) \
142	$(NULL)
143
144
145# check-tool: Run tests under $(TOOL)
146check-tool:
147	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
148	TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_builddir)/libtool --mode=execute \
149	env $(TOOL)'
150# check-tool-raw: Run tests under $(TOOL), but don't run under libtool
151check-tool-raw:
152	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
153	TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \
154	env $(TOOL)'
155
156# check-gtester: Run tests under gtester
157GTESTER = gtester
158check-gtester:
159	$(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose --keep-going"
160
161
162# Check tests under valgrind.  Saves log to log-valgrind.txt
163VALGRIND_FLAGS = \
164	--tool=memcheck \
165	--track-origins=yes \
166	--leak-check=yes \
167	$(EXTRA_VALGRIND_FLAGS)
168#	Can't do for now: --show-reachable=yes
169CLEANFILES +=  log-valgrind.txt
170valgrind_verbose = $(valgrind_verbose_@AM_V@)
171valgrind_verbose_ = $(valgrind_verbose_@AM_DEFAULT_V@)
172valgrind_verbose_0 = | \
173	grep '\(^[^=]\|ERROR SUMMARY\|definitely lost\|indirectly lost\)' | grep -v ': 0'
174# TODO: The following check does not fail if valgrind finds error.  It should.
175check-valgrind:
176	$(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \
177	2>&1 | tee log-valgrind.txt $(valgrind_verbose)
178
179
180# check-symbols: Finds untested API symbols
181symbols-tested.txt: $(TEST_PROGS)
182	$(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
183	| grep ' U hb_' | sed 's/.* U hb_/hb_/' \
184	| sort | uniq > $@.tmp && mv $@.tmp $@
185symbols-tested-or-deprecated.txt: symbols-tested.txt $(top_builddir)/src/harfbuzz-deprecated-symbols.txt
186	$(AM_V_GEN)cat $^ | sort | uniq > $@.tmp; mv $@.tmp $@
187symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so
188	$(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
189	| grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \
190	| sort | uniq > $@.tmp && mv $@.tmp $@
191symbols-untested.txt: symbols-tested-or-deprecated.txt symbols-exported.txt
192	$(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@
193CLEANFILES += symbols-tested.txt \
194	symbols-exported.txt \
195	symbols-untested.txt \
196	symbols-tested-or-deprecated.txt
197check-symbols: symbols-untested.txt
198	@! cat $^ | grep .
199
200
201
202else # !HAVE_GLIB
203check-am: err-glib
204err-glib:
205	@echo "You need to have glib support enabled to run the tests"
206	@exit 77
207endif # HAVE_GLIB
208
209.PHONY: check-symbols check-tool check-valgrind
210
211-include $(top_srcdir)/git.mk
212