1 # Process this file with automake to produce Makefile.in
10 AM_CPPFLAGS = -DSRCDIR="\"$(srcdir)\"" -I$(top_srcdir)/src/ -I$(top_builddir)/src/ $(GLIB_CFLAGS)
11 LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS)
13 EXTRA_DIST += hb-test.h
15 check_PROGRAMS = $(TEST_PROGS)
16 noinst_PROGRAMS = $(TEST_PROGS)
30 test_unicode_CPPFLAGS = $(AM_CPPFLAGS)
31 test_unicode_LDADD = $(LDADD)
33 test_unicode_CPPFLAGS += $(GLIB_CFLAGS)
36 test_unicode_CPPFLAGS += $(ICU_CFLAGS)
37 test_unicode_LDADD += $(top_builddir)/src/libharfbuzz-icu.la
47 # Tests for header compilation
52 test_cplusplus_SOURCES = test-cplusplus.cc
53 test_c_CPPFLAGS = $(AM_CPPFLAGS)
54 test_cplusplus_CPPFLAGS = $(AM_CPPFLAGS)
56 test_c_CPPFLAGS += $(ICU_CFLAGS)
57 test_cplusplus_CPPFLAGS += $(ICU_CFLAGS)
60 test_c_CPPFLAGS += $(FREETYPE_CFLAGS)
61 test_cplusplus_CPPFLAGS += $(FREETYPE_CFLAGS)
64 # Default test running environment
68 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) \
70 G_SLICE=always-malloc \
75 # check-tool: Run tests under $(TOOL)
77 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
78 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_builddir)/libtool --mode=execute \
80 # check-tool-raw: Run tests under $(TOOL), but don't run under libtool
82 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
83 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \
86 # check-gtester: Run tests under gtester
89 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose --keep-going"
92 # Check tests under valgrind. Saves log to log-valgrind.txt
94 --tool=memcheck --suppressions=$(srcdir)/.valgrind-suppressions \
97 $(EXTRA_VALGRIND_FLAGS)
98 # Can't do for now: --show-reachable=yes
99 CLEANFILES += log-valgrind.txt
100 valgrind_verbose = $(valgrind_verbose_@AM_V@)
101 valgrind_verbose_ = $(valgrind_verbose_@AM_DEFAULT_V@)
102 valgrind_verbose_0 = | \
103 grep '\(^[^=]\|ERROR SUMMARY\|definitely lost\|indirectly lost\)' | grep -v ': 0'
104 # TODO: The following check does not fail if valgrind finds error. It should.
106 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \
107 2>&1 | tee log-valgrind.txt $(valgrind_verbose)
110 # check-symbols: Finds untested API symbols
111 symbols-tested.txt: $(TEST_PROGS)
112 $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
113 | grep ' U hb_' | sed 's/.* U hb_/hb_/' \
114 | sort | uniq > $@.tmp && mv $@.tmp $@
115 symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so
116 $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
117 | grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \
118 | sort | uniq > $@.tmp && mv $@.tmp $@
119 symbols-untested.txt: symbols-tested.txt symbols-exported.txt
120 $(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@
121 CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt
122 check-symbols: symbols-untested.txt
130 @echo "You need to have glib support enabled to run the tests"
134 .PHONY: check-symbols check-tool check-valgrind
136 -include $(top_srcdir)/git.mk