[test] Add test-symbols that checks API symbol text coverage
[profile/ivi/org.tizen.video-player.git] / test / Makefile.am
1 include Makefile.decl
2
3 NULL =
4 CLEANFILES =
5 DISTCLEANFILES =
6 MAINTAINERCLEANFILES =
7
8 if HAVE_GLIB
9 AM_CPPFLAGS = -I$(top_srcdir)/src/ $(GLIB_CFLAGS) $(GTHREAD_CFLAGS)
10 LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS) $(GTHREAD_LIBS)
11
12 EXTRA_DIST += hb-test.h
13
14 check_PROGRAMS = $(TEST_PROGS)
15 noinst_PROGRAMS = $(TEST_PROGS)
16
17 TEST_PROGS += \
18         test-blob \
19         test-buffer \
20         test-common \
21         test-font \
22         test-object \
23         test-shape \
24         test-unicode \
25         test-version \
26         $(NULL)
27
28 TEST_PROGS += \
29         test-ot-tag \
30         $(NULL)
31
32 # Tests for header compilation
33 TEST_PROGS += \
34         test-c \
35         test-cplusplus \
36         $(NULL)
37 test_cplusplus_SOURCES = test-cplusplus.cc
38 test_c_CPPFLAGS = $(AM_CPPFLAGS)
39 test_cplusplus_CPPFLAGS = $(AM_CPPFLAGS)
40 if HAVE_ICU
41 test_c_CPPFLAGS += $(ICU_CFLAGS)
42 test_cplusplus_CPPFLAGS += $(ICU_CFLAGS)
43 endif
44 if HAVE_FREETYPE
45 test_c_CPPFLAGS += $(FREETYPE_CFLAGS)
46 test_cplusplus_CPPFLAGS += $(FREETYPE_CFLAGS)
47 # TODO replace freetype with other stuff in the following test
48 test_object_CPPFLAGS = $(AM_CPPFLAGS) $(FREETYPE_CFLAGS)
49 test_object_LIBS = $(LDADD) $(FREETYPE_LIBS)
50 endif
51
52
53 # test-symbols: Finds untested API symbols
54 symbols-tested.txt: $(TEST_PROGS)
55         $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
56         | grep ' U hb_' | sed 's/.* U hb_/hb_/' \
57         | sort | uniq > $@.tmp && mv $@.tmp $@
58 symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so
59         $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
60         | grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \
61         | sort | uniq > $@.tmp && mv $@.tmp $@
62 symbols-untested.txt: symbols-tested.txt symbols-exported.txt
63         $(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@
64 CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt
65 test-symbols: symbols-untested.txt
66         @! cat $^ | grep .
67
68
69 else
70 check-am:
71         @echo "You need to have glib support enabled to run the tests"
72         @exit 77
73 endif
74
75 .PHONY: test-symbols
76
77 -include $(top_srcdir)/git.mk