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