tests/meson: Make tests depending on test-client to actually depend on it

It allows meson to rebuild the client-related sources when a single test
is running using the client, also ensuring that test-run dependencies
are correctly setup

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2970>
This commit is contained in:
Marco Trevisan (Treviño) 2023-04-18 23:45:30 +02:00
parent 2625edec10
commit 28bd3da21a

View File

@ -243,6 +243,7 @@ test_cases += [
'name': 'monitor-unit', 'name': 'monitor-unit',
'suite': 'backend', 'suite': 'backend',
'sources': [ 'monitor-unit-tests.c', ], 'sources': [ 'monitor-unit-tests.c', ],
'depends': [ test_client ],
}, },
{ {
'name': 'monitor-utils', 'name': 'monitor-utils',
@ -253,6 +254,7 @@ test_cases += [
'name': 'stage-views', 'name': 'stage-views',
'suite': 'compositor', 'suite': 'compositor',
'sources': [ 'stage-view-tests.c', ], 'sources': [ 'stage-view-tests.c', ],
'depends': [ test_client ],
}, },
{ {
'name': 'anonymous-file', 'name': 'anonymous-file',
@ -319,6 +321,7 @@ if have_native_tests
'name': 'pointer-constraints', 'name': 'pointer-constraints',
'suite': 'backends/native', 'suite': 'backends/native',
'sources': [ 'native-pointer-constraints.c' ], 'sources': [ 'native-pointer-constraints.c' ],
'depends': [ test_client ],
}, },
{ {
'name': 'ref-test-sanity', 'name': 'ref-test-sanity',
@ -457,6 +460,7 @@ if have_native_tests
dummy_protocol_code, dummy_protocol_code,
wayland_test_utils, wayland_test_utils,
], ],
'depends': [ test_client ],
}, },
] ]
if have_xwayland if have_xwayland
@ -471,10 +475,12 @@ if have_native_tests
wayland_protocol_files['mutter-x11-interop']['protocol-code'], wayland_protocol_files['mutter-x11-interop']['protocol-code'],
built_dbus_sources['meta-dbus-service-channel'], built_dbus_sources['meta-dbus-service-channel'],
], ],
'depends': [ test_client ],
}, },
{ {
'name': 'xwayland', 'name': 'xwayland',
'suite': 'wayland', 'suite': 'wayland',
'depends': [ test_client ],
'sources': [ 'sources': [
'xwayland-tests.c', 'xwayland-tests.c',
], ],
@ -511,6 +517,7 @@ if have_native_tests
test(test_case['name'], test_executable, test(test_case['name'], test_executable,
suite: ['core', 'mutter/' + test_case['suite']], suite: ['core', 'mutter/' + test_case['suite']],
env: test_env, env: test_env,
depends: test_case.get('depends', []),
is_parallel: false, is_parallel: false,
timeout: 60, timeout: 60,
) )