2019-11-04 22:05:33 +01:00
|
|
|
# Copyright © 2019 Intel Corporation
|
|
|
|
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
# copy of this software and/or associated documentation files (the
|
|
|
|
# "Materials"), to deal in the Materials without restriction, including
|
|
|
|
# without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
# distribute, sublicense, and/or sell copies of the Materials, and to
|
|
|
|
# permit persons to whom the Materials are furnished to do so, subject to
|
|
|
|
# the following conditions:
|
|
|
|
|
|
|
|
# The above copyright notice and this permission notice shall be included
|
|
|
|
# unaltered in all copies or substantial portions of the Materials.
|
|
|
|
# Any additions, deletions, or changes to the original source files
|
|
|
|
# must be clearly indicated in accompanying documentation.
|
|
|
|
|
|
|
|
# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
|
|
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
|
|
|
|
|
|
|
subdir('dummy')
|
|
|
|
|
|
|
|
exe_gldispatch = executable(
|
|
|
|
'testgldispatch',
|
|
|
|
['testgldispatch.c'],
|
|
|
|
include_directories : [inc_include],
|
|
|
|
link_with : [libOpenGL, libpatchentrypoints],
|
|
|
|
dependencies : [idep_gldispatch, idep_utils_misc, dep_threads],
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach k : [['static', ['-s']],
|
|
|
|
['static thr', ['-s', '-t']],
|
|
|
|
['generated', ['-g']],
|
|
|
|
['generated end', ['-g', '-l']],
|
|
|
|
['generated thr', ['-g', '-t']],
|
|
|
|
['generated thr end', ['-g', '-t', '-l']],
|
|
|
|
['patched', ['-s', '-g', '-p']],
|
|
|
|
['patched end', ['-s', '-g', '-p', '-l']],
|
|
|
|
['patched thr', ['-s', '-g', '-p', '-t']],
|
|
|
|
['patched thr end', ['-s', '-g', '-p', '-t', '-l']]]
|
|
|
|
test(
|
|
|
|
'gldispatch ' + k[0],
|
|
|
|
exe_gldispatch,
|
|
|
|
args : k[1],
|
|
|
|
suite : ['gldispatch'],
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
test(
|
|
|
|
'testgldispatchthread',
|
|
|
|
executable(
|
|
|
|
'testgldispatchthread',
|
|
|
|
['testgldispatchthread.c'],
|
|
|
|
include_directories : [inc_include],
|
|
|
|
dependencies : [idep_gldispatch, dep_threads],
|
|
|
|
),
|
|
|
|
suite : ['gldispatch'],
|
|
|
|
)
|
|
|
|
|
|
|
|
_env_ld = 'LD_LIBRARY_PATH=@0@/'.format(dummy_build_dir)
|
|
|
|
|
|
|
|
if with_glx
|
|
|
|
env_glx = [
|
|
|
|
'__GLX_FORCE_VENDOR_LIBRARY_0=dummy',
|
|
|
|
_env_ld,
|
|
|
|
]
|
|
|
|
|
|
|
|
test(
|
|
|
|
'glxcreatecontext',
|
|
|
|
executable(
|
|
|
|
'glxcreatecontext',
|
|
|
|
['testglxcreatecontext.c', 'test_utils.c'],
|
|
|
|
include_directories : [inc_include],
|
|
|
|
link_with : libOpenGL,
|
2022-07-06 00:55:04 +02:00
|
|
|
dependencies : [dep_glx, dep_x11],
|
2019-11-04 22:05:33 +01:00
|
|
|
),
|
|
|
|
env : env_glx,
|
|
|
|
suite : ['glx'],
|
2021-05-19 01:03:53 +02:00
|
|
|
depends : [libGLX_dummy],
|
2019-11-04 22:05:33 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
exe_glxmakecurrent = executable(
|
|
|
|
'glxmakecurrent',
|
|
|
|
['testglxmakecurrent.c', 'test_utils.c'],
|
|
|
|
include_directories : [inc_include],
|
|
|
|
link_with : [libOpenGL],
|
|
|
|
dependencies : [
|
|
|
|
dep_dl, dep_x11, idep_glvnd_pthread, idep_trace, idep_utils_misc,
|
2022-07-06 00:55:04 +02:00
|
|
|
dep_glx,
|
2019-11-04 22:05:33 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach t : [['basic', ['-t', '1', '-i', '1'], env_glx],
|
|
|
|
['loop', ['-t', '1', '-i', '250'], env_glx],
|
2021-05-19 00:52:39 +02:00
|
|
|
['threads', ['-t', '5', '-i', '20000'], env_glx + ['LD_PRELOAD=libpthread.so.0']],
|
2019-11-04 22:05:33 +01:00
|
|
|
]
|
|
|
|
test(
|
|
|
|
'glxmakecurrent (@0@)'.format(t[0]),
|
|
|
|
exe_glxmakecurrent,
|
|
|
|
args : t[1],
|
|
|
|
env : t[2],
|
|
|
|
suite : ['glx'],
|
2021-05-19 01:03:53 +02:00
|
|
|
depends : [libGLX_dummy],
|
2019-11-04 22:05:33 +01:00
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
test(
|
|
|
|
'glxmakecurrent (oldlink)',
|
|
|
|
executable(
|
|
|
|
'glxmakecurrent_oldlink',
|
|
|
|
['testglxmakecurrent.c', 'test_utils.c'],
|
|
|
|
include_directories : [inc_include],
|
|
|
|
link_with : [libGL],
|
|
|
|
dependencies : [
|
|
|
|
dep_dl, dep_x11, idep_glvnd_pthread, idep_trace, idep_utils_misc,
|
|
|
|
],
|
|
|
|
),
|
|
|
|
args : ['-t', '1', '-i', '1'],
|
|
|
|
env : env_glx,
|
|
|
|
suite : ['glx'],
|
2021-05-19 01:03:53 +02:00
|
|
|
depends : [libGLX_dummy],
|
2019-11-04 22:05:33 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
exe_glxgetprocaddress = executable(
|
|
|
|
'glxgetprocaddress',
|
|
|
|
['testglxgetprocaddress.c'],
|
|
|
|
include_directories : [inc_include],
|
2022-07-06 00:55:04 +02:00
|
|
|
dependencies : [dep_x11, dep_glx, idep_gldispatch],
|
2019-11-04 22:05:33 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
test(
|
|
|
|
'glxgetprocess',
|
|
|
|
exe_glxgetprocaddress,
|
|
|
|
env : env_glx,
|
|
|
|
suite : ['glx'],
|
2021-05-19 01:03:53 +02:00
|
|
|
depends : [libGLX_dummy],
|
2019-11-04 22:05:33 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
test(
|
|
|
|
'glxgetprocess_genentry',
|
|
|
|
exe_glxgetprocaddress,
|
|
|
|
env : env_glx,
|
|
|
|
suite : ['glx'],
|
2021-05-19 01:03:53 +02:00
|
|
|
depends : [libGLX_dummy],
|
2019-11-04 22:05:33 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
test(
|
|
|
|
'glxgetprocaddress_genentry',
|
|
|
|
executable(
|
|
|
|
'testglxgetprocaddress_genentry',
|
|
|
|
['testglxgetprocaddress_genentry.c'],
|
|
|
|
include_directories : [inc_include],
|
2022-07-06 00:55:04 +02:00
|
|
|
dependencies : [dep_x11, dep_glx],
|
2019-11-04 22:05:33 +01:00
|
|
|
),
|
|
|
|
env : env_glx,
|
|
|
|
suite : ['glx'],
|
2021-05-19 01:03:53 +02:00
|
|
|
depends : [libGLX_dummy],
|
2019-11-04 22:05:33 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
test(
|
|
|
|
'glxgetclientstr',
|
|
|
|
executable(
|
|
|
|
'glxgetclientstr',
|
|
|
|
['testglxgetclientstr.c'],
|
|
|
|
include_directories : [inc_include],
|
|
|
|
link_with : libOpenGL,
|
2022-07-06 00:55:04 +02:00
|
|
|
dependencies : [dep_x11, dep_glx, idep_trace, idep_utils_misc],
|
2019-11-04 22:05:33 +01:00
|
|
|
),
|
|
|
|
env : env_glx,
|
|
|
|
suite : ['glx'],
|
2021-05-19 01:03:53 +02:00
|
|
|
depends : [libGLX_dummy],
|
2019-11-04 22:05:33 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
test(
|
|
|
|
'glxgetqueryversion',
|
|
|
|
executable(
|
|
|
|
'glxqueryversion',
|
|
|
|
['testglxqueryversion.c'],
|
|
|
|
include_directories : [inc_include],
|
|
|
|
link_with : libOpenGL,
|
2022-07-06 00:55:04 +02:00
|
|
|
dependencies : [dep_x11, dep_glx],
|
2019-11-04 22:05:33 +01:00
|
|
|
),
|
|
|
|
env : env_glx,
|
|
|
|
suite : ['glx'],
|
2021-05-19 01:03:53 +02:00
|
|
|
depends : [libGLX_dummy],
|
2019-11-04 22:05:33 +01:00
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('egl')
|
|
|
|
env_egl = [
|
|
|
|
'__EGL_VENDOR_LIBRARY_DIRS=@0@'.format(join_paths(meson.current_source_dir(), 'json')),
|
|
|
|
_env_ld,
|
|
|
|
]
|
|
|
|
|
|
|
|
foreach t : [['egldisplay', [], []],
|
|
|
|
['egldevice', [], []],
|
|
|
|
['eglgetprocaddress', [], []],
|
|
|
|
['eglmakecurrent', [libOpenGL], [idep_utils_misc]],
|
|
|
|
['eglerror', [libOpenGL], []],
|
|
|
|
['egldebug', [], []]]
|
|
|
|
test(
|
|
|
|
t[0],
|
|
|
|
executable(
|
|
|
|
t[0],
|
|
|
|
['test@0@.c'.format(t[0]), 'egl_test_utils.c'],
|
|
|
|
include_directories : [inc_include],
|
|
|
|
link_with : [libEGL, t[1]],
|
2021-02-11 19:48:49 +01:00
|
|
|
dependencies : [dep_dl, t[2]],
|
2019-11-04 22:05:33 +01:00
|
|
|
),
|
|
|
|
env : env_egl,
|
|
|
|
suite : ['egl'],
|
2021-05-19 01:03:53 +02:00
|
|
|
depends : libEGL_dummy,
|
2019-11-04 22:05:33 +01:00
|
|
|
)
|
|
|
|
endforeach
|
2021-02-11 19:55:34 +01:00
|
|
|
|
|
|
|
exe_egldeviceadd = executable(
|
|
|
|
'egldeviceadd',
|
|
|
|
['testegldeviceadd.c', 'egl_test_utils.c'],
|
|
|
|
include_directories : [inc_include],
|
|
|
|
link_with : [libEGL],
|
|
|
|
dependencies : [dep_dl],
|
|
|
|
)
|
2021-02-11 20:43:52 +01:00
|
|
|
foreach t : [ 'querydevices', 'returndevice', 'querydisplay' ]
|
2021-02-11 19:55:34 +01:00
|
|
|
test(
|
|
|
|
'egldeviceadd (@0@)'.format(t),
|
|
|
|
exe_egldeviceadd,
|
|
|
|
args : [t],
|
|
|
|
env : env_egl,
|
|
|
|
suite : ['egl'],
|
|
|
|
)
|
|
|
|
endforeach
|
2021-10-11 19:54:34 +02:00
|
|
|
|
|
|
|
test(
|
|
|
|
'eglcurrentcleanup',
|
|
|
|
executable(
|
|
|
|
'eglcurrentcleanup',
|
|
|
|
['testeglcurrentcleanup.c'],
|
|
|
|
include_directories : [inc_include],
|
|
|
|
link_with : [libEGL],
|
|
|
|
dependencies : [dep_threads],
|
|
|
|
),
|
|
|
|
args : [ '-m', '-t', '-k', '-r' ],
|
|
|
|
env : env_egl,
|
|
|
|
suite : ['egl'],
|
|
|
|
)
|
2019-11-04 22:05:33 +01:00
|
|
|
endif
|
|
|
|
|