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 12 13if HAVE_GLIB 14AM_CPPFLAGS = -DSRCDIR="\"$(srcdir)\"" -I$(top_srcdir)/src/ -I$(top_builddir)/src/ $(GLIB_CFLAGS) 15LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS) 16 17EXTRA_DIST += hb-test.h 18 19check_PROGRAMS = $(TEST_PROGS) 20noinst_PROGRAMS = $(TEST_PROGS) 21 22TEST_PROGS = \ 23 test-blob \ 24 test-buffer \ 25 test-common \ 26 test-font \ 27 test-object \ 28 test-set \ 29 test-shape \ 30 test-unicode \ 31 test-version \ 32 $(NULL) 33 34test_unicode_CPPFLAGS = \ 35 $(AM_CPPFLAGS) \ 36 $(GLIB_CFLAGS) \ 37 $(NULL) 38test_unicode_LDADD = $(LDADD) 39if HAVE_ICU 40test_unicode_CPPFLAGS += $(ICU_CFLAGS) 41test_unicode_LDADD += $(top_builddir)/src/libharfbuzz-icu.la $(ICU_LIBS) 42endif 43 44 45if HAVE_OT 46 47TEST_PROGS += \ 48 test-ot-tag \ 49 $(NULL) 50 51if HAVE_FREETYPE 52TEST_PROGS += \ 53 test-ot-math \ 54 $(NULL) 55test_ot_math_LDADD = $(LDADD) $(FREETYPE_LIBS) 56test_ot_math_CPPFLAGS = $(AM_CPPFLAGS) $(FREETYPE_CFLAGS) 57EXTRA_DIST += \ 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 \ 65 $(NULL) 66endif # HAVE_FREETYPE 67 68endif # HAVE_OT 69 70# Tests for header compilation 71TEST_PROGS += \ 72 test-c \ 73 test-cplusplus \ 74 $(NULL) 75test_cplusplus_SOURCES = test-cplusplus.cc 76test_c_CPPFLAGS = $(AM_CPPFLAGS) 77test_cplusplus_CPPFLAGS = $(AM_CPPFLAGS) 78if HAVE_ICU 79test_c_CPPFLAGS += $(ICU_CFLAGS) 80test_cplusplus_CPPFLAGS += $(ICU_CFLAGS) 81endif 82if HAVE_FREETYPE 83test_c_CPPFLAGS += $(FREETYPE_CFLAGS) 84test_cplusplus_CPPFLAGS += $(FREETYPE_CFLAGS) 85endif 86 87# Default test running environment 88TESTS = $(TEST_PROGS) 89TESTS_ENVIRONMENT = \ 90 MALLOC_CHECK_=2 \ 91 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) \ 92 G_DEBUG=gc-friendly \ 93 G_SLICE=always-malloc \ 94 srcdir=$(srcdir) \ 95 G_TEST_SRCDIR=$(abs_srcdir) \ 96 G_TEST_BUILDDIR=$(abs_builddir) \ 97 $(NULL) 98 99 100# check-tool: Run tests under $(TOOL) 101check-tool: 102 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \ 103 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_builddir)/libtool --mode=execute \ 104 env $(TOOL)' 105# check-tool-raw: Run tests under $(TOOL), but don't run under libtool 106check-tool-raw: 107 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \ 108 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \ 109 env $(TOOL)' 110 111# check-gtester: Run tests under gtester 112GTESTER = gtester 113check-gtester: 114 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose --keep-going" 115 116 117# Check tests under valgrind. Saves log to log-valgrind.txt 118VALGRIND_FLAGS = \ 119 --tool=memcheck --suppressions=$(srcdir)/.valgrind-suppressions \ 120 --track-origins=yes \ 121 --leak-check=yes 122 $(EXTRA_VALGRIND_FLAGS) 123# Can't do for now: --show-reachable=yes 124CLEANFILES += log-valgrind.txt 125valgrind_verbose = $(valgrind_verbose_@AM_V@) 126valgrind_verbose_ = $(valgrind_verbose_@AM_DEFAULT_V@) 127valgrind_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. 130check-valgrind: 131 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \ 132 2>&1 | tee log-valgrind.txt $(valgrind_verbose) 133 134 135# check-symbols: Finds untested API symbols 136symbols-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 $@ 140symbols-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 $@ 144symbols-untested.txt: symbols-tested.txt symbols-exported.txt 145 $(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@ 146CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt 147check-symbols: symbols-untested.txt 148 @! cat $^ | grep . 149 150 151 152else # !HAVE_GLIB 153check-am: err-glib 154err-glib: 155 @echo "You need to have glib support enabled to run the tests" 156 @exit 77 157endif # HAVE_GLIB 158 159.PHONY: check-symbols check-tool check-valgrind 160 161-include $(top_srcdir)/git.mk 162