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
|
testexecdir = join_paths(installed_test_bindir, 'gsk')
testdatadir = join_paths(installed_test_datadir, 'gsk')
test_render_nodes = executable(
'test-render-nodes',
['test-render-nodes.c',
'reftest-compare.c'],
dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir
)
compare_render = executable(
'compare-render',
['compare-render.c', 'reftest-compare.c'],
dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir
)
test('nodes (cairo)', test_render_nodes,
args: [ '--tap', '-k' ],
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
'GSETTINGS_BACKEND=memory',
'GTK_CSD=1',
'G_ENABLE_DIAGNOSTIC=0',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
'GSK_RENDERER=cairo'
],
suite: 'gsk')
# Interesting render nodes proven to be rendered 'correctly' by the GL renderer.
gl_tests = [
['outset shadow simple', 'outset_shadow_simple.node', 'outset_shadow_simple.gl.png'],
['outset shadow offset x', 'outset_shadow_offsetx.node', 'outset_shadow_offsetx.gl.png'],
['outset shadow offset y', 'outset_shadow_offsety.node', 'outset_shadow_offsety.gl.png'],
['outset shadow offset both', 'outset_shadow_offset_both.node', 'outset_shadow_offset_both.gl.png'],
['outset shadow rounded1', 'outset_shadow_rounded1.node', 'outset_shadow_rounded1.gl.png'],
['outset shadow rounded2', 'outset_shadow_rounded2.node', 'outset_shadow_rounded2.gl.png'],
['outset shadow rounded top', 'outset_shadow_rounded_top.node', 'outset_shadow_rounded_top.gl.png'],
['outset shadow blurred simple', 'outset_shadow_blurred_simple.node', 'outset_shadow_blurred_simple.gl.png'],
['outset shadow blurred small', 'outset_shadow_blurred_small.node', 'outset_shadow_blurred_small.gl.png'],
['outset shadow blurred offset', 'outset_shadow_blurred_offset.node', 'outset_shadow_blurred_offset.gl.png'],
['outset shadow transformed', 'outset_shadow_translated.node', 'outset_shadow_translated.gl.png'],
['Text with alpha', 'text_alpha.node', 'text_alpha.gl.png'],
['Transform in Shadow', 'shadow_transform1.node', 'shadow_transform1.gl.png'],
['Clipped crossfade', 'clipped_cross_fade.node', 'clipped_cross_fade.gl.png'],
]
foreach gl_test : gl_tests
test('GL ' + gl_test[0], compare_render,
args: [join_paths(meson.current_source_dir(), 'gl', gl_test[1]),
join_paths(meson.current_source_dir(), 'gl', gl_test[2])],
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
'GSETTINGS_BACKEND=memory',
'GTK_CSD=1',
'G_ENABLE_DIAGNOSTIC=0',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
'GSK_RENDERER=opengl'
],
suite: 'gsk')
endforeach
if have_vulkan
test('nodes (vulkan)', test_render_nodes,
args: [ '--tap', '-k' ],
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
'GSETTINGS_BACKEND=memory',
'GTK_CSD=1',
'G_ENABLE_DIAGNOSTIC=0',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
'GSK_RENDERER=vulkan'
],
suite: 'gsk')
endif
test_data = [
'blendmode.node',
'blendmode.png',
'blendmode.vulkan.png',
'blendmodes.node',
'blendmodes.png',
'blendmodes.vulkan.png',
'cairo.node',
'cairo.png',
'colors.cairo.png',
'colors.node',
'colors.vulkan.png',
'cross-fade.node',
'cross-fade.png',
'cross-fades.node',
'cross-fades.png',
'cross-fades.vulkan.png',
'ducky.png',
'repeat.node',
'repeat.png',
'transform.node',
'transform.png',
'transform.vulkan.png',
'opacity.node',
'opacity.png',
'opacity.vulkan.png',
]
if get_option('install-tests')
conf = configuration_data()
conf.set('libexecdir', gtk_libexecdir)
configure_file(input: 'render-nodes-cairo.test.in',
output: 'render-nodes-cairo.test',
configuration: conf,
install_dir: testdatadir)
configure_file(input: 'render-nodes-vulkan.test.in',
output: 'render-nodes-vulkan.test',
configuration: conf,
install_dir: testdatadir)
install_data(test_data, install_dir: testexecdir)
endif
|