Skip to content

Commit 574f0c1

Browse files
committed
use meson for test suite
so "ninja test" is much more helpful
1 parent e5f66f6 commit 574f0c1

File tree

4 files changed

+56
-104
lines changed

4 files changed

+56
-104
lines changed

src/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ enumtypes = gnome.mkenums(
163163
c_template: 'enumtypes.c.in',
164164
)
165165

166-
executable('nip4', [
166+
nip4 = executable('nip4', [
167167
enumtypes,
168168
marshal,
169169
resources,
@@ -178,7 +178,7 @@ executable('nip4', [
178178
install: true,
179179
)
180180

181-
executable('nip4-batch', [
181+
nip4_batch = executable('nip4-batch', [
182182
enumtypes,
183183
marshal,
184184
resources,

test/meson.build

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,57 @@
1-
variables_data = configuration_data()
2-
variables_data.set('abs_top_srcdir', project_source_root)
3-
variables_data.set('abs_top_builddir', project_build_root)
1+
should_pass_tests = [
2+
# test workspaces
3+
'big_and_small_disks.ws',
4+
'test_colour.ws',
5+
'test_conv.ws',
6+
'test_filter.ws',
7+
'test_fourier.ws',
8+
'test_histogram.ws',
9+
'test_image.ws',
10+
'test_math.ws',
11+
'test_matrix.ws',
12+
'test_stats.ws',
13+
'test_tasks.ws',
14+
'test_widgets.ws',
415

5-
variables_sh = configure_file(
6-
input: 'variables.sh.in',
7-
output: '@BASENAME@',
8-
configuration: variables_data
9-
)
16+
# test the scripting language
17+
'test_snip.def',
18+
]
1019

11-
test('test_all',
12-
files('test_all.sh'),
13-
workdir: meson.current_build_dir(),
14-
# typically 2m or so on a fast machine in debug mode
15-
timeout: 240,
16-
)
20+
should_fail_tests = [
21+
'test_fail.ws',
22+
]
23+
24+
# all the demo workspaces, except frame and register, since they ise a
25+
# non-free plugin
26+
demos = [
27+
'1_point_mosaic/1pt_mosaic.ws',
28+
'2_point_mosaic/2pts_mosaic.ws',
29+
'businesscard/businesscard.ws',
30+
'clone/clone.ws',
31+
'logo/logo2.ws',
32+
'manual_balance/manual_balance.ws',
33+
'overlays_and_blending/overlay_blend.ws',
34+
]
35+
36+
foreach name : should_pass_tests
37+
file = files('workspaces/' + name)
38+
test(name, nip4_batch, args: ['--test', file])
39+
test(name, nip4_batch, args: ['--test', file], env: ['VIPS_NOVECTOR=1'])
40+
endforeach
41+
42+
foreach name : should_fail_tests
43+
file = files('workspaces/' + name)
44+
test(name, nip4_batch, should_fail: true, args: ['--test', file])
45+
test(name, nip4_batch, should_fail: true,
46+
args: ['--test', file],
47+
env: ['VIPS_NOVECTOR=1'],
48+
)
49+
endforeach
50+
51+
foreach name : demos
52+
file = files(project_source_root + '/share/nip4/data/examples/' + name)
53+
test(name, nip4_batch, args: ['--test', file])
54+
# repeat, with the vector system disabled
55+
test(name, nip4_batch, args: ['--test', file], env: ['VIPS_NOVECTOR=1'])
56+
endforeach
1757

test/test_all.sh

Lines changed: 0 additions & 86 deletions
This file was deleted.

test/variables.sh.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)