1 # Process this file with automake to produce Makefile.in
11 @$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src lib
14 AM_CPPFLAGS = -DSRCDIR="\"$(srcdir)\"" -I$(top_srcdir)/src/ -I$(top_builddir)/src/ $(GLIB_CFLAGS)
15 LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS)
17 EXTRA_DIST += hb-test.h
19 check_PROGRAMS = $(TEST_PROGS)
20 noinst_PROGRAMS = $(TEST_PROGS)
34 test_unicode_CPPFLAGS = $(AM_CPPFLAGS)
35 test_unicode_LDADD = $(LDADD)
37 test_unicode_CPPFLAGS += $(GLIB_CFLAGS)
40 test_unicode_CPPFLAGS += $(ICU_CFLAGS)
41 test_unicode_LDADD += $(top_builddir)/src/libharfbuzz-icu.la $(ICU_LIBS)
55 test_ot_math_LDADD = $(LDADD) $(FREETYPE_LIBS)
56 test_ot_math_CPPFLAGS = $(AM_CPPFLAGS) $(FREETYPE_CFLAGS)
58 fonts/MathTestFontEmpty.otf \
59 fonts/MathTestFontFull.otf \
60 fonts/MathTestFontNone.otf \
61 fonts/MathTestFontPartial1.otf \
62 fonts/MathTestFontPartial2.otf \
63 fonts/MathTestFontPartial3.otf \
64 fonts/MathTestFontPartial4.otf \
70 # Tests for header compilation
75 test_cplusplus_SOURCES = test-cplusplus.cc
76 test_c_CPPFLAGS = $(AM_CPPFLAGS)
77 test_cplusplus_CPPFLAGS = $(AM_CPPFLAGS)
79 test_c_CPPFLAGS += $(ICU_CFLAGS)
80 test_cplusplus_CPPFLAGS += $(ICU_CFLAGS)
83 test_c_CPPFLAGS += $(FREETYPE_CFLAGS)
84 test_cplusplus_CPPFLAGS += $(FREETYPE_CFLAGS)
87 # Default test running environment
91 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) \
93 G_SLICE=always-malloc \
95 G_TEST_SRCDIR=$(abs_srcdir) \
96 G_TEST_BUILDDIR=$(abs_builddir) \
100 # check-tool: Run tests under $(TOOL)
102 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
103 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_builddir)/libtool --mode=execute \
105 # check-tool-raw: Run tests under $(TOOL), but don't run under libtool
107 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
108 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \
111 # check-gtester: Run tests under gtester
114 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose --keep-going"
117 # Check tests under valgrind. Saves log to log-valgrind.txt
119 --tool=memcheck --suppressions=$(srcdir)/.valgrind-suppressions \
120 --track-origins=yes \
122 $(EXTRA_VALGRIND_FLAGS)
123 # Can't do for now: --show-reachable=yes
124 CLEANFILES += log-valgrind.txt
125 valgrind_verbose = $(valgrind_verbose_@AM_V@)
126 valgrind_verbose_ = $(valgrind_verbose_@AM_DEFAULT_V@)
127 valgrind_verbose_0 = | \
128 grep '\(^[^=]\|ERROR SUMMARY\|definitely lost\|indirectly lost\)' | grep -v ': 0'
129 # TODO: The following check does not fail if valgrind finds error. It should.
131 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \
132 2>&1 | tee log-valgrind.txt $(valgrind_verbose)
135 # check-symbols: Finds untested API symbols
136 symbols-tested.txt: $(TEST_PROGS)
137 $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
138 | grep ' U hb_' | sed 's/.* U hb_/hb_/' \
139 | sort | uniq > $@.tmp && mv $@.tmp $@
140 symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so
141 $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
142 | grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \
143 | sort | uniq > $@.tmp && mv $@.tmp $@
144 symbols-untested.txt: symbols-tested.txt symbols-exported.txt
145 $(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@
146 CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt
147 check-symbols: symbols-untested.txt
155 @echo "You need to have glib support enabled to run the tests"
159 .PHONY: check-symbols check-tool check-valgrind
161 -include $(top_srcdir)/git.mk