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) $(GTHREAD_CFLAGS)
11 LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS) $(GTHREAD_LIBS)
13 EXTRA_DIST += hb-test.h
15 check_PROGRAMS = $(TEST_PROGS)
16 noinst_PROGRAMS = $(TEST_PROGS)
30 test_unicode_CPPFLAGS = $(AM_CPPFLAGS)
32 test_unicode_CPPFLAGS += $(GLIB_CFLAGS)
35 test_unicode_CPPFLAGS += $(ICU_CFLAGS)
45 # Tests for header compilation
50 test_cplusplus_SOURCES = test-cplusplus.cc
51 test_c_CPPFLAGS = $(AM_CPPFLAGS)
52 test_cplusplus_CPPFLAGS = $(AM_CPPFLAGS)
54 test_c_CPPFLAGS += $(ICU_CFLAGS)
55 test_cplusplus_CPPFLAGS += $(ICU_CFLAGS)
58 test_c_CPPFLAGS += $(FREETYPE_CFLAGS)
59 test_cplusplus_CPPFLAGS += $(FREETYPE_CFLAGS)
62 # Default test running environment
66 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) \
68 G_SLICE=always-malloc \
73 # check-tool: Run tests under $(TOOL)
75 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
76 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_builddir)/libtool --mode=execute \
78 # check-tool-raw: Run tests under $(TOOL), but don't run under libtool
80 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
81 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \
84 # check-gtester: Run tests under gtester
87 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose --keep-going"
90 # Check tests under valgrind. Saves log to log-valgrind.txt
92 --tool=memcheck --suppressions=$(srcdir)/.valgrind-suppressions \
95 $(EXTRA_VALGRIND_FLAGS)
96 # Can't do for now: --show-reachable=yes
97 CLEANFILES += log-valgrind.txt
98 valgrind_verbose = $(valgrind_verbose_$(V))
99 valgrind_verbose_ = $(valgrind_verbose_$(AM_DEFAULT_VERBOSITY))
100 valgrind_verbose_0 = | \
101 grep '\(^[^=]\|ERROR SUMMARY\|definitely lost\|indirectly lost\)' | grep -v ': 0'
102 # TODO: The following check does not fail if valgrind finds error. It should.
104 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \
105 2>&1 | tee log-valgrind.txt $(valgrind_verbose)
108 # check-symbols: Finds untested API symbols
109 symbols-tested.txt: $(TEST_PROGS)
110 $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
111 | grep ' U hb_' | sed 's/.* U hb_/hb_/' \
112 | sort | uniq > $@.tmp && mv $@.tmp $@
113 symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so
114 $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
115 | grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \
116 | sort | uniq > $@.tmp && mv $@.tmp $@
117 symbols-untested.txt: symbols-tested.txt symbols-exported.txt
118 $(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@
119 CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt
120 check-symbols: symbols-untested.txt
128 @echo "You need to have glib support enabled to run the tests"
132 .PHONY: check-symbols check-tool check-valgrind
134 -include $(top_srcdir)/git.mk