tests: Drop unnecessary % from .test pattern match rule
[platform/upstream/glib.git] / gio / tests / Makefile.am
1
2 NULL =
3 BUILT_SOURCES =
4
5 include $(top_srcdir)/Makefile.decl
6
7 insttestdir = $(pkglibexecdir)/installed-tests
8
9 SUBDIRS = gdbus-object-manager-example services
10
11 AM_CPPFLAGS =                           \
12         -DG_LOG_DOMAIN=\"GLib-GIO\"     \
13         $(gio_INCLUDES)                 \
14         $(GLIB_DEBUG_FLAGS)             \
15         -I$(top_builddir)/gio           \
16         -I$(top_srcdir)/gio             \
17         $(DBUS1_CFLAGS)                 \
18         -DSRCDIR=\""$(srcdir)"\"        \
19         -DTEST_SERVICES=\""$(abs_top_builddir)/gio/tests/services"\"
20
21 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
22
23 noinst_PROGRAMS = $(TEST_PROGS) $(SAMPLE_PROGS)
24 noinst_DATA = $(MISC_STUFF)
25
26 LDADD     =                                     \
27         $(top_builddir)/glib/libglib-2.0.la             \
28         $(top_builddir)/gthread/libgthread-2.0.la       \
29         $(top_builddir)/gobject/libgobject-2.0.la       \
30         $(top_builddir)/gmodule/libgmodule-2.0.la       \
31         $(top_builddir)/gio/libgio-2.0.la
32
33 test_progs =                    \
34         io-stream               \
35         memory-input-stream     \
36         memory-output-stream    \
37         readwrite               \
38         g-file                  \
39         g-file-info             \
40         converter-stream        \
41         data-input-stream       \
42         data-output-stream      \
43         g-icon                  \
44         buffered-input-stream   \
45         buffered-output-stream  \
46         sleepy-stream           \
47         filter-streams          \
48         volumemonitor           \
49         simple-async-result     \
50         srvtarget               \
51         contexts                \
52         gsettings               \
53         gschema-compile         \
54         async-close-output-stream \
55         gdbus-addresses         \
56         network-address         \
57         gdbus-message           \
58         socket                  \
59         pollable                \
60         tls-certificate         \
61         tls-interaction         \
62         cancellable             \
63         vfs                     \
64         network-monitor         \
65         fileattributematcher    \
66         resources               \
67         proxy-test              \
68         simple-proxy            \
69         inet-address            \
70         permission              \
71         task                    \
72         credentials             \
73         $(NULL)
74
75 if HAVE_DBUS_DAEMON
76 test_progs +=                   \
77         actions                 \
78         gdbus-connection        \
79         gdbus-connection-loss   \
80         gdbus-connection-slow   \
81         gdbus-names             \
82         gdbus-proxy             \
83         gdbus-proxy-threads     \
84         gdbus-proxy-well-known-name \
85         gdbus-introspection     \
86         gdbus-threading         \
87         gdbus-export            \
88         gdbus-error             \
89         gdbus-bz627724          \
90         gmenumodel              \
91         $(NULL)
92 endif
93
94 if OS_UNIX
95 test_progs +=                   \
96         gdbus-close-pending     \
97         gdbus-connection-flush  \
98         gdbus-peer              \
99         gdbus-exit-on-close     \
100         gdbus-non-socket        \
101         gdbus-peer-object-manager \
102         appinfo                 \
103         contenttype             \
104         mimeapps                \
105         file                    \
106         $(NULL)
107 endif
108
109 SAMPLE_PROGS =                          \
110         resolver                        \
111         socket-server                   \
112         socket-client                   \
113         echo-server                     \
114         httpd                           \
115         send-data                       \
116         filter-cat                      \
117         gdbus-example-export            \
118         gdbus-example-own-name          \
119         gdbus-example-watch-name        \
120         gdbus-example-watch-proxy       \
121         gdbus-example-server            \
122         gdbus-example-subtree           \
123         gdbus-example-peer              \
124         gdbus-example-proxy-subclass    \
125         proxy                           \
126         gapplication-example-open       \
127         gapplication-example-cmdline    \
128         gapplication-example-cmdline2   \
129         gapplication-example-cmdline3   \
130         gapplication-example-actions    \
131         gapplication-example-dbushooks  \
132         gdbus-daemon                    \
133         $(NULL)
134
135 other_progs =                           \
136         gdbus-testserver                \
137         gdbus-connection-flush-helper   \
138         $(NULL)
139 noinst_PROGRAMS += $(other_progs)
140
141 if OS_UNIX
142 test_progs +=                   \
143         live-g-file             \
144         desktop-app-info        \
145         unix-fd                 \
146         unix-streams            \
147         gapplication            \
148         basic-application       \
149         gdbus-test-codegen      \
150         socket-address          \
151         $(NULL)
152
153 other_progs +=                                  \
154         appinfo-test                            \
155         $(NULL)
156
157 SAMPLE_PROGS +=                                 \
158         gdbus-example-unix-fd-client            \
159         gdbus-example-objectmanager-server      \
160         gdbus-example-objectmanager-client      \
161         gdbus-test-fixture                      \
162         $(NULL)
163 endif
164
165 if OS_WIN32
166 TEST_PROGS += win32-streams
167 endif
168
169 if PLATFORM_WIN32
170 no_undefined = -no-undefined
171 endif
172
173 actions_SOURCES   = actions.c gdbus-sessionbus.c gdbus-sessionbus.h
174
175 unix_streams_LDADD       = $(LDADD) \
176         $(top_builddir)/gthread/libgthread-2.0.la
177
178 win32_streams_LDADD      = $(LDADD) \
179         $(top_builddir)/gthread/libgthread-2.0.la
180
181 resolver_LDADD            = $(LDADD) \
182         $(top_builddir)/gthread/libgthread-2.0.la
183
184 socket_server_LDADD       = $(LDADD) \
185         $(top_builddir)/gthread/libgthread-2.0.la
186
187 socket_client_SOURCES     = socket-client.c \
188                             gtlsconsoleinteraction.c \
189                             gtlsconsoleinteraction.h
190 socket_client_LDADD       = $(LDADD) \
191         $(top_builddir)/gthread/libgthread-2.0.la
192
193 echo_server_LDADD         = $(LDADD) \
194         $(top_builddir)/gthread/libgthread-2.0.la
195
196 httpd_LDADD               = $(LDADD) \
197         $(top_builddir)/gthread/libgthread-2.0.la
198
199 send_data_LDADD           = $(LDADD) \
200         $(top_builddir)/gthread/libgthread-2.0.la
201
202 contexts_LDADD            = $(LDADD) \
203         $(top_builddir)/gthread/libgthread-2.0.la
204
205 gdbus_daemon_SOURCES = gdbus-daemon.c $(top_srcdir)/gio/gdbusdaemon.c $(top_builddir)/gio/gdbus-daemon-generated.c
206
207 gdbus_testserver_SOURCES = gdbus-testserver.c
208
209 if HAVE_DBUS1
210 test_progs += gdbus-serialization
211 gdbus_serialization_SOURCES = gdbus-serialization.c gdbus-tests.h gdbus-tests.c
212 gdbus_serialization_CFLAGS = $(AM_CFLAGS) $(DBUS1_CFLAGS)
213 gdbus_serialization_LDADD = $(LDADD) $(DBUS1_LIBS)
214 endif
215
216 test_progs += gdbus-auth
217 gdbus_auth_SOURCES = gdbus-auth.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
218 gdbus_auth_LDADD = $(LDADD)
219
220 gdbus_bz627724_SOURCES = gdbus-bz627724.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
221
222 gdbus_close_pending_SOURCES = gdbus-close-pending.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
223
224 if OS_UNIX
225 gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
226         $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
227                 UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
228                 $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
229                 --interface-prefix org.project. \
230                 --generate-c-code gdbus-test-codegen-generated \
231                 --c-generate-object-manager \
232                 --c-namespace Foo_iGen \
233                 --generate-docbook gdbus-test-codegen-generated-doc \
234                 --annotate "org.project.Bar" Key1 Value1 \
235                 --annotate "org.project.Bar" org.gtk.GDBus.Internal Value2 \
236                 --annotate "org.project.Bar.HelloWorld()" Key3 Value3 \
237                 --annotate "org.project.Bar::TestSignal" Key4 Value4 \
238                 --annotate "org.project.Bar:ay" Key5 Value5 \
239                 --annotate "org.project.Bar.TestPrimitiveTypes()[val_int32]" Key6 Value6 \
240                 --annotate "org.project.Bar.TestPrimitiveTypes()[ret_uint32]" Key7 Value7 \
241                 --annotate "org.project.Bar::TestSignal[array_of_strings]" Key8 Value8 \
242                 $(srcdir)/test-codegen.xml \
243                 $(NULL)
244
245 BUILT_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
246
247 gdbus_test_codegen_SOURCES  = gdbus-test-codegen.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
248 gdbus_test_codegen_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
249
250 endif # OS_UNIX
251
252 gdbus_connection_SOURCES = gdbus-connection.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
253
254 gdbus_connection_flush_SOURCES = \
255         gdbus-connection-flush.c \
256         test-io-stream.c \
257         test-io-stream.h \
258         test-pipe-unix.c \
259         test-pipe-unix.h \
260         $(NULL)
261
262 gdbus_connection_loss_SOURCES = gdbus-connection-loss.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
263
264 gdbus_connection_slow_SOURCES = gdbus-connection-slow.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
265
266 gdbus_names_SOURCES = gdbus-names.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
267
268 gdbus_proxy_SOURCES = gdbus-proxy.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
269
270 gdbus_proxy_threads_SOURCES = gdbus-proxy-threads.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
271
272 gdbus_proxy_well_known_name_SOURCES = gdbus-proxy-well-known-name.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
273
274 gdbus_introspection_SOURCES = gdbus-introspection.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
275
276 gdbus_threading_SOURCES = gdbus-threading.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
277
278 gdbus_export_SOURCES = gdbus-export.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
279
280 gdbus_error_SOURCES = gdbus-error.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
281
282 gdbus_non_socket_SOURCES = \
283         gdbus-non-socket.c \
284         gdbus-tests.c \
285         gdbus-tests.h \
286         test-io-stream.c \
287         test-io-stream.h \
288         test-pipe-unix.c \
289         test-pipe-unix.h \
290         $(NULL)
291
292 gdbus_exit_on_close_SOURCES = gdbus-exit-on-close.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
293
294 resources_SOURCES = resources.c test_resources.c test_resources2.c test_resources2.h
295 resources_DEPENDENCIES = test.gresource
296
297 gapplication_SOURCES = gapplication.c gdbus-sessionbus.h gdbus-sessionbus.c gdbus-tests.h gdbus-tests.c
298
299 gmenumodel_SOURCES = gmenumodel.c gdbus-sessionbus.h gdbus-sessionbus.c
300
301 TEST_PROGS += $(test_progs)
302
303 TESTS_ENVIRONMENT = \
304         GLIB_MKENUMS=../../gobject/glib-mkenums \
305         GLIB_COMPILE_SCHEMAS=../glib-compile-schemas
306
307 schema_tests = \
308         array-default-not-in-choices.gschema.xml        \
309         bad-choice.gschema.xml                          \
310         bad-key.gschema.xml                             \
311         bad-key2.gschema.xml                            \
312         bad-key3.gschema.xml                            \
313         bad-key4.gschema.xml                            \
314         bad-type.gschema.xml                            \
315         bare-alias.gschema.xml                          \
316         choice-alias.gschema.xml                        \
317         choice-bad.gschema.xml                          \
318         choice-badtype.gschema.xml                      \
319         choice-invalid-alias.gschema.xml                \
320         choice-missing-value.gschema.xml                \
321         choice-shadowed-alias.gschema.xml               \
322         choice-upside-down.gschema.xml                  \
323         choice.gschema.xml                              \
324         choices-wrong-type.gschema.xml                  \
325         default-in-aliases.gschema.xml                  \
326         default-not-in-choices.gschema.xml              \
327         default-out-of-range.gschema.xml                \
328         empty-key.gschema.xml                           \
329         enum-with-aliases.gschema.xml                   \
330         enum-with-bad-default.gschema.xml               \
331         enum-with-chained-alias.gschema.xml             \
332         enum-with-choice.gschema.xml                    \
333         enum-with-invalid-alias.gschema.xml             \
334         enum-with-repeated-alias.gschema.xml            \
335         enum-with-repeated-nick.gschema.xml             \
336         enum-with-repeated-value.gschema.xml            \
337         enum-with-shadow-alias.gschema.xml              \
338         enum.gschema.xml                                \
339         flags-aliased-default.gschema.xml               \
340         flags-bad-default.gschema.xml                   \
341         flags-more-than-one-bit.gschema.xml             \
342         flags-with-enum-attr.gschema.xml                \
343         flags-with-enum-tag.gschema.xml                 \
344         extend-and-shadow-indirect.gschema.xml          \
345         extend-and-shadow.gschema.xml                   \
346         extend-missing.gschema.xml                      \
347         extend-nonlist.gschema.xml                      \
348         extend-self.gschema.xml                         \
349         extend-wrong-list-indirect.gschema.xml          \
350         extend-wrong-list.gschema.xml                   \
351         extending.gschema.xml                           \
352         from-docs.gschema.xml                           \
353         incomplete-list.gschema.xml                     \
354         inherit-gettext-domain.gschema.xml              \
355         invalid-path.gschema.xml                        \
356         key-in-list-indirect.gschema.xml                \
357         key-in-list.gschema.xml                         \
358         list-of-missing.gschema.xml                     \
359         missing-quotes.gschema.xml                              \
360         no-default.gschema.xml                          \
361         overflow.gschema.xml                            \
362         override-missing.gschema.xml                    \
363         override-range-error.gschema.xml                \
364         override-then-key.gschema.xml                   \
365         override-twice.gschema.xml                      \
366         override-type-error.gschema.xml                 \
367         override.gschema.xml                            \
368         range-badtype.gschema.xml                       \
369         range-default-high.gschema.xml                  \
370         range-default-low.gschema.xml                   \
371         range-high-default.gschema.xml                  \
372         range-low-default.gschema.xml                   \
373         range-missing-max.gschema.xml                   \
374         range-missing-min.gschema.xml                   \
375         range-parse-error.gschema.xml                   \
376         range-wrong-type.gschema.xml                    \
377         range.gschema.xml                               \
378         wrong-category.gschema.xml                      \
379         $(NULL)
380
381 schema_test_files = $(addprefix schema-tests/,$(schema_tests))
382
383 proxy_LDADD   = $(LDADD) \
384         $(top_builddir)/gthread/libgthread-2.0.la
385
386 tls_certificate_SOURCES = tls-certificate.c gtesttlsbackend.c gtesttlsbackend.h
387
388 cert_tests =                    \
389         cert1.pem               \
390         cert2.pem               \
391         cert3.pem               \
392         cert-key.pem            \
393         cert-list.pem           \
394         key8.pem                \
395         key-cert.pem            \
396         key.pem                 \
397         nothing.pem             \
398         $(NULL)
399
400 cert_test_files = $(addprefix cert-tests/,$(cert_tests))
401
402 # -----------------------------------------------------------------------------
403
404 if OS_UNIX
405 gdbus_example_objectmanager_server_CFLAGS   = $(AM_CFLAGS) -I$(top_builddir)/gio/tests/gdbus-object-manager-example
406 gdbus_example_objectmanager_server_LDADD    = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
407
408 gdbus_example_objectmanager_client_CFLAGS   = $(AM_CFLAGS) -I$(top_builddir)/gio/tests/gdbus-object-manager-example
409 gdbus_example_objectmanager_client_LDADD    = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
410
411 gdbus_peer_SOURCES = gdbus-peer.c gdbus-tests.h gdbus-tests.c
412 gdbus_peer_CFLAGS  = $(AM_CFLAGS) -I$(top_builddir)/gio/tests/gdbus-object-manager-example
413 gdbus_peer_LDADD   = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
414
415 gdbus_test_fixture_SOURCES = gdbus-test-fixture.c
416 gdbus_test_fixture_CFLAGS  = $(AM_CFLAGS) -I$(top_builddir)/gio/tests/gdbus-object-manager-example
417 gdbus_test_fixture_LDADD   = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
418
419 endif OS_UNIX
420
421 # -----------------------------------------------------------------------------
422
423 desktop_test_files = \
424         appinfo-test.desktop                    \
425         appinfo-test2.desktop                   \
426         appinfo-test-gnome.desktop              \
427         appinfo-test-notgnome.desktop           \
428         $(NULL)
429
430 EXTRA_DIST += \
431         socket-common.c                 \
432         org.gtk.test.gschema            \
433         org.gtk.test.gschema.xml        \
434         de.po                           \
435         $(schema_test_files)            \
436         test-codegen.xml                \
437         $(cert_test_files)              \
438         test.gresource.xml              \
439         test1.txt                       \
440         test2.gresource.xml             \
441         test2.txt                       \
442         test3.gresource.xml             \
443         test3.txt                       \
444         test4.gresource.xml             \
445         $(desktop_test_files)           \
446         $(NULL)
447
448 MISC_STUFF = test.mo test.gresource
449
450 test.mo: de.po
451         $(MSGFMT) -o test.mo $(srcdir)/de.po; \
452         $(MKDIR_P) de/LC_MESSAGES; \
453         cp -f test.mo de/LC_MESSAGES
454
455 if CROSS_COMPILING
456   glib_compile_resources=$(GLIB_COMPILE_RESOURCES)
457 else
458   glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
459 endif
460
461 BUILT_SOURCES += test_resources.c test_resources2.c test_resources2.h
462 test_resources.c: test2.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test2.gresource.xml)
463         $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_test1 $<
464
465 test_resources2.h test_resources2.c: test3.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test3.gresource.xml)
466         $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate --c-name _g_test2 --manual-register $<
467
468 plugin_resources.c: test4.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test4.gresource.xml)
469         $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_plugin $<
470
471 test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test.gresource.xml)
472         $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) $<
473
474 if BUILDOPT_INSTALL_TESTS
475 insttest_LTLIBRARIES = libresourceplugin.la
476 else
477 noinst_LTLIBRARIES = libresourceplugin.la
478 endif
479
480 libresourceplugin_la_SOURCES = resourceplugin.c plugin_resources.c
481 libresourceplugin_la_LDFLAGS = -avoid-version -module $(no_undefined) -rpath $(insttestdir)
482 libresourceplugin_la_LIBADD = $(LDADD)
483
484 CLEANFILES = gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml test_resources2.[ch] plugin_resources.c
485
486 DISTCLEANFILES = \
487         applications/mimeinfo.cache     \
488         org.gtk.test.enums.xml          \
489         de/LC_MESSAGES/test.mo          \
490         test.mo                         \
491         test.gresource                  \
492         test_resources.c                \
493         gsettings.store                 \
494         gschemas.compiled               \
495         schema-source/gschemas.compiled
496
497 distclean-local:
498         rm -rf xdgdatahome xdgdatadir
499
500 test_files =                                    \
501         contexts.c                              \
502         g-icon.c                                \
503         file.c                                  \
504         enums.xml.template                      \
505         testenum.h                              \
506         org.gtk.test.gschema.xml                \
507         org.gtk.schemasourcecheck.gschema.xml   \
508         test.gresource                          \
509         $(NULL)
510 EXTRA_DIST += $(test_files)
511
512 if BUILDOPT_INSTALL_TESTS
513 insttest_PROGRAMS = $(test_progs) $(other_progs)
514
515 schematestdir = $(insttestdir)/schema-tests
516 schematest_DATA = $(schema_test_files)
517
518 certtestdir = $(insttestdir)/cert-tests
519 certtest_DATA = $(cert_test_files)
520
521 testdatadir = $(insttestdir)
522 testdata_DATA = $(test_files)
523
524 testmetadir = $(datadir)/installed-tests/$(PACKAGE)
525 xfail_tests = desktop-app-info.test
526 developer_only_tests = gsettings.test
527 testmeta_DATA = $(filter-out $(xfail_tests) $(developer_only_tests),$(test_progs:=.test))
528
529 %.test: Makefile
530         $(AM_V_GEN) (echo '[Test]' > $@.tmp; \
531          echo 'Type=session' >> $@.tmp; \
532          echo 'Exec=env G_TEST_DATA=$(pkglibexecdir)/installed-tests $(pkglibexecdir)/installed-tests/$<' >> $@.tmp; \
533          mv $@.tmp $@)
534
535 %.desktop.insttest: %.desktop
536         sed -e s,Exec=./appinfo-test,Exec=$(insttestdir)/appinfo-test, < $< >$@.tmp && mv $@.tmp $@
537
538 installed_desktop_test_files = $(desktop_test_files:.desktop=.desktop.insttest)
539 install-data-local: $(installed_desktop_test_files)
540         for x in $(desktop_test_files); do \
541           install -m 0644 $${x}.insttest $(DESTDIR)$(testdatadir)/$$x; \
542         done
543         install -d -m 0755 $(DESTDIR)$(testdatadir)/schema-tests
544
545 endif