meson: use gtest protocol for gtest based tests when possible
With the `gtest` protocol meson will add some extra arguments to the test to generate better junit results, which may be useful. This protocol is only available in meson 0.55.0+, so keep using the default `exitcode` protocol for meson older than that. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8484>
This commit is contained in:
parent
aac47c4b24
commit
e73096bd6d
|
@ -30,6 +30,13 @@ project(
|
|||
default_options : ['buildtype=debugoptimized', 'b_ndebug=if-release', 'c_std=c11', 'cpp_std=c++14']
|
||||
)
|
||||
|
||||
# For meson >= 0.55.0, meson can inject some extra arguments to get richer
|
||||
# results from gtest based tests.
|
||||
gtest_test_protocol = 'exitcode'
|
||||
if meson.version().version_compare('>= 0.55.0')
|
||||
gtest_test_protocol = 'gtest'
|
||||
endif
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
cpp = meson.get_compiler('cpp')
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ test(
|
|||
dependencies : [dep_clock, dep_thread, idep_gtest, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'glsl'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -49,6 +50,7 @@ test(
|
|||
dependencies : [dep_thread, idep_gtest, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'glsl'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -63,6 +65,7 @@ test(
|
|||
dependencies : [dep_thread, idep_gtest, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'glsl'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -77,6 +80,7 @@ test(
|
|||
dependencies : [dep_thread, idep_gtest],
|
||||
),
|
||||
suite : ['compiler', 'glsl'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
# Meson can't auto-skip these on cross builds because of the python wrapper
|
||||
|
|
|
@ -81,6 +81,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'spirv'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -94,6 +95,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'spirv'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
|
||||
|
|
|
@ -380,6 +380,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -393,6 +394,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -406,6 +408,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -419,6 +422,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -441,6 +445,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -454,6 +459,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -468,6 +474,7 @@ if with_tests
|
|||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
should_fail : meson.get_cross_property('xfail', '').contains('load_store_vectorizer'),
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -481,6 +488,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -494,6 +502,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -507,6 +516,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -520,6 +530,7 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -533,5 +544,6 @@ if with_tests
|
|||
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['compiler', 'nir'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
|
|
|
@ -145,5 +145,6 @@ if with_tests
|
|||
dependencies : [idep_gtest, idep_nir],
|
||||
),
|
||||
suite : ['compiler', 'etnaviv'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
|
|
|
@ -28,4 +28,5 @@ test(
|
|||
link_with : [libvirgl, libgallium],
|
||||
),
|
||||
suite : ['virgl'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
|
|
@ -82,6 +82,7 @@ if with_tests
|
|||
suite : ['wgl'],
|
||||
env : wgl_test_env,
|
||||
depends : [libopengl32],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -81,6 +81,7 @@ if with_tests
|
|||
link_with: libosmesa,
|
||||
dependencies : [idep_gtest],
|
||||
),
|
||||
suite: 'gallium'
|
||||
suite: 'gallium',
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
|
|
|
@ -50,5 +50,6 @@ if with_shared_glapi
|
|||
dependencies : [dep_libdrm, dep_glproto, dep_thread, idep_gtest]
|
||||
),
|
||||
suite : ['glx'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
|
|
|
@ -183,5 +183,6 @@ if with_tests
|
|||
dependencies : [idep_gtest, idep_nir, idep_mesautil],
|
||||
),
|
||||
suite : ['intel'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
|
|
|
@ -168,5 +168,6 @@ if with_tests
|
|||
cpp_args : '-DIN_UNIT_TEST',
|
||||
),
|
||||
suite : ['intel'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
|
|
|
@ -98,5 +98,6 @@ if with_any_opengl and not with_shared_glapi and with_tests and not with_platfor
|
|||
dependencies : [idep_gtest, dep_thread],
|
||||
),
|
||||
suite : ['mapi'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
|
|
|
@ -74,6 +74,7 @@ if with_any_opengl and with_tests
|
|||
dependencies : [dep_thread, idep_gtest],
|
||||
),
|
||||
suite : ['mapi'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
if with_symbols_check
|
||||
test(
|
||||
|
|
|
@ -43,4 +43,5 @@ test(
|
|||
link_with : [libmesa_classic, link_main_test],
|
||||
),
|
||||
suite : ['mesa'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
|
|
@ -51,6 +51,7 @@ test(
|
|||
dependencies : [idep_mesautil, idep_gtest],
|
||||
),
|
||||
suite : ['st_mesa'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -65,4 +66,5 @@ test(
|
|||
dependencies : [idep_mesautil, idep_gtest],
|
||||
),
|
||||
suite : ['st_mesa'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
|
|
@ -39,7 +39,8 @@ if dep_dxheaders.found()
|
|||
link_with : [libclc_compiler],
|
||||
dependencies : [idep_gtest, idep_mesautil, idep_libdxil_compiler, dep_dxheaders,
|
||||
dep_spirv_tools],
|
||||
include_directories : [inc_include, inc_src, inc_compiler, inc_spirv])
|
||||
include_directories : [inc_include, inc_src, inc_compiler, inc_spirv],
|
||||
)
|
||||
|
||||
test('clc_compiler_test', clc_compiler_test, timeout: 180)
|
||||
test('clc_compiler_test', clc_compiler_test, timeout: 180, protocol : gtest_test_protocol)
|
||||
endif
|
||||
|
|
|
@ -289,8 +289,9 @@ if with_tests
|
|||
env: ['HOME=' + join_paths(meson.current_source_dir(),
|
||||
'tests', 'drirc_home'),
|
||||
'DRIRC_CONFIGDIR=' + join_paths(meson.current_source_dir(),
|
||||
'tests', 'drirc_configdir')]
|
||||
)
|
||||
'tests', 'drirc_configdir')],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
|
||||
test(
|
||||
|
@ -367,6 +368,7 @@ if with_tests
|
|||
dependencies : [idep_mesautil, idep_gtest],
|
||||
),
|
||||
suite : ['util'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endforeach
|
||||
|
||||
|
@ -403,6 +405,7 @@ if with_tests
|
|||
dependencies : [idep_mesautil, idep_gtest],
|
||||
),
|
||||
suite : ['util'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
test(
|
||||
|
@ -414,6 +417,7 @@ if with_tests
|
|||
include_directories : [inc_include, inc_src],
|
||||
),
|
||||
suite : ['util'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
||||
subdir('tests/cache')
|
||||
|
|
|
@ -27,7 +27,7 @@ if with_shader_cache
|
|||
c_args : [c_msvc_compat_args, no_override_init_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
include_directories : [inc_include, inc_src],
|
||||
dependencies : [dep_clock, dep_thread, idep_gtest, idep_mesautil],
|
||||
dependencies : [dep_clock, dep_thread, idep_mesautil],
|
||||
),
|
||||
suite : ['util'],
|
||||
)
|
||||
|
|
|
@ -28,4 +28,5 @@ test(
|
|||
),
|
||||
suite : ['util'],
|
||||
timeout: 60,
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
|
|
@ -28,4 +28,5 @@ test(
|
|||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
),
|
||||
suite : ['util'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
|
|
@ -27,4 +27,5 @@ test(
|
|||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
),
|
||||
suite : ['util'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
|
|
@ -28,4 +28,5 @@ test(
|
|||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
),
|
||||
suite : ['util'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
|
|
@ -27,4 +27,5 @@ test(
|
|||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
),
|
||||
suite : ['util'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
|
|
@ -27,4 +27,5 @@ test(
|
|||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
),
|
||||
suite : ['util'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue