Rework the build system for a new tests approach
[platform/upstream/glib.git] / glib / tests / Makefile.am
1 include $(top_srcdir)/glib.mk
2
3 LDADD = $(top_builddir)/glib/libglib-2.0.la -lm
4 AM_CPPFLAGS = -g $(glib_INCLUDES) $(GLIB_DEBUG_FLAGS)
5 DEFS = -DG_LOG_DOMAIN=\"GLib\" -DEXEEXT=\"$(EXEEXT)\"
6 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
7
8 # -----------------------------------------------------------------------------
9
10 dist_test_data = \
11         keyfiletest.ini                 \
12         pages.ini                       \
13         keyfile.c                       \
14         empty                           \
15         4096-random-bytes               \
16         $(NULL)
17
18 dist_test_extra_scripts = \
19         echo-script                     \
20         $(NULL)
21
22 test_extra_programs = \
23         test-spawn-echo                 \
24         $(NULL)
25
26 test_programs = \
27         array-test                      \
28         asyncqueue                      \
29         base64                          \
30         bitlock                         \
31         bookmarkfile                    \
32         bytes                           \
33         cache                           \
34         checksum                        \
35         collate                         \
36         cond                            \
37         convert                         \
38         dataset                         \
39         date                            \
40         dir                             \
41         environment                     \
42         error                           \
43         fileutils                       \
44         gdatetime                       \
45         gvariant                        \
46         hash                            \
47         hmac                            \
48         hook                            \
49         hostutils                       \
50         keyfile                         \
51         list                            \
52         logging                         \
53         mainloop                        \
54         mappedfile                      \
55         markup-parse                    \
56         markup-collect                  \
57         markup-escape                   \
58         markup-subparser                \
59         mem-overflow                    \
60         mutex                           \
61         node                            \
62         once                            \
63         option-context                  \
64         option-argv0                    \
65         pattern                         \
66         private                         \
67         protocol                        \
68         queue                           \
69         rand                            \
70         rec-mutex                       \
71         regex                           \
72         rwlock                          \
73         scannerapi                      \
74         sequence                        \
75         shell                           \
76         slice                           \
77         slist                           \
78         sort                            \
79         spawn-multithreaded             \
80         spawn-singlethread              \
81         strfuncs                        \
82         string                          \
83         testing                         \
84         test-printf                     \
85         thread                          \
86         timeout                         \
87         tree                            \
88         utf8-performance                \
89         utf8-pointer                    \
90         utf8-validate                   \
91         utf8-misc                       \
92         utils                           \
93         unicode                         \
94         uri                             \
95         1bit-mutex                      \
96         642026                          \
97         $(NULL)
98
99 uninstalled_test_programs = \
100         $(NULL)
101
102 dist_test_data += \
103         bookmarks/fail-01.xbel \
104         bookmarks/fail-02.xbel \
105         bookmarks/fail-03.xbel \
106         bookmarks/fail-04.xbel \
107         bookmarks/fail-05.xbel \
108         bookmarks/fail-06.xbel \
109         bookmarks/fail-07.xbel \
110         bookmarks/fail-08.xbel \
111         bookmarks/fail-09.xbel \
112         bookmarks/fail-10.xbel \
113         bookmarks/fail-11.xbel \
114         bookmarks/fail-12.xbel \
115         bookmarks/fail-13.xbel \
116         bookmarks/fail-14.xbel \
117         bookmarks/fail-15.xbel \
118         bookmarks/fail-16.xbel \
119         bookmarks/fail-17.xbel \
120         bookmarks/valid-01.xbel \
121         bookmarks/valid-02.xbel \
122         bookmarks/valid-03.xbel \
123         $(NULL)
124
125 markup_tests = \
126         fail-1 fail-2 fail-3 fail-4 fail-5 \
127         fail-6 fail-7 fail-8 fail-9 fail-10 \
128         fail-11 fail-12 fail-13 fail-14 fail-15 \
129         fail-16 fail-17 fail-18 fail-19 fail-20 \
130         fail-21 fail-22 fail-23 fail-24 fail-25 \
131         fail-26 fail-27 fail-28 fail-29 fail-30 \
132         fail-31 fail-32 fail-33 fail-34 fail-35 \
133         fail-36 fail-37 fail-38 fail-39 fail-40 \
134         fail-41 fail-42 fail-43 fail-44 fail-45 \
135         fail-46 fail-47 fail-48 fail-49 \
136         valid-1 valid-2 valid-3 valid-4 valid-5 \
137         valid-6 valid-7 valid-8 valid-9 valid-10 \
138         valid-11 valid-12 valid-13 valid-14 valid-15 \
139         $(NULL)
140
141 dist_test_data += $(all_markup_data)
142 all_markup_data = $(addprefix markups/,$(markup_tests:=.gmarkup) $(markup_tests:=.expected))
143
144 # -----------------------------------------------------------------------------
145
146 test_programs += atomic
147 atomic_CFLAGS  = $(AM_CFLAGS)
148 if HAVE_GCC
149 atomic_CFLAGS += -Wstrict-aliasing=2
150 endif
151
152 test_programs += 642026-ec
153 642026_ec_SOURCES = 642026.c
154 642026_ec_CFLAGS = -DG_ERRORCHECK_MUTEXES
155
156 uninstalled_test_programs += 1bit-emufutex
157 1bit_emufutex_SOURCES  = 1bit-mutex.c
158 1bit_emufutex_CFLAGS = $(AM_CFLAGS) -DTEST_EMULATED_FUTEX
159
160 uninstalled_test_programs += gwakeup
161 gwakeup_SOURCES = gwakeuptest.c ../../glib/gwakeup.c
162
163 # -----------------------------------------------------------------------------
164
165 if OS_UNIX
166 test_programs += \
167         unix                            \
168         include                         \
169         $(NULL)
170
171 # some testing of gtester functionality
172 XMLLINT = xmllint
173
174 gtester-xmllint-check: # check testreport xml with xmllint if present
175         ${GTESTER} -k --quiet -o tmpsample.xml --test-arg=--gtester-selftest ${GTESTER}
176         ${XMLLINT} --version 2>/dev/null; test "$$?" != 0 || ${XMLLINT} --noout tmpsample.xml
177
178 CLEANFILES += tmpsample.xml
179
180 check-am: gtester-xmllint-check
181
182 private_LDFLAGS = @G_THREAD_LIBS@
183 endif
184
185 # -----------------------------------------------------------------------------
186
187 if HAVE_EVENTFD
188 uninstalled_test_programs += gwakeup-fallback
189 gwakeup_fallback_SOURCES = gwakeuptest.c ../../glib/gwakeup.c
190 gwakeup_fallback_CFLAGS = $(AM_CFLAGS) -DTEST_EVENTFD_FALLBACK
191 endif
192
193 # -----------------------------------------------------------------------------
194
195 EXTRA_DIST += bookmarks.xbel