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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
# ggaze tests — two tracks (see docs/IMPLEMENTATION.md "Two test tracks").
#
# unit plain-C module tests, no display needed (>=80% coverage gate,
# warn until M10 then fail).
# integration cross-module flows with real temp dirs + offscreen GTK.
#
# Run one track: meson test -C build --suite unit
# meson test -C build --suite integration
# Coverage: meson setup -Db_coverage=true build
# meson test -C build
# ninja -C build coverage (needs lcov + genhtml)
#
# Fixture dirs are passed to tests via env vars:
# GGAZE_FIXTURES_DIR committed tests/fixtures/ (CI-portable baseline)
# GGAZE_SAMPLE_DIR local ./sample-images (not git-tracked; tests skip
# cleanly when absent so CI stays green)
# GIO_USE_VFS=local avoid gvfs daemon-VFS internal leaks under ASan
fixtures_env = environment()
fixtures_env.set('GIO_USE_VFS', 'local')
fixtures_env.set('GGAZE_FIXTURES_DIR',
join_paths(meson.project_source_root(), 'tests', 'fixtures'))
fixtures_env.set('GGAZE_SAMPLE_DIR',
join_paths(meson.project_source_root(), 'sample-images'))
# --- unit track ---
test_bootstrap = executable(
'test_bootstrap',
['test_bootstrap.c', ggaze_conf_h],
include_directories : inc,
dependencies : [glib_dep],
install : false,
)
test('bootstrap', test_bootstrap, suite : 'unit')
# test_app runs the ggaze binary as a subprocess; meson passes its path.
test_app = executable(
'test_app',
['test_app.c', ggaze_conf_h],
include_directories : inc,
dependencies : [glib_dep, gio_dep],
install : false,
)
test('app', test_app,
suite : 'unit',
args : [ggaze_exe.full_path()],
depends : ggaze_exe,
)
test_detect = executable(
'test_detect',
['test_detect.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [glib_dep],
link_with : ggaze_lib,
install : false,
)
test('detect', test_detect, suite : 'unit', env : fixtures_env)
test_loader_pixbuf = executable(
'test_loader_pixbuf',
['test_loader_pixbuf.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [gdkpixbuf_dep, gtk4_dep, glib_dep, gio_dep],
link_with : ggaze_lib,
install : false,
)
test('loader_pixbuf', test_loader_pixbuf, suite : 'unit', env : fixtures_env)
if libjpeg_dep.found()
test_loader_jpeg = executable(
'test_loader_jpeg',
['test_loader_jpeg.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [gdkpixbuf_dep, gtk4_dep, glib_dep, gio_dep],
link_with : ggaze_lib,
install : false,
)
test('loader_jpeg', test_loader_jpeg, suite : 'unit', env : fixtures_env)
endif
test_navigator = executable(
'test_navigator',
['test_navigator.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [glib_dep, gio_dep],
link_with : ggaze_lib,
install : false,
)
test('navigator', test_navigator, suite : 'unit', env : fixtures_env)
test_trash = executable(
'test_trash',
['test_trash.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [glib_dep, gio_dep],
link_with : ggaze_lib,
install : false,
)
test('trash', test_trash, suite : 'unit', env : fixtures_env)
test_thumbnail = executable(
'test_thumbnail',
['test_thumbnail.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [gdkpixbuf_dep, gtk4_dep, glib_dep, gio_dep],
link_with : ggaze_lib,
install : false,
)
test('thumbnail', test_thumbnail, suite : 'unit', env : fixtures_env)
test_info = executable(
'test_info',
['test_info.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : ggaze_deps,
link_with : ggaze_lib,
install : false,
)
test('info', test_info, suite : 'unit', env : fixtures_env)
test_mover = executable(
'test_mover', ['test_mover.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [glib_dep, gio_dep],
link_with : ggaze_lib, install : false,
)
test('mover', test_mover, suite : 'unit', env : fixtures_env)
test_opener = executable(
'test_opener', ['test_opener.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [glib_dep, gio_dep],
link_with : ggaze_lib, install : false,
)
test('opener', test_opener, suite : 'unit', env : fixtures_env)
test_runner = executable(
'test_runner', ['test_runner.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [glib_dep, gio_dep],
link_with : ggaze_lib, install : false,
)
test('runner', test_runner, suite : 'unit', env : fixtures_env)
if gegl_dep.found()
test_enhancer = executable(
'test_enhancer', ['test_enhancer.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [glib_dep, gegl_dep, gtk4_dep],
link_with : ggaze_lib, install : false,
)
enhancer_env = environment()
enhancer_env.set('GIO_USE_VFS', 'local')
enhancer_env.set('GGAZE_FIXTURES_DIR',
join_paths(meson.project_source_root(), 'tests', 'fixtures'))
enhancer_env.set('LSAN_OPTIONS',
'suppressions=' + join_paths(meson.project_source_root(), 'tests',
'lsan_suppressions.txt'))
test('enhancer', test_enhancer, suite : 'unit', env : enhancer_env)
endif
test_texturecache = executable(
'test_texturecache',
['test_texturecache.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : [gdkpixbuf_dep, gtk4_dep, glib_dep, gio_dep],
link_with : ggaze_lib,
install : false,
)
test('texturecache', test_texturecache, suite : 'unit', env : fixtures_env)
# --- integration track (needs a display; CI uses xvfb-run) ---
test_window = executable(
'test_window',
['test_window.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : ggaze_deps,
link_with : ggaze_lib,
install : false,
)
test('window', test_window, suite : 'integration', env : fixtures_env)
test_open_and_show = executable(
'test_open_and_show',
['test_open_and_show.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : ggaze_deps,
link_with : ggaze_lib,
install : false,
)
test('open_and_show', test_open_and_show,
suite : 'integration',
env : fixtures_env)
test_walk_folder = executable(
'test_walk_folder',
['test_walk_folder.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : ggaze_deps,
link_with : ggaze_lib,
install : false,
)
test('walk_folder', test_walk_folder, suite : 'integration', env : fixtures_env)
test_responsive_nav = executable(
'test_responsive_nav',
['test_responsive_nav.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : ggaze_deps,
link_with : ggaze_lib,
install : false,
)
test('responsive_nav', test_responsive_nav,
suite : 'integration',
env : fixtures_env)
test_grid_cull = executable(
'test_grid_cull',
['test_grid_cull.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : ggaze_deps,
link_with : ggaze_lib,
install : false,
)
test('grid_cull', test_grid_cull, suite : 'integration', env : fixtures_env)
test_progressive_jpeg = executable(
'test_progressive_jpeg',
['test_progressive_jpeg.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : ggaze_deps,
link_with : ggaze_lib,
install : false,
)
test('progressive_jpeg', test_progressive_jpeg,
suite : 'integration', env : fixtures_env)
test_full_lifecycle = executable(
'test_full_lifecycle', ['test_full_lifecycle.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : ggaze_deps,
link_with : ggaze_lib, install : false,
)
test('full_lifecycle', test_full_lifecycle,
suite : 'integration', env : fixtures_env)
test_shortcut = executable(
'test_shortcut', ['test_shortcut.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : ggaze_deps,
link_with : ggaze_lib, install : false,
)
test('shortcut', test_shortcut,
suite : 'integration', env : fixtures_env)
test_clipboard = executable(
'test_clipboard', ['test_clipboard.c', ggaze_conf_h],
include_directories : [inc, src_inc],
dependencies : ggaze_deps,
link_with : ggaze_lib, install : false,
)
test('clipboard', test_clipboard,
suite : 'integration', env : fixtures_env)
subdir('integration')
|