summaryrefslogtreecommitdiff
path: root/tests/Makefile.am
blob: 4043fb9743e9ca01004678a407bae7a0af1cb3f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
## Process this file with automake to create Makefile.in.

EXTRA_DIST = 			\
	boundaries.utf8		\
	GraphemeBreakTest.txt

CLEANFILES = pangorc
DISTCLEANFILES = all-unicode.txt

AM_CPPFLAGS =					\
	-DSRCDIR=\"$(srcdir)\"			\
	-I$(top_srcdir)				\
	$(PANGO_DEBUG_FLAGS)			\
	$(GLIB_CFLAGS)				\
	$(XFT_CFLAGS)				\
	$(CAIRO_CFLAGS)				\
	$(FREETYPE_CFLAGS)			\
	$(X_CFLAGS)

if HAVE_XFT
AM_CPPFLAGS += -DHAVE_X
endif
if HAVE_XFT
AM_CPPFLAGS += -DHAVE_XFT
endif
if HAVE_FREETYPE
AM_CPPFLAGS += -DHAVE_FREETYPE
endif
if HAVE_WIN32
AM_CPPFLAGS += -DHAVE_WIN32
endif


if CROSS_COMPILING
TESTS =
else
TESTS = $(check_PROGRAMS)
endif

TESTS_ENVIRONMENT =                    \
   srcdir=$(srcdir)                    \
   G_TEST_SRCDIR=$(abs_srcdir)         \
   G_TEST_BUILDDIR=$(abs_builddir)     \
   PANGO_RC_FILE=./pangorc

check_PROGRAMS = 			\
	testboundaries 			\
	testboundaries_ucd 		\
	testcolor 			\
	testscript 			\
	markup-parse 			\
	test-layout			\
	test-font			\
	testattributes			\
	$(NULL)

if HAVE_CAIRO
check_PROGRAMS += testiter test-pangocairo-threads
endif
if HAVE_FREETYPE
check_PROGRAMS += test-ot-tags
endif

TEST_PANGO_LIBS = ../pango/libpango-$(PANGO_API_VERSION).la
TEST_PANGOFT2_LIBS = $(TEST_PANGO_LIBS) ../pango/libpangoft2-$(PANGO_API_VERSION).la
TEST_PANGOCAIRO_LIBS = $(TEST_PANGO_LIBS) ../pango/libpangocairo-$(PANGO_API_VERSION).la

test_layout_SOURCES = \
	test-layout.c \
	test-common.c \
	test-common.h \
	$(NULL)

testattributes_SOURCES = \
	testattributes.c \
	test-common.c \
	test-common.h \
	$(NULL)

gen_all_unicode_LDADD = $(GLIB_LIBS)
testboundaries_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS)
testboundaries_ucd_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS)
testcolor_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS)
testiter_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS)
testscript_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS)
test_ot_tags_LDADD = $(TEST_PANGOFT2_LIBS) $(GLIB_LIBS)
test_pangocairo_threads_LDADD = $(TEST_PANGOCAIRO_LIBS) $(CAIRO_LIBS) $(GLIB_LIBS)
dump_boundaries_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS)
markup_parse_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS)
test_layout_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS)
test_font_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS)
testattributes_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS)

if HAVE_CXX
check_PROGRAMS += cxx-test
endif
cxx_test_SOURCES = cxx-test.C

all-unicode.txt: gen-all-unicode$(EXEEXT)
	./gen-all-unicode > all-unicode.txt

pangorc: $(srcdir)/../modules/pangorc
	cp $(srcdir)/../modules/pangorc $@

$(noinst_PROGRAMS) $(check_PROGRAMS): pangorc

noinst_PROGRAMS = $(check_PROGRAMS) gen-all-unicode dump-boundaries

markup_tests = \
	valid-1 valid-2 valid-3 valid-4 \
	fail-1 \
	$(NULL)

all_markup_data = \
	$(addprefix markups/,$(markup_tests:=.markup) $(markup_tests:=.expected))

layout_tests = \
	valid-1 valid-2 \
	$(NULL)

all_layout_data = \
	$(addprefix layouts/,$(layout_tests:=.markup) $(layout_tests:=.expected))
	

EXTRA_DIST += $(all_markup_data) $(all_layout_data)

if BUILDOPT_INSTALL_TESTS
insttestdir=$(libexecdir)/installed-tests/$(PACKAGE)
insttest_PROGRAMS = $(check_PROGRAMS)

testdatadir = $(insttestdir)
nobase_testdata_DATA = 		\
	all-unicode.txt 	\
	boundaries.utf8 	\
	GraphemeBreakTest.txt 	\
	$(all_markup_data)	\
	$(all_layout_data)

testmetadir = $(datadir)/installed-tests/$(PACKAGE)
testmeta_DATA = $(check_PROGRAMS:=.test)

%.test: %$(EXEEXT) Makefile
	$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
	 echo 'Type=session' >> $@.tmp; \
	 echo 'Exec=$(libexecdir)/installed-tests/$(PACKAGE)/$<' >> $@.tmp; \
	 mv $@.tmp $@)
endif

-include $(top_srcdir)/git.mk