summaryrefslogtreecommitdiff
path: root/tests/gobject/docs/meson.build
blob: a1dd66cadf09ec8b7d1c2b1bf3bf4b7d23badf1a (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
gobject_test_source_dir = join_paths(
  srcdir,
  'tests',
  'gobject',
  'src'
)

gobject_test_docs_dir = join_paths(
  srcdir,
  'tests',
  'gobject',
  'docs'
)

gobject_test_output_dir = join_paths(
  builddir,
  'tests',
  'gobject',
  'docs'
)

gobject_test_html_data = []

subdir('xml')

configure_file(
  input: join_paths(gobject_test_docs_dir, 'tester-sections.txt'),
  output: 'tester-sections.txt',
  copy: true,
)

test(
  'test-gobject-scan',
  python_prg,
  workdir: gobject_test_docs_dir,
  is_parallel: false,
  args: [
    gtkdoc_scan_runner_script,
    '--binary-dir=@0@'.format(builddir),
    '--change-dir=@0@'.format(gobject_test_output_dir),
    '--module=@0@'.format('tester'),
    '--source-dir=@0@'.format(gobject_test_source_dir),
    '--ignore-headers=config.h',
    '--deprecated-guards=GTKDOC_TESTER_DISABLE_DEPRECATED',
    '--rebuild-types',
  ],
)

sanitizer_args = []

if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address,undefined'
  sanitizer_args += [
    '--extra-cflags=-fsanitize=address',
    '--ldflags=-fsanitize=address',
  ]
endif

if get_option('b_sanitize') == 'undefined' or get_option('b_sanitize') == 'address,undefined'
  sanitizer_args += [
    '--extra-cflags=-fsanitize=undefined',
    '--ldflags=-fsanitize=undefined',
  ]
endif

test(
  'test-gobject-scangobj',
  python_prg,
  workdir: gobject_test_output_dir,
  is_parallel: false,
  args: [
    gtkdoc_scangobj_runner_script,
    '--binary-dir=@0@'.format(builddir),
    '--pkg-config=@0@'.format(pkgconfig_prg_path),
    '--extra-pkg=@0@'.format('glib-2.0'),
    '--extra-pkg=@0@'.format('gobject-2.0'),
    '--extra-lib=@0@'.format(gobject_test_lib.full_path()),
    '--module=@0@'.format('tester'),
  ] + sanitizer_args,
  env: [
    'ASAN_OPTIONS=detect_leaks=0',
  ],
)

test(
  'test-gobject-mkdb',
  python_prg,
  workdir: gobject_test_output_dir,
  is_parallel: false,
  args: [
    gtkdoc_mkdb_runner_script,
    '--binary-dir=@0@'.format(builddir),
    '--module=@0@'.format('tester'),
    '--source-dir=@0@'.format(gobject_test_source_dir),
    '--main-sgml-file=@0@'.format('tester-docs.xml'),
    '--output-format=xml',
    '--xml-mode',
  ],
)

foreach style_data: gtkdoc_style_data
  gobject_test_html_data += join_paths(srcdir, 'style', style_data)
endforeach

subdir('images') # Appends to gobject_test_html_data

test(
  'test-gobject-mkhtml',
  python_prg,
  workdir: gobject_test_output_dir,
  is_parallel: false,
  args: [
    gtkdoc_mkhtml_runner_script,
    '--binary-dir=@0@'.format(builddir),
    '--change-dir=@0@'.format(join_paths(gobject_test_output_dir, 'html')),
    '--html-assets=@0@'.format('@@'.join(gobject_test_html_data)),
    '@0@'.format('tester'),
    '@0@'.format(join_paths('..', 'tester-docs.xml')),
    '--uninstalled',
    '--path=@0@'.format(':'.join([
      gobject_test_docs_dir,
      srcdir,
      ])
    ),
  ],
)

test(
  'test-gobject-fixxref',
  python_prg,
  workdir: gobject_test_output_dir,
  is_parallel: false,
  args: [
    gtkdoc_fixxref_runner_script,
    '--binary-dir=@0@'.format(builddir),
    '--module=@0@'.format('tester'),
    '--module-dir=@0@'.format('html'),
    '--extra-dir=@0@'.format(glib_docpath),
    '--extra-dir=@0@'.format(gobject_docpath),
  ],
)

test(
  'test-gobject-check',
  python_prg,
  workdir: gobject_test_docs_dir,
  is_parallel: false,
  args: [
    gtkdoc_check_runner_script,
    '--binary-dir=@0@'.format(builddir),
    '--input-dir=@0@'.format(gobject_test_docs_dir),
    '--output-dir=@0@'.format(gobject_test_output_dir),
  ],
)