meson/glsl: Only run GLSL tests if can_run_host_binaries()

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>
This commit is contained in:
Jason Ekstrand
2021-08-10 21:05:30 -05:00
committed by Marge Bot
parent dd88fb33fe
commit a4d1ae7017
2 changed files with 35 additions and 23 deletions

View File

@@ -89,8 +89,14 @@ glcpp = executable(
build_by_default : false, build_by_default : false,
) )
# Meson can't auto-skip these on cross builds because of the python wrapper
#
# TODO: has_exe_wrapper() is deprecated and renamed to can_run_host_binaries()
# starting with Meson 0.55.0
#
# FIXME: these fail on windows due to whitespace differences # FIXME: these fail on windows due to whitespace differences
if with_any_opengl and with_tests and host_machine.system() != 'windows' if with_any_opengl and with_tests and meson.has_exe_wrapper() and \
host_machine.system() != 'windows'
modes = ['unix', 'windows', 'oldmac', 'bizarro'] modes = ['unix', 'windows', 'oldmac', 'bizarro']
foreach m : modes foreach m : modes

View File

@@ -79,29 +79,35 @@ test(
suite : ['compiler', 'glsl'], suite : ['compiler', 'glsl'],
) )
test( # Meson can't auto-skip these on cross builds because of the python wrapper
'glsl compiler warnings', #
prog_python, # TODO: has_exe_wrapper() is deprecated and renamed to can_run_host_binaries()
args : [ # starting with Meson 0.55.0
join_paths(meson.current_source_dir(), 'warnings_test.py'), if meson.has_exe_wrapper()
'--glsl-compiler', glsl_compiler, test(
'--test-directory', join_paths( 'glsl compiler warnings',
meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings' prog_python,
), args : [
], join_paths(meson.current_source_dir(), 'warnings_test.py'),
suite : ['compiler', 'glsl'], '--glsl-compiler', glsl_compiler,
timeout: 60, '--test-directory', join_paths(
) meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
),
],
suite : ['compiler', 'glsl'],
timeout: 60,
)
test( test(
'glsl optimization', 'glsl optimization',
prog_python, prog_python,
args : [ args : [
join_paths(meson.current_source_dir(), 'optimization_test.py'), join_paths(meson.current_source_dir(), 'optimization_test.py'),
'--test-runner', glsl_test '--test-runner', glsl_test
], ],
suite : ['compiler', 'glsl'], suite : ['compiler', 'glsl'],
) )
endif
if with_tools.contains('glsl') if with_tools.contains('glsl')
test( test(