Imported Upstream version 2.61.0
[platform/upstream/glib.git] / gio / tests / meson.build
1 common_gio_tests_deps = [
2   libglib_dep,
3   libgmodule_dep,
4   libgobject_dep,
5   libgio_dep,
6 ]
7
8 test_c_args = [
9   '-DG_LOG_DOMAIN="GLib-GIO"',
10   '-DTEST_SERVICES="@0@/gio/tests/services"'.format(meson.build_root()),
11   '-DGLIB_MKENUMS="@0@"'.format(glib_mkenums),
12   '-DGLIB_COMPILE_SCHEMAS="@0@"'.format(glib_compile_schemas.full_path()),
13   '-UG_DISABLE_ASSERT',
14 ]
15
16 if host_machine.system() == 'windows'
17   common_gio_tests_deps += [iphlpapi_dep, winsock2, cc.find_library ('secur32')]
18 endif
19
20 subdir('gdbus-object-manager-example')
21
22 gengiotypefuncs_prog = find_program('gengiotypefuncs.py')
23 giotypefuncs_inc = custom_target(
24   'giotypefuncs.inc',
25   output : 'giotypefuncs.inc',
26   input : gio_headers + [gioenumtypes_h] + gobject_install_headers,
27   command: [gengiotypefuncs_prog, '@OUTPUT@', '@INPUT@'])
28
29 #  Test programs buildable on all platforms
30 gio_tests = {
31   'appmonitor' : {},
32   'async-close-output-stream' : {},
33   'async-splice-output-stream' : {},
34   'buffered-input-stream' : {},
35   'buffered-output-stream' : {},
36   'cancellable' : {},
37   'contexts' : {},
38   'contenttype' : {},
39   'converter-stream' : {},
40   'credentials' : {},
41   'data-input-stream' : {},
42   'data-output-stream' : {},
43   'defaultvalue' : {'extra_sources' : [giotypefuncs_inc]},
44   'fileattributematcher' : {},
45   'filter-streams' : {},
46   'giomodule' : {},
47   'gsubprocess' : {},
48   'g-file' : {},
49   'g-file-info' : {},
50   'g-icon' : {},
51   'gdbus-addresses' : {},
52   'gdbus-message' : {},
53   'inet-address' : {},
54   'io-stream' : {},
55   'memory-input-stream' : {},
56   'memory-output-stream' : {},
57   'monitor' : {},
58   'mount-operation' : {},
59   'network-address' : {'extra_sources': ['mock-resolver.c']},
60   'network-monitor' : {},
61   'network-monitor-race' : {},
62   'permission' : {},
63   'pollable' : {},
64   'proxy-test' : {},
65   'readwrite' : {},
66   'simple-async-result' : {},
67   'simple-proxy' : {},
68   'sleepy-stream' : {},
69   'socket' : {},
70   'socket-listener' : {},
71   'socket-service' : {},
72   'srvtarget' : {},
73   'task' : {},
74   'vfs' : {},
75   'volumemonitor' : {},
76   'glistmodel' : {},
77   'testfilemonitor' : {'suite' : ['slow', 'flaky']},
78   'thumbnail-verification' : {},
79   'tls-certificate' : {'extra_sources' : ['gtesttlsbackend.c']},
80   'tls-interaction' : {'extra_sources' : ['gtesttlsbackend.c']},
81   'tls-database' : {'extra_sources' : ['gtesttlsbackend.c']},
82   'gdbus-address-get-session' : {},
83 }
84
85 test_extra_programs = {
86   'gdbus-connection-flush-helper' : {},
87   'gdbus-testserver' : {},
88   'gsubprocess-testprog' : {},
89 }
90
91 test_env = environment()
92 test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
93 test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
94 test_env.set('GIO_MODULE_DIR', '')
95 test_env.set('GIO_LAUNCH_DESKTOP', meson.build_root() + '/gio/gio-launch-desktop')
96
97 # Check for libdbus1 - Optional - is only used in the GDBus test cases
98 # 1.2.14 required for dbus_message_set_serial
99 dbus1_dep = dependency('dbus-1', required : false, version : '>= 1.2.14')
100 if not dbus1_dep.found()
101   if cc.get_id() == 'msvc'
102     # MSVC: Search for the DBus library by the configuration, which corresponds
103     # to the output of CMake builds of DBus.  Note that debugoptimized
104     # is really a Release build with .PDB files.
105     if buildtype == 'debug'
106       dbus1_dep = cc.find_library('dbus-1d', required : false)
107     else
108       dbus1_dep = cc.find_library('dbus-1', required : false)
109     endif
110   endif
111 endif
112 if dbus1_dep.found()
113   glib_conf.set('HAVE_DBUS1', 1)
114
115   gio_tests += {
116     'gdbus-serialization' : {
117       'extra_sources' : ['gdbus-tests.c'],
118       'dependencies' : [dbus1_dep],
119     }
120   }
121 endif
122
123 #  Test programs buildable on UNIX only
124 if host_machine.system() != 'windows'
125   gio_tests += {
126     'file' : {},
127     'gdbus-peer' : {
128       'dependencies' : [libgdbus_example_objectmanager_dep],
129       'install_rpath' : installed_tests_execdir
130     },
131     'gdbus-peer-object-manager' : {},
132     'live-g-file' : {},
133     'socket-address' : {},
134     'stream-rw_all' : {},
135     'unix-fd' : {},
136     'unix-mounts' : {},
137     'unix-streams' : {},
138     'g-file-info-filesystem-readonly' : {},
139     'gschema-compile' : {'install' : false},
140     'trash' : {},
141   }
142
143   if have_rtld_next
144     gio_tests += {
145       'gsocketclient-slow' : {
146         'depends' : [
147           shared_library('slow-connect-preload',
148             'slow-connect-preload.c',
149             name_prefix : '',
150             dependencies: cc.find_library('dl'),
151             install_dir : installed_tests_execdir,
152             install: installed_tests_enabled,
153           )
154         ],
155         'env' : {
156           'LD_PRELOAD': '@0@/slow-connect-preload.so'.format(meson.current_build_dir())
157         },
158         'installed_tests_env' : {
159           'LD_PRELOAD': '@0@/slow-connect-preload.so'.format(installed_tests_execdir),
160         },
161       },
162     }
163   endif
164
165   # Uninstalled because of the check-for-executable logic in DesktopAppInfo
166   # unable to find the installed executable
167   if not glib_have_cocoa
168     gio_tests += {
169       'appinfo' : {
170         'install' : false,
171       },
172       'desktop-app-info' : {
173         'install' : false,
174       },
175     }
176   endif
177
178   test_extra_programs += {
179     'basic-application' : {},
180     'dbus-launch' : {},
181     'appinfo-test' : {},
182   }
183
184   if not glib_have_cocoa
185     test_extra_programs += {
186       'apps' : {},
187     }
188     gio_tests += {
189       'mimeapps' : {},
190     }
191   endif
192
193   #  Test programs that need to bring up a session bus (requires dbus-daemon)
194   have_dbus_daemon = find_program('dbus-daemon', required : false).found()
195   if have_dbus_daemon
196     annotate_args = [
197       '--annotate', 'org.project.Bar', 'Key1', 'Value1',
198       '--annotate', 'org.project.Bar', 'org.gtk.GDBus.Internal', 'Value2',
199       '--annotate', 'org.project.Bar.HelloWorld()', 'Key3', 'Value3',
200       '--annotate', 'org.project.Bar::TestSignal', 'Key4', 'Value4',
201       '--annotate', 'org.project.Bar:ay', 'Key5', 'Value5',
202       '--annotate', 'org.project.Bar.TestPrimitiveTypes()[val_int32]', 'Key6', 'Value6',
203       '--annotate', 'org.project.Bar.TestPrimitiveTypes()[ret_uint32]', 'Key7', 'Value7',
204       '--annotate', 'org.project.Bar::TestSignal[array_of_strings]', 'Key8', 'Value8',
205     ]
206     # Generate gdbus-test-codegen-generated.{c,h}
207     gdbus_test_codegen_generated = custom_target('gdbus-test-codegen-generated',
208         input :   ['test-codegen.xml'],
209         output :  ['gdbus-test-codegen-generated.h',
210                    'gdbus-test-codegen-generated.c'],
211         depend_files : gdbus_codegen_built_files,
212         command : [python, gdbus_codegen,
213                    '--interface-prefix', 'org.project.',
214                    '--output-directory', '@OUTDIR@',
215                    '--generate-c-code', 'gdbus-test-codegen-generated',
216                    '--c-generate-object-manager',
217                    '--c-generate-autocleanup', 'all',
218                    '--c-namespace', 'Foo_iGen',
219                    '--generate-docbook', 'gdbus-test-codegen-generated-doc',
220                    annotate_args,
221                    '@INPUT@'])
222
223     gdbus_test_codegen_generated_interface_info = [
224       custom_target('gdbus-test-codegen-generated-interface-info-h',
225           input :   ['test-codegen.xml'],
226           output :  ['gdbus-test-codegen-generated-interface-info.h'],
227           depend_files : gdbus_codegen_built_files,
228           command : [python, gdbus_codegen,
229                      '--interface-info-header',
230                      annotate_args,
231                      '--output', '@OUTPUT@',
232                      '@INPUT@']),
233       custom_target('gdbus-test-codegen-generated-interface-info-c',
234           input :   ['test-codegen.xml'],
235           output :  ['gdbus-test-codegen-generated-interface-info.c'],
236           depend_files : gdbus_codegen_built_files,
237           command : [python, gdbus_codegen,
238                      '--interface-info-body',
239                      annotate_args,
240                      '--output', '@OUTPUT@',
241                      '@INPUT@']),
242     ]
243
244     extra_sources = ['gdbus-sessionbus.c', 'gdbus-tests.c']
245
246     gio_tests += {
247       'actions' : {
248         'extra_sources' : extra_sources,
249         'suite' : ['slow'],
250       },
251       'gdbus-auth' : {'extra_sources' : extra_sources},
252       'gdbus-bz627724' : {'extra_sources' : extra_sources},
253       'gdbus-close-pending' : {'extra_sources' : extra_sources},
254       'gdbus-connection' : {'extra_sources' : extra_sources},
255       'gdbus-connection-loss' : {'extra_sources' : extra_sources},
256       'gdbus-connection-slow' : {'extra_sources' : extra_sources},
257       'gdbus-error' : {'extra_sources' : extra_sources},
258       'gdbus-exit-on-close' : {'extra_sources' : extra_sources},
259       'gdbus-export' : {
260         'extra_sources' : extra_sources,
261         'suite' : ['slow'],
262       },
263       'gdbus-introspection' : {'extra_sources' : extra_sources},
264       'gdbus-names' : {'extra_sources' : extra_sources},
265       'gdbus-proxy' : {'extra_sources' : extra_sources},
266       'gdbus-proxy-threads' : {
267         'extra_sources' : extra_sources,
268         'dependencies' : [dbus1_dep],
269       },
270       'gdbus-proxy-unique-name' : {'extra_sources' : extra_sources},
271       'gdbus-proxy-well-known-name' : {'extra_sources' : extra_sources},
272       'gdbus-test-codegen' : {
273         'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
274       },
275       'gdbus-threading' : {
276         'extra_sources' : extra_sources,
277         'suite' : ['slow', 'flaky'],
278       },
279       'gmenumodel' : {
280         'extra_sources' : extra_sources,
281         'suite' : ['slow'],
282       },
283       'gnotification' : {
284         'extra_sources' : [extra_sources, 'gnotification-server.c'],
285       },
286       'gdbus-test-codegen-old' : {
287         'source' : 'gdbus-test-codegen.c',
288         'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
289         'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36',
290                     '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36'],
291       },
292       'gapplication' : {'extra_sources' : extra_sources},
293     }
294
295     if not glib_have_cocoa
296       gio_tests += {
297         'dbus-appinfo' : {
298           'extra_sources' : extra_sources,
299         },
300       }
301     endif
302   endif # have_dbus_daemon
303
304   # This test is currently unreliable
305   executable('gdbus-overflow', 'gdbus-overflow.c',
306       c_args : test_c_args,
307       dependencies : common_gio_tests_deps,
308       install_dir : installed_tests_execdir,
309       install : installed_tests_enabled)
310
311   gio_tests += {
312     'gdbus-connection-flush' : {
313       'extra_sources' : ['test-io-stream.c', 'test-pipe-unix.c'],
314     },
315     'gdbus-non-socket' : {
316       'extra_sources' : ['gdbus-tests.c', 'test-io-stream.c', 'test-pipe-unix.c'],
317     },
318   }
319
320   # Generate test.mo from de.po using msgfmt
321   msgfmt = find_program('msgfmt', required : false)
322   if msgfmt.found()
323     subdir('de/LC_MESSAGES')
324     gio_tests += {
325       'gsettings' : {
326         'extra_sources' : [test_mo],
327         'c_args' : ['-DSRCDIR="@0@"'.format(meson.current_source_dir()),
328                     '-DTEST_LOCALE_PATH="@0@"'.format(test_mo_dir)],
329         'install' : false,
330       },
331     }
332   endif
333 endif # unix
334
335 #  Test programs buildable on Windows only
336 if host_machine.system() == 'windows'
337   gio_tests += {'win32-streams' : {}}
338 endif
339
340 if cc.get_id() != 'msvc'
341   gio_tests += {
342     'autoptr-gio' : {
343       'source' : 'autoptr.c',
344     },
345   }
346 endif
347
348 test_extra_programs += {
349   'gio-du' : {'install' : false},
350   'echo-server' : {'install' : false},
351   'filter-cat' : {'install' : false},
352   'gapplication-example-actions' : {'install' : false},
353   'gapplication-example-cmdline' : {'install' : false},
354   'gapplication-example-cmdline2' : {'install' : false},
355   'gapplication-example-cmdline3' : {'install' : false},
356   'gapplication-example-cmdline4' : {'install' : false},
357   'gapplication-example-dbushooks' : {'install' : false},
358   'gapplication-example-open' : {'install' : false},
359   'gdbus-daemon' : {
360     'extra_sources' : gdbus_daemon_sources,
361     'install' : false,
362   },
363   'gdbus-example-export' : {'install' : false},
364   'gdbus-example-own-name' : {'install' : false},
365   'gdbus-example-peer' : {'install' : false},
366   'gdbus-example-proxy-subclass' : {'install' : false},
367   'gdbus-example-server' : {'install' : false},
368   'gdbus-example-subtree' : {'install' : false},
369   'gdbus-example-watch-name' : {'install' : false},
370   'gdbus-example-watch-proxy' : {'install' : false},
371   'httpd' : {'install' : false},
372   'proxy' : {'install' : false},
373   'resolver' : {'install' : false},
374   'send-data' : {'install' : false},
375   'socket-server' : {'install' : false},
376   'socket-client' : {
377     'extra_sources' : ['gtlsconsoleinteraction.c'],
378     'install' : false,
379   },
380 }
381
382 if cc.get_id() != 'msvc'
383   test_extra_programs += {
384     # These three are manual-run tests because they need a session bus but don't bring one up themselves
385     # FIXME: these build but don't seem to work!
386     'gdbus-example-objectmanager-client' : {
387       'dependencies' : [libgdbus_example_objectmanager_dep],
388       'install' : false,
389     },
390     'gdbus-example-objectmanager-server' : {
391       'dependencies' : [libgdbus_example_objectmanager_dep],
392       'install' : false,
393     },
394     'gdbus-test-fixture' : {
395       'dependencies' : [libgdbus_example_objectmanager_dep],
396       'install' : false,
397     },
398   }
399 endif
400
401 if host_machine.system() != 'windows'
402   test_extra_programs += {
403     'gdbus-example-unix-fd-client' : {
404       'install' : false,
405     },
406   }
407 endif
408
409 appinfo_test_desktop_files = [
410   'appinfo-test-gnome.desktop',
411   'appinfo-test-notgnome.desktop',
412   'appinfo-test.desktop',
413   'appinfo-test2.desktop',
414 ]
415
416 cdata = configuration_data()
417 if installed_tests_enabled
418   cdata.set('installed_tests_dir', installed_tests_execdir)
419 else
420   cdata.set('installed_tests_dir', meson.current_build_dir())
421 endif
422
423 foreach appinfo_test_desktop_file : appinfo_test_desktop_files
424   configure_file(
425     input: appinfo_test_desktop_file + '.in',
426     output: appinfo_test_desktop_file,
427     install_dir: installed_tests_execdir,
428     install: installed_tests_enabled,
429     configuration: cdata,
430   )
431 endforeach
432
433 if installed_tests_enabled
434   install_data(
435     'contexts.c',
436     'g-icon.c',
437     'appinfo-test-actions.desktop',
438     'appinfo-test-static.desktop',
439     'file.c',
440     'org.gtk.test.dbusappinfo.desktop',
441     'test1.overlay',
442     install_dir : installed_tests_execdir,
443   )
444   install_subdir('x-content', install_dir : installed_tests_execdir)
445   install_subdir('desktop-files', install_dir : installed_tests_execdir)
446   install_subdir('thumbnails', install_dir : installed_tests_execdir)
447   install_subdir('cert-tests', install_dir : installed_tests_execdir)
448
449   cdata = configuration_data()
450   cdata.set('installed_tests_dir', installed_tests_execdir)
451   cdata.set('program', 'static-link.py ' + glib_pkgconfigreldir)
452   configure_file(
453     input: installed_tests_template,
454     output: 'static-link.test',
455     install_dir: installed_tests_metadir,
456     configuration: cdata
457   )
458   install_subdir('static-link', install_dir : installed_tests_execdir)
459   install_data('static-link.py', install_dir : installed_tests_execdir)
460 endif
461
462 if not meson.is_cross_build() or meson.has_exe_wrapper()
463
464   plugin_resources_c = custom_target('plugin-resources.c',
465     input : 'test4.gresource.xml',
466     output : 'plugin-resources.c',
467     command : [glib_compile_resources,
468                '--target=@OUTPUT@',
469                '--sourcedir=' + meson.current_source_dir(),
470                '--generate-source',
471                '--c-name', '_g_plugin',
472                '@INPUT@'])
473
474   shared_module('resourceplugin', 'resourceplugin.c', plugin_resources_c,
475     link_args : export_dynamic_ldflags,
476     dependencies : common_gio_tests_deps,
477     install_dir : installed_tests_execdir,
478     install : installed_tests_enabled
479   )
480
481   # referenced by test2.gresource.xml
482   big_test_resource = custom_target(
483     'gresource-big-test.txt',
484     input : ['gen-big-test-resource.py'],
485     output : ['gresource-big-test.txt'],
486     command : [python, '@INPUT0@', '@OUTPUT@'])
487
488   test_gresource = custom_target('test.gresource',
489     input : 'test.gresource.xml',
490     output : 'test.gresource',
491     command : [glib_compile_resources,
492                '--target=@OUTPUT@',
493                '--sourcedir=' + meson.current_source_dir(),
494                '--sourcedir=' + meson.current_build_dir(),
495                '@INPUT@'],
496     install_dir : installed_tests_execdir,
497     install : installed_tests_enabled)
498
499   test_resources2_c = custom_target('test_resources2.c',
500     input : 'test3.gresource.xml',
501     output : 'test_resources2.c',
502     command : [glib_compile_resources,
503                '--target=@OUTPUT@',
504                '--sourcedir=' + meson.current_source_dir(),
505                '--generate',
506                '--c-name', '_g_test2',
507                '--manual-register',
508                '@INPUT@'])
509
510   test_resources2_h = custom_target('test_resources2.h',
511     input : 'test3.gresource.xml',
512     output : 'test_resources2.h',
513     command : [glib_compile_resources,
514                '--target=@OUTPUT@',
515                '--sourcedir=' + meson.current_source_dir(),
516                '--generate',
517                '--c-name', '_g_test2',
518                '--manual-register',
519                '@INPUT@'])
520
521   test_resources_c = custom_target('test_resources.c',
522     input : 'test2.gresource.xml',
523     depends : big_test_resource,
524     output : 'test_resources.c',
525     command : [glib_compile_resources,
526                '--target=@OUTPUT@',
527                '--sourcedir=' + meson.current_source_dir(),
528                '--sourcedir=' + meson.current_build_dir(),
529                '--generate-source',
530                '--c-name', '_g_test1',
531                '@INPUT@'])
532
533   digit_test_resources_c = custom_target('digit_test_resources.c',
534     input : '111_digit_test.gresource.xml',
535     output : 'digit_test_resources.c',
536     command : [glib_compile_resources,
537                '--target=@OUTPUT@',
538                '--sourcedir=' + meson.current_source_dir(),
539                '--sourcedir=' + meson.current_build_dir(),
540                '--generate-source',
541                '--manual-register',
542                '@INPUT@'])
543
544   digit_test_resources_h = custom_target('digit_test_resources.h',
545     input : '111_digit_test.gresource.xml',
546     output : 'digit_test_resources.h',
547     command : [glib_compile_resources,
548                '--target=@OUTPUT@',
549                '--sourcedir=' + meson.current_source_dir(),
550                '--generate',
551                '--manual-register',
552                '@INPUT@'])
553
554   # referenced by test.gresource.xml
555   test_generated_txt = configure_file(input : 'test1.txt',
556     output : 'test-generated.txt',
557     copy : true,
558     install : false)
559
560   resources_extra_sources = [
561     test_gresource,
562     test_resources_c,
563     test_resources2_c,
564     test_resources2_h,
565     digit_test_resources_c,
566     digit_test_resources_h,
567   ]
568
569   # Create object file containing resource data for testing the --external-data
570   # option. Currently only GNU ld and GNU objcopy support the right options.
571   # Support for --add-symbol was added to LLVM objcopy in 2019
572   # (https://reviews.llvm.org/D58234). FIXME: This test could be enabled for
573   # LLVM once that support is in a stable release.
574   if build_machine.system() == 'linux' and cc.get_id() == 'gcc'
575     test_gresource_binary = custom_target('test5.gresource',
576       input : 'test5.gresource.xml',
577       output : 'test5.gresource',
578       command : [glib_compile_resources,
579                  '--target=@OUTPUT@',
580                  '--sourcedir=' + meson.current_source_dir(),
581                  '--sourcedir=' + meson.current_build_dir(),
582                  '@INPUT@'],
583       install_dir : installed_tests_execdir,
584       install : installed_tests_enabled)
585
586     # Create resource data file
587     test_resources_binary_c = custom_target('test_resources_binary.c',
588       input : 'test5.gresource.xml',
589       output : 'test_resources_binary.c',
590       command : [glib_compile_resources,
591                  '--target=@OUTPUT@',
592                  '--sourcedir=' + meson.current_source_dir(),
593                  '--sourcedir=' + meson.current_build_dir(),
594                  '--generate-source',
595                  '--external-data',
596                  '--c-name', '_g_binary_test1',
597                  '@INPUT@'])
598
599     # Create object file containing resource data
600     test_resources_binary = custom_target('test_resources.o',
601       input : test_gresource_binary,
602       output : 'test_resources.o',
603       command : ['ld',
604                  '-r',
605                  '-b','binary',
606                  '@INPUT@',
607                  '-o','@OUTPUT@'])
608
609     # Rename symbol to match the one in the C file
610     test_resources_binary2 = custom_target('test_resources2.o',
611       input : test_resources_binary,
612       output : 'test_resources2.o',
613       command : ['objcopy',
614                  '--add-symbol','_g_binary_test1_resource_data=.data:0',
615                  '@INPUT@',
616                  '@OUTPUT@'])
617
618     resources_extra_sources += [
619       test_resources_binary_c,
620       test_resources_binary2,
621     ]
622   endif
623
624   gio_tests += {
625     'resources' : {
626       'extra_sources' : resources_extra_sources,
627     },
628   }
629 endif
630
631 foreach test_name, extra_args : gio_tests
632   source = extra_args.get('source', test_name + '.c')
633   extra_sources = extra_args.get('extra_sources', [])
634   install = installed_tests_enabled and extra_args.get('install', true)
635   installed_tests_env = extra_args.get('installed_tests_env', {})
636
637   if install
638     test_conf = configuration_data()
639     test_conf.set('installed_tests_dir', installed_tests_execdir)
640     test_conf.set('program', test_name)
641     test_env_override = ''
642     if installed_tests_env != {}
643       envs = []
644       foreach var, value : installed_tests_env
645          envs += '@0@=@1@'.format(var, value)
646       endforeach
647       test_env_override = '@0@ @1@ '.format(env_program.path(), ' '.join(envs))
648     endif
649     test_conf.set('env', test_env_override)
650     configure_file(
651       input: installed_tests_template_tap,
652       output: test_name + '.test',
653       install_dir: installed_tests_metadir,
654       configuration: test_conf
655     )
656   endif
657
658   exe = executable(test_name, [source, extra_sources],
659     c_args : test_c_args + extra_args.get('c_args', []),
660     dependencies : common_gio_tests_deps + extra_args.get('dependencies', []),
661     install_rpath : extra_args.get('install_rpath', ''),
662     install_dir: installed_tests_execdir,
663     install: install,
664   )
665
666   suite = ['gio'] + extra_args.get('suite', [])
667   timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
668   local_test_env = test_env
669
670   foreach var, value : extra_args.get('env', {})
671     local_test_env.append(var, value)
672   endforeach
673
674   test(test_name, exe,
675     env : local_test_env,
676     timeout : timeout,
677     suite : suite,
678     args : ['--tap'],
679     is_parallel : extra_args.get('is_parallel', true),
680     depends : extra_args.get('depends', []),
681   )
682 endforeach
683
684 foreach program_name, extra_args : test_extra_programs
685   source = extra_args.get('source', program_name + '.c')
686   extra_sources = extra_args.get('extra_sources', [])
687   install = installed_tests_enabled and extra_args.get('install', true)
688   executable(program_name, [source, extra_sources],
689       c_args : test_c_args,
690       dependencies : common_gio_tests_deps + extra_args.get('dependencies', []),
691       install_dir : installed_tests_execdir,
692       install : install,
693   )
694 endforeach
695
696 # FIXME: subdir('services')
697 subdir('modules')