1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
tests = [
'array',
'boxed',
'builder',
'generator',
'gvariant',
'invalid',
'node',
'object',
'parser',
'path',
'reader',
'serialize-simple',
'serialize-complex',
'serialize-full',
]
python3 = import('python3').find_python()
gen_installed_test = join_paths(meson.current_source_dir(), 'gen-installed-test.py')
test_data = [
'stream-load.json',
]
installed_test_dir = join_paths(json_libexecdir, 'installed-tests', 'json-glib-1.0')
install_data(test_data, install_dir: installed_test_dir)
foreach t: tests
data = custom_target('@0@.test'.format(t),
output: '@0@.test'.format(t),
command: [
python3,
gen_installed_test,
'--testdir=@0@'.format(installed_test_dir),
'--testname=@0@'.format(t),
'--outdir=@OUTDIR@',
'--outfile=@0@.test'.format(t),
],
install: true,
install_dir: join_paths(json_datadir, 'installed-tests', 'json-glib-1.0'))
exe = executable(t, '@0@.c'.format(t),
c_args: json_c_args,
install: true,
install_dir: installed_test_dir,
dependencies: [ json_glib_dep, ])
test(t, exe,
args: [ '--tap', '-k' ],
env: [
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
])
endforeach
|