nir: Use a single binary for gtests

Less artifacts and less time running linker.  The
load_store_vectorizer test is still split since we need to update
gitlab-ci scripts to skip certain tests in certain builds. Added a
TODO with the concrete suggestion.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13414>
This commit is contained in:
Caio Marcelo de Oliveira Filho 2021-10-18 08:50:15 -07:00 committed by Marge Bot
parent 8cb7d6f81b
commit 662fbc0120
1 changed files with 16 additions and 143 deletions

View File

@ -370,52 +370,22 @@ nir_algebraic_py = files('nir_algebraic.py')
if with_tests if with_tests
test( test(
'nir_builder', 'nir_tests',
executable( executable(
'nir_builder_test', 'nir_tests',
files('tests/builder_tests.cpp'), files(
cpp_args : [cpp_msvc_compat_args], 'tests/algebraic_tests.cpp',
gnu_symbol_visibility : 'hidden', 'tests/builder_tests.cpp',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], 'tests/comparison_pre_tests.cpp',
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil], 'tests/control_flow_tests.cpp',
), 'tests/core_tests.cpp',
suite : ['compiler', 'nir'], 'tests/lower_returns_tests.cpp',
protocol : gtest_test_protocol, 'tests/negative_equal_tests.cpp',
) 'tests/opt_if_tests.cpp',
'tests/serialize_tests.cpp',
test( 'tests/ssa_def_bits_used_tests.cpp',
'nir_control_flow', 'tests/vars_tests.cpp',
executable( ),
'nir_control_flow_test',
files('tests/control_flow_tests.cpp'),
cpp_args : [cpp_msvc_compat_args],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
),
suite : ['compiler', 'nir'],
protocol : gtest_test_protocol,
)
test(
'nir_core',
executable(
'nir_core_test',
files('tests/core_tests.cpp'),
cpp_args : [cpp_msvc_compat_args],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
),
suite : ['compiler', 'nir'],
protocol : gtest_test_protocol,
)
test(
'nir_vars',
executable(
'nir_vars_test',
files('tests/vars_tests.cpp'),
cpp_args : [cpp_msvc_compat_args], cpp_args : [cpp_msvc_compat_args],
gnu_symbol_visibility : 'hidden', gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
@ -434,34 +404,6 @@ if with_tests
suite : ['compiler', 'nir'], suite : ['compiler', 'nir'],
) )
test(
'negative_equal',
executable(
'negative_equal',
files('tests/negative_equal_tests.cpp'),
c_args : [c_msvc_compat_args, no_override_init_args],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
),
suite : ['compiler', 'nir'],
protocol : gtest_test_protocol,
)
test(
'comparison_pre',
executable(
'comparison_pre',
files('tests/comparison_pre_tests.cpp'),
c_args : [c_msvc_compat_args, no_override_init_args],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
),
suite : ['compiler', 'nir'],
protocol : gtest_test_protocol,
)
test( test(
'load_store_vectorizer', 'load_store_vectorizer',
executable( executable(
@ -473,77 +415,8 @@ if with_tests
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil], dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
), ),
suite : ['compiler', 'nir'], suite : ['compiler', 'nir'],
# TODO: Use a negative filter for gtest instead of the expect failure here.
should_fail : meson.get_cross_property('xfail', '').contains('load_store_vectorizer'), should_fail : meson.get_cross_property('xfail', '').contains('load_store_vectorizer'),
protocol : gtest_test_protocol, protocol : gtest_test_protocol,
) )
test(
'nir_serialize_test',
executable(
'nir_serialize_test',
files('tests/serialize_tests.cpp'),
cpp_args : [cpp_msvc_compat_args],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
),
suite : ['compiler', 'nir'],
protocol : gtest_test_protocol,
)
test(
'nir_opt_if',
executable(
'nir_opt_if_tests',
files('tests/opt_if_tests.cpp'),
cpp_args : [cpp_msvc_compat_args],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
),
suite : ['compiler', 'nir'],
protocol : gtest_test_protocol,
)
test(
'nir_lower_returns',
executable(
'nir_lower_returns_tests',
files('tests/lower_returns_tests.cpp'),
cpp_args : [cpp_msvc_compat_args],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
),
suite : ['compiler', 'nir'],
protocol : gtest_test_protocol,
)
test(
'ssa_def_bits_used',
executable(
'ssa_def_bits_used',
files('tests/ssa_def_bits_used_tests.cpp'),
c_args : [c_msvc_compat_args, no_override_init_args],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
),
suite : ['compiler', 'nir'],
protocol : gtest_test_protocol,
)
test(
'algebraic',
executable(
'algebraic',
files('tests/algebraic_tests.cpp'),
c_args : [c_msvc_compat_args, no_override_init_args],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
),
suite : ['compiler', 'nir'],
protocol : gtest_test_protocol,
)
endif endif