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