2011-05-27 06:44:29 +00:00
|
|
|
# Process this file with automake to produce Makefile.in
|
2011-04-11 16:46:49 +00:00
|
|
|
|
2011-04-13 05:09:09 +00:00
|
|
|
NULL =
|
2011-05-27 06:44:29 +00:00
|
|
|
EXTRA_DIST =
|
2011-05-27 05:33:18 +00:00
|
|
|
CLEANFILES =
|
|
|
|
DISTCLEANFILES =
|
|
|
|
MAINTAINERCLEANFILES =
|
2011-04-13 05:09:09 +00:00
|
|
|
|
2011-04-11 16:46:49 +00:00
|
|
|
if HAVE_GLIB
|
2011-08-04 05:42:59 +00:00
|
|
|
AM_CPPFLAGS = -DSRCDIR="\"$(srcdir)\"" -I$(top_srcdir)/src/ -I$(top_builddir)/src/ $(GLIB_CFLAGS) $(GTHREAD_CFLAGS)
|
2011-05-10 23:11:27 +00:00
|
|
|
LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS) $(GTHREAD_LIBS)
|
2011-04-11 16:46:49 +00:00
|
|
|
|
2011-05-06 01:31:04 +00:00
|
|
|
EXTRA_DIST += hb-test.h
|
|
|
|
|
2011-04-11 16:46:49 +00:00
|
|
|
check_PROGRAMS = $(TEST_PROGS)
|
2011-04-28 21:10:44 +00:00
|
|
|
noinst_PROGRAMS = $(TEST_PROGS)
|
2011-04-11 16:46:49 +00:00
|
|
|
|
2011-05-27 06:44:29 +00:00
|
|
|
TEST_PROGS = \
|
2011-05-10 21:37:08 +00:00
|
|
|
test-blob \
|
2011-04-13 05:09:09 +00:00
|
|
|
test-buffer \
|
2011-04-20 06:56:39 +00:00
|
|
|
test-common \
|
2011-05-12 02:52:35 +00:00
|
|
|
test-font \
|
2011-05-12 05:39:17 +00:00
|
|
|
test-shape \
|
2011-04-20 04:19:20 +00:00
|
|
|
test-unicode \
|
2011-05-27 05:00:55 +00:00
|
|
|
test-version \
|
2011-04-13 05:09:09 +00:00
|
|
|
$(NULL)
|
|
|
|
|
2011-05-14 02:46:36 +00:00
|
|
|
TEST_PROGS += \
|
|
|
|
test-ot-tag \
|
|
|
|
$(NULL)
|
2011-04-11 16:46:49 +00:00
|
|
|
|
2011-04-20 07:15:31 +00:00
|
|
|
# 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)
|
2011-08-02 17:44:24 +00:00
|
|
|
|
2011-05-02 23:52:47 +00:00
|
|
|
# TODO replace freetype with other stuff in the following test
|
2011-08-02 17:44:24 +00:00
|
|
|
TEST_PROGS += test-object
|
2011-05-02 23:52:47 +00:00
|
|
|
test_object_CPPFLAGS = $(AM_CPPFLAGS) $(FREETYPE_CFLAGS)
|
2011-06-28 16:49:18 +00:00
|
|
|
test_object_LDADD = $(LDADD) $(FREETYPE_LIBS)
|
|
|
|
|
2011-08-02 17:44:24 +00:00
|
|
|
TEST_PROGS += test-shape-complex
|
2011-06-28 16:49:18 +00:00
|
|
|
test_shape_complex_CPPFLAGS = $(AM_CPPFLAGS) $(FREETYPE_CFLAGS)
|
|
|
|
test_shape_complex_LDADD = $(LDADD) $(FREETYPE_LIBS)
|
2011-04-20 07:15:31 +00:00
|
|
|
endif
|
|
|
|
|
2011-04-11 16:46:49 +00:00
|
|
|
|
2011-05-27 07:38:30 +00:00
|
|
|
# Default test running environment
|
2011-05-27 06:44:29 +00:00
|
|
|
TESTS = $(TEST_PROGS)
|
|
|
|
TESTS_ENVIRONMENT = \
|
|
|
|
MALLOC_CHECK_=2 \
|
|
|
|
MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) \
|
|
|
|
G_DEBUG=gc-friendly \
|
|
|
|
G_SLICE=always-malloc \
|
2011-06-28 16:49:18 +00:00
|
|
|
srcdir=$(srcdir) \
|
2011-05-27 06:44:29 +00:00
|
|
|
$(ENV)
|
|
|
|
|
2011-05-27 07:38:30 +00:00
|
|
|
|
2011-05-27 06:44:29 +00:00
|
|
|
# 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:
|
2011-06-28 20:59:16 +00:00
|
|
|
$(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose --keep-going"
|
2011-05-27 06:44:29 +00:00
|
|
|
|
2011-05-27 07:38:30 +00:00
|
|
|
|
2011-05-27 07:58:17 +00:00
|
|
|
# Check tests under valgrind. Saves log to log-valgrind.txt
|
2011-05-27 06:44:29 +00:00
|
|
|
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
|
2011-05-27 07:58:17 +00:00
|
|
|
CLEANFILES += log-valgrind.txt
|
2011-05-27 06:44:29 +00:00
|
|
|
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'
|
2011-05-27 06:46:28 +00:00
|
|
|
# TODO: The following check does not fail if valgrind finds error. It should.
|
2011-05-27 06:44:29 +00:00
|
|
|
check-valgrind:
|
|
|
|
$(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \
|
2011-05-27 07:58:17 +00:00
|
|
|
2>&1 | tee log-valgrind.txt $(valgrind_verbose)
|
2011-05-27 06:44:29 +00:00
|
|
|
|
2011-05-27 05:33:18 +00:00
|
|
|
|
2011-05-27 07:38:30 +00:00
|
|
|
# check-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
|
|
|
|
check-symbols: symbols-untested.txt
|
|
|
|
@! cat $^ | grep .
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-11 16:46:49 +00:00
|
|
|
else
|
2011-08-02 16:05:49 +00:00
|
|
|
check-am: err-glib
|
|
|
|
err-glib:
|
2011-04-11 16:46:49 +00:00
|
|
|
@echo "You need to have glib support enabled to run the tests"
|
|
|
|
@exit 77
|
|
|
|
endif
|
|
|
|
|
2011-05-27 07:38:30 +00:00
|
|
|
.PHONY: check-symbols check-tool check-valgrind
|
2011-05-27 05:33:18 +00:00
|
|
|
|
2011-04-11 16:46:49 +00:00
|
|
|
-include $(top_srcdir)/git.mk
|