harfbuzz/test/Makefile.am

120 lines
3.2 KiB
Makefile
Raw Normal View History

# Process this file with automake to produce Makefile.in
2011-04-13 05:09:09 +00:00
NULL =
EXTRA_DIST =
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
2011-04-13 05:09:09 +00:00
if HAVE_GLIB
AM_CPPFLAGS = -I$(top_srcdir)/src/ $(GLIB_CFLAGS) $(GTHREAD_CFLAGS)
LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS) $(GTHREAD_LIBS)
EXTRA_DIST += hb-test.h
check_PROGRAMS = $(TEST_PROGS)
noinst_PROGRAMS = $(TEST_PROGS)
TEST_PROGS = \
2011-05-10 21:37:08 +00:00
test-blob \
2011-04-13 05:09:09 +00:00
test-buffer \
test-common \
test-font \
test-object \
test-shape \
test-unicode \
2011-05-27 05:00:55 +00:00
test-version \
2011-04-13 05:09:09 +00:00
$(NULL)
TEST_PROGS += \
test-ot-tag \
$(NULL)
# Tests for header compilation
TEST_PROGS += \
test-c \
test-cplusplus \
$(NULL)
test_cplusplus_SOURCES = test-cplusplus.cc
test_c_CPPFLAGS = $(AM_CPPFLAGS)
test_cplusplus_CPPFLAGS = $(AM_CPPFLAGS)
if HAVE_ICU
test_c_CPPFLAGS += $(ICU_CFLAGS)
test_cplusplus_CPPFLAGS += $(ICU_CFLAGS)
endif
if HAVE_FREETYPE
test_c_CPPFLAGS += $(FREETYPE_CFLAGS)
test_cplusplus_CPPFLAGS += $(FREETYPE_CFLAGS)
# TODO replace freetype with other stuff in the following test
test_object_CPPFLAGS = $(AM_CPPFLAGS) $(FREETYPE_CFLAGS)
test_object_LIBS = $(LDADD) $(FREETYPE_LIBS)
endif
# test-symbols: Finds untested API symbols
symbols-tested.txt: $(TEST_PROGS)
$(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
| grep ' U hb_' | sed 's/.* U hb_/hb_/' \
| sort | uniq > $@.tmp && mv $@.tmp $@
symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so
$(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
| grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \
| sort | uniq > $@.tmp && mv $@.tmp $@
symbols-untested.txt: symbols-tested.txt symbols-exported.txt
$(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@
CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt
test-symbols: symbols-untested.txt
@! cat $^ | grep .
TESTS = $(TEST_PROGS)
TESTS_ENVIRONMENT = \
MALLOC_CHECK_=2 \
MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) \
G_DEBUG=gc-friendly \
G_SLICE=always-malloc \
$(ENV)
# check-tool: Run tests under $(TOOL)
check-tool:
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_builddir)/libtool --mode=execute \
env $(TOOL)'
# check-tool-raw: Run tests under $(TOOL), but don't run under libtool
check-tool-raw:
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \
env $(TOOL)'
# check-gtester: Run tests under gtester
GTESTER = gtester
check-gtester:
$(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose"
# Check tests under valgrind. Saves log to valgrind-log
VALGRIND_FLAGS = \
--tool=memcheck --suppressions=$(srcdir)/.valgrind-suppressions \
--track-origins=yes \
--leak-check=yes
$(EXTRA_VALGRIND_FLAGS)
# Can't do for now: --show-reachable=yes
CLEANFILES += valgrind-log
valgrind_verbose = $(valgrind_verbose_$(V))
valgrind_verbose_ = $(valgrind_verbose_$(AM_DEFAULT_VERBOSITY))
valgrind_verbose_0 = | \
grep '\(^[^=]\|ERROR SUMMARY\|definitely lost\|indirectly lost\)' | grep -v ': 0'
check-valgrind:
$(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \
2>&1 | tee valgrind-log $(valgrind_verbose)
else
check-am:
@echo "You need to have glib support enabled to run the tests"
@exit 77
endif
.PHONY: test-symbols check-tool check-valgrind
-include $(top_srcdir)/git.mk