summaryrefslogtreecommitdiff
path: root/test/meson.build
blob: 662eee4ef32c71eb2ae553569837361bfb3b4eea (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
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
simple_xinit = executable(
    'simple-xinit',
    'simple-xinit.c',
    include_directories: inc,
)

piglit_env = environment()
piglit_env.set('XSERVER_DIR', meson.source_root())
piglit_env.set('XSERVER_BUILDDIR', meson.build_root())

some_ops = ' -o clear,src,dst,over,xor,disjointover'
gles2_working_formats = ' -f '+ ','.join(['a8',
                                          'a8r8g8b8',
                                          'x8r8g8b8',
                                          'b8g8r8a8',
                                          'b8g8r8x8',
                                          'r8g8b8',
                                          'r5g5b5',
                                          'b5g5r5',
                                          'r5g6b5',
                                          'b5g6r5',
                                          'b8g8r8',
                                          'x8b8g8r8',
                                          'x2r10g10b10',
                                          'x2b10g10r10'])
rendercheck_tests_noblend = [
    ['blend/All/a8r8g8b8', '-t blend -f a8r8g8b8'],
    ['blend/All/x8r8g8b8', '-t blend -f a8r8g8b8,x8r8g8b8'],
    ['blend/All/a2r10g10b10', '-t blend -f a8r8g8b8,a2r10g10b10'],
    ['composite/Some/a8r8g8b8', '-t composite -f a8r8g8b8' + some_ops],
    ['composite/Some/x8r8g8b8', '-t composite -f a8r8g8b8,x8r8g8b8' + some_ops],
    ['composite/Some/a2r10g10b10', '-t composite -f a8r8g8b8,a2r10g10b10' + some_ops],
    ['ca composite/Some/a8r8g8b8', '-t cacomposite -f a8r8g8b8' + some_ops],
    ['ca composite/Some/a8', '-t cacomposite -f a8r8g8b8,a8' + some_ops],
    ['ca composite/Some/x8r8g8b8', '-t cacomposite -f a8r8g8b8,x8r8g8b8' + some_ops],
    ['ca composite/Some/a2r10g10b10', '-t cacomposite -f a8r8g8b8,a2r10g10b10' + some_ops],
    ['fill', '-t fill'],
    ['bug7366', '-t bug7366'],
    ['destination coordinates', '-t dcoords'],
    ['source coordinates', '-t scoords'],
    ['mask coordinates', '-t mcoords'],
    ['translated source coordinates', '-t tscoords'],
    ['translated mask coordinates', '-t tmcoords'],
    ['triangles', '-t triangles'],
    ['LibreOffice xRGB', '-t libreoffice_xrgb'],
    ['GTK ARGB vs xBGR', '-t gtk_argb_xbgr'],
]
rendercheck_blend = [
    ['blend/Clear', '-t blend -o clear'],
    ['blend/Src', '-t blend -o src'],
    ['blend/Over', '-t blend -o over'],
]
#Exclude 15bpp for now due to GLES limitation (see glamor.c:470)
rendercheck_blend_gles2 = [
    ['blend/Clear', '-t blend -o clear' + gles2_working_formats],
    ['blend/Src', '-t blend -o src' + gles2_working_formats],
    ['blend/Over', '-t blend -o over' + gles2_working_formats],
]
rendercheck_tests = rendercheck_blend + rendercheck_tests_noblend
rendercheck_tests_gles2 = rendercheck_blend_gles2 + rendercheck_tests_noblend
rendercheck = find_program('rendercheck', required:false)

if get_option('xvfb')
    xvfb_args = [
        xvfb_server.full_path(),
        '-screen',
        'scrn',
        '1280x1024x24',
    ]

    test('XTS',
        find_program('scripts/xvfb-piglit.sh'),
        env: piglit_env,
        timeout: 1200,
        suite: 'xvfb'
    )

    if rendercheck.found()
        foreach rctest: rendercheck_tests
            test(rctest[0],
                 simple_xinit,
                 # Use full_path so people can copy and paste the
                 # command line from testlog.txt easily.
                 args: [
                     rendercheck.path(),
                     rctest[1].split(' '),
                     '--',
                     xvfb_args,
                 ],
                 suite: 'xvfb'
                )
        endforeach
    endif

    if get_option('xephyr') and build_glamor
        test('XTS',
            find_program('scripts/xephyr-glamor-piglit.sh'),
            env: piglit_env,
            timeout: 1200,
            suite: 'xephyr-glamor',
        )
        test('XTS',
            find_program('scripts/xephyr-glamor-gles2-piglit.sh'),
            env: piglit_env,
            timeout: 1200,
            suite: 'xephyr-glamor-gles2',
        )

        if rendercheck.found()
            foreach rctest: rendercheck_tests
                test(rctest[0],
                     simple_xinit,
                     args: [simple_xinit.full_path(),
                            rendercheck.path(),
                            rctest[1].split(' '),
                            '----',
                            xephyr_server.full_path(),
                            '-glamor',
                            '-glamor-skip-present',
                            '-schedMax', '2000',
                            '--',
                            xvfb_args,
                           ],
                     suite: 'xephyr-glamor',
                     timeout: 300,
                    )
            endforeach
            foreach rctest: rendercheck_tests_gles2
                test(rctest[0],
                     simple_xinit,
                     args: [simple_xinit.full_path(),
                            rendercheck.path(),
                            rctest[1].split(' '),
                            '----',
                            xephyr_server.full_path(),
                            '-glamor_gles2',
                            '-glamor-skip-present',
                            '-schedMax', '2000',
                            '--',
                            xvfb_args,
                           ],
                     suite: 'xephyr-glamor-gles2',
                     timeout: 300,
                    )
            endforeach
        endif
    endif
endif

if build_xwayland
    xwayland_args = [
        xwayland_server.full_path(),
    ]

    test('XTS',
        find_program('scripts/xwayland-piglit.sh'),
        env: piglit_env,
        timeout: 1200,
        suite: 'xwayland'
    )
endif

subdir('bigreq')
subdir('damage')
subdir('sync')
subdir('bugs')

if build_xorg
# Tests that require at least some DDX functions in order to fully link
# For now, requires xf86 ddx, could be adjusted to use another
    unit_sources = [
     '../mi/miinitext.c',
     '../mi/miinitext.h',
     '../mi/micmap.c',
     '../mi/micmap.h',
     'fixes.c',
     'input.c',
     'list.c',
     'misc.c',
     'signal-logging.c',
     'string.c',
     'test_xkb.c',
     'tests-common.c',
     'tests.c',
     'touch.c',
     'xfree86.c',
     'xtest.c',
    ]
    unit_defines = ['-DXORG_TESTS']
    unit_includes = [inc, xorg_inc]

    if build_res
        unit_sources += ['hashtabletest.c']
        unit_defines += ['-DRES_TESTS']
    endif

    unit_c_args = unit_defines
    if meson.get_compiler('c').has_link_argument('-Wl,-wrap')
       # LTO breaks with -Wl,-wrap on certain configurations
       unit_c_args += ['-fno-lto']
       unit_sources += [
        'xi1/protocol-xchangedevicecontrol.c',
        'xi2/protocol-common.c',
        'xi2/protocol-xiqueryversion.c',
        'xi2/protocol-xiquerydevice.c',
        'xi2/protocol-xiselectevents.c',
        'xi2/protocol-xigetselectedevents.c',
        'xi2/protocol-xisetclientpointer.c',
        'xi2/protocol-xigetclientpointer.c',
        'xi2/protocol-xiquerypointer.c',
        'xi2/protocol-xipassivegrabdevice.c',
        'xi2/protocol-xiwarppointer.c',
        'xi2/protocol-eventconvert.c',
        'xi2/xi2.c',
       ]
       unit_defines += ['-DLDWRAP_TESTS']
       unit_includes += [include_directories('xi1', 'xi2')]
       ldwraps = [
        '-Wl,-wrap,dixLookupWindow',
        '-Wl,-wrap,dixLookupClient',
        '-Wl,-wrap,WriteToClient',
        '-Wl,-wrap,dixLookupWindow',
        '-Wl,-wrap,XISetEventMask',
        '-Wl,-wrap,AddResource',
        '-Wl,-wrap,GrabButton',
       ]
    else
       ldwraps = []
       message('ld -wrap required for xi1 & xi2 unit tests, skipping')
    endif

    unit = executable('tests',
         unit_sources,
         c_args: unit_c_args,
         dependencies: [pixman_dep, randrproto_dep, inputproto_dep, libxcvt_dep],
         include_directories: unit_includes,
         link_args: ldwraps,
         link_with: xorg_link,
    )

    test('unit', unit)
endif