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)
51 # Tests for header compilation
56 test_cplusplus_SOURCES = test-cplusplus.cc
57 test_c_CPPFLAGS = $(AM_CPPFLAGS)
58 test_cplusplus_CPPFLAGS = $(AM_CPPFLAGS)
60 test_c_CPPFLAGS += $(ICU_CFLAGS)
61 test_cplusplus_CPPFLAGS += $(ICU_CFLAGS)
64 test_c_CPPFLAGS += $(FREETYPE_CFLAGS)
65 test_cplusplus_CPPFLAGS += $(FREETYPE_CFLAGS)
68 # Default test running environment
72 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) \
74 G_SLICE=always-malloc \
79 # check-tool: Run tests under $(TOOL)
81 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
82 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_builddir)/libtool --mode=execute \
84 # check-tool-raw: Run tests under $(TOOL), but don't run under libtool
86 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
87 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \
90 # check-gtester: Run tests under gtester
93 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose --keep-going"
96 # Check tests under valgrind. Saves log to log-valgrind.txt
98 --tool=memcheck --suppressions=$(srcdir)/.valgrind-suppressions \
101 $(EXTRA_VALGRIND_FLAGS)
102 # Can't do for now: --show-reachable=yes
103 CLEANFILES += log-valgrind.txt
104 valgrind_verbose = $(valgrind_verbose_@AM_V@)
105 valgrind_verbose_ = $(valgrind_verbose_@AM_DEFAULT_V@)
106 valgrind_verbose_0 = | \
107 grep '\(^[^=]\|ERROR SUMMARY\|definitely lost\|indirectly lost\)' | grep -v ': 0'
108 # TODO: The following check does not fail if valgrind finds error. It should.
110 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \
111 2>&1 | tee log-valgrind.txt $(valgrind_verbose)
114 # check-symbols: Finds untested API symbols
115 symbols-tested.txt: $(TEST_PROGS)
116 $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
117 | grep ' U hb_' | sed 's/.* U hb_/hb_/' \
118 | sort | uniq > $@.tmp && mv $@.tmp $@
119 symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so
120 $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
121 | grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \
122 | sort | uniq > $@.tmp && mv $@.tmp $@
123 symbols-untested.txt: symbols-tested.txt symbols-exported.txt
124 $(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@
125 CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt
126 check-symbols: symbols-untested.txt
134 @echo "You need to have glib support enabled to run the tests"
138 .PHONY: check-symbols check-tool check-valgrind
140 -include $(top_srcdir)/git.mk