1
0
Fork 0

build: Make native backend mandatory for all tests

This allows us one less level of indentation of all the tests. It is not
entirely true, the X11 backend test case script can run without it, but
it isn't valuable enough to run without the native backend being enabled
to complicate building.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3812>
This commit is contained in:
Jonas Ådahl 2024-06-18 16:08:37 +02:00 committed by Marge Bot
parent 24a8ef5033
commit 465af4b2d3
5 changed files with 369 additions and 385 deletions

View file

@ -442,8 +442,7 @@ build-without-native-backend-and-wayland@x86_64:
-Dudev=false -Dudev=false
-Dwayland=false -Dwayland=false
-Dxwayland=false -Dxwayland=false
-Dcore_tests=false -Dtests=disabled
-Dnative_tests=false
-Dintrospection=false -Dintrospection=false
- meson compile -C build - meson compile -C build
- sudo meson install --no-rebuild -C build - sudo meson install --no-rebuild -C build
@ -464,8 +463,7 @@ build-wayland-only@x86_64:
-Dbuildtype=debugoptimized -Dbuildtype=debugoptimized
-Dwayland=true -Dwayland=true
-Dxwayland=false -Dxwayland=false
-Dcore_tests=false -Dtests=disabled
-Dnative_tests=false
-Dintrospection=false -Dintrospection=false
- meson compile -C build - meson compile -C build
- sudo meson install --no-rebuild -C build - sudo meson install --no-rebuild -C build

View file

@ -1,6 +1,6 @@
project('mutter', 'c', project('mutter', 'c',
version: '46.1', version: '46.1',
meson_version: '>= 0.60.0', meson_version: '>= 1.1.0',
license: 'GPLv2+' license: 'GPLv2+'
) )
@ -343,11 +343,10 @@ int main (int argc, char ** argv) {
have_malloc_trim = meson.get_compiler('c').has_function('malloc_trim') have_malloc_trim = meson.get_compiler('c').has_function('malloc_trim')
have_documentation = get_option('docs') have_documentation = get_option('docs')
have_tests = get_option('tests') have_tests = get_option('tests').enable_auto_if(have_native_backend).enabled()
have_core_tests = false have_mutter_tests = false
have_cogl_tests = false have_cogl_tests = false
have_clutter_tests = false have_clutter_tests = false
have_native_tests = false
have_kvm_tests = false have_kvm_tests = false
have_tty_tests = false have_tty_tests = false
have_installed_tests = false have_installed_tests = false
@ -357,8 +356,12 @@ if have_tests
gtk3_dep = dependency('gtk+-3.0', version: gtk3_req) gtk3_dep = dependency('gtk+-3.0', version: gtk3_req)
dbusmock_dep = python.find_installation('python3', modules: ['dbusmock'], required: false) dbusmock_dep = python.find_installation('python3', modules: ['dbusmock'], required: false)
have_core_tests = get_option('core_tests') if not have_native_backend
if have_core_tests error('Tests require the native backend to be enabled')
endif
have_mutter_tests = get_option('mutter_tests')
if have_mutter_tests
if not have_wayland if not have_wayland
error('Tests require Wayland to be enabled') error('Tests require Wayland to be enabled')
endif endif
@ -369,15 +372,6 @@ if have_tests
error('Tests require python-dbusmock') error('Tests require python-dbusmock')
endif endif
endif endif
have_native_tests = get_option('native_tests')
if have_native_tests
if not have_native_backend
error('Native tests require the native backend')
endif
if not have_remote_desktop
error('Native tests require remote desktop')
endif
endif
have_kvm_tests = get_option('kvm_tests') have_kvm_tests = get_option('kvm_tests')
if have_kvm_tests if have_kvm_tests
if not have_native_backend if not have_native_backend
@ -754,7 +748,7 @@ summary('Xwayland byte-swapped clients', have_xwayland_byte_swapped_clients, sec
summary('Xwayland enable EI portal', have_xwayland_enable_ei_portal, section: 'Options') summary('Xwayland enable EI portal', have_xwayland_enable_ei_portal, section: 'Options')
summary('Enabled', have_tests, section: 'Tests') summary('Enabled', have_tests, section: 'Tests')
summary('Core tests', have_core_tests, section: 'Tests') summary('Mutter tests', have_mutter_tests, section: 'Tests')
summary('Cogl tests', have_cogl_tests, section: 'Tests') summary('Cogl tests', have_cogl_tests, section: 'Tests')
summary('Clutter tests', have_clutter_tests, section: 'Tests') summary('Clutter tests', have_clutter_tests, section: 'Tests')
summary('KVM tests', have_kvm_tests, section: 'Tests') summary('KVM tests', have_kvm_tests, section: 'Tests')

View file

@ -147,22 +147,16 @@ option('clutter_tests',
description: 'Enable clutter tests' description: 'Enable clutter tests'
) )
option('core_tests', option('mutter_tests',
type: 'boolean', type: 'boolean',
value: true, value: true,
description: 'Enable mutter core tests' description: 'Enable mutter core tests'
) )
option('native_tests',
type: 'boolean',
value: true,
description: 'Enable mutter native backend tests'
)
option('tests', option('tests',
type: 'boolean', type: 'feature',
value: true, value: 'auto',
description: 'Enable tests globally. Specific test suites can be controlled with core_tests, clutter_tests, and cogl_tests' description: 'Enable tests globally. Specific test suites can be controlled with mutter_tests, clutter_tests, and cogl_tests'
) )
option('kvm_tests', option('kvm_tests',

View file

@ -1326,6 +1326,6 @@ if have_x11_client
subdir('frames') subdir('frames')
endif endif
if have_core_tests if have_tests
subdir('tests') subdir('tests')
endif endif

View file

@ -310,8 +310,7 @@ test_cases += [
}, },
] ]
if have_native_tests screen_cast_client = executable('mutter-screen-cast-client',
screen_cast_client = executable('mutter-screen-cast-client',
sources: [ sources: [
'screen-cast-client.c', 'screen-cast-client.c',
built_dbus_sources['meta-dbus-remote-desktop'], built_dbus_sources['meta-dbus-remote-desktop'],
@ -329,9 +328,9 @@ if have_native_tests
install: have_installed_tests, install: have_installed_tests,
install_dir: mutter_installed_tests_libexecdir, install_dir: mutter_installed_tests_libexecdir,
install_rpath: pkglibdir, install_rpath: pkglibdir,
) )
input_capture_client = executable('mutter-input-capture-test-client', input_capture_client = executable('mutter-input-capture-test-client',
sources: [ sources: [
'input-capture-test-client.c', 'input-capture-test-client.c',
'../backends/meta-fd-source.c', '../backends/meta-fd-source.c',
@ -349,10 +348,10 @@ if have_native_tests
], ],
install: have_installed_tests, install: have_installed_tests,
install_dir: mutter_installed_tests_libexecdir, install_dir: mutter_installed_tests_libexecdir,
) )
# Native backend tests # Native backend tests
test_cases += [ test_cases += [
{ {
'name': 'kms-utils', 'name': 'kms-utils',
'suite': 'backends/native', 'suite': 'backends/native',
@ -405,24 +404,24 @@ if have_native_tests
'meta-thread-impl-test.h', 'meta-thread-impl-test.h',
], ],
}, },
] ]
# KMS tests # KMS tests
kms_test_variants = [] kms_test_variants = []
kms_mode_atomic_variables = {'MUTTER_DEBUG_FORCE_KMS_MODE': 'atomic'} kms_mode_atomic_variables = {'MUTTER_DEBUG_FORCE_KMS_MODE': 'atomic'}
kms_mode_simple_variables = {'MUTTER_DEBUG_FORCE_KMS_MODE': 'simple'} kms_mode_simple_variables = {'MUTTER_DEBUG_FORCE_KMS_MODE': 'simple'}
kms_thread_kernel_variables = {'MUTTER_DEBUG_KMS_THREAD_TYPE': 'kernel'} kms_thread_kernel_variables = {'MUTTER_DEBUG_KMS_THREAD_TYPE': 'kernel'}
kms_thread_user_variables = {'MUTTER_DEBUG_KMS_THREAD_TYPE': 'user'} kms_thread_user_variables = {'MUTTER_DEBUG_KMS_THREAD_TYPE': 'user'}
kms_mode_variants = [ kms_mode_variants = [
['atomic', kms_mode_atomic_variables], ['atomic', kms_mode_atomic_variables],
['simple', kms_mode_simple_variables], ['simple', kms_mode_simple_variables],
] ]
kms_thread_variants = [ kms_thread_variants = [
['kernel-thread', kms_thread_kernel_variables], ['kernel-thread', kms_thread_kernel_variables],
['user-thread', kms_thread_user_variables], ['user-thread', kms_thread_user_variables],
] ]
foreach kms_mode_variant: kms_mode_variants foreach kms_mode_variant: kms_mode_variants
kms_mode_name = kms_mode_variant[0] kms_mode_name = kms_mode_variant[0]
kms_mode_variables = kms_mode_variant[1] kms_mode_variables = kms_mode_variant[1]
@ -437,9 +436,9 @@ if have_native_tests
kms_thread_variables kms_thread_variables
kms_test_variants += [[suffix, kms_test_env_variables]] kms_test_variants += [[suffix, kms_test_env_variables]]
endforeach endforeach
endforeach endforeach
kms_test_cases = [ kms_test_cases = [
{ {
'name': 'kms-force-atomic-sanity', 'name': 'kms-force-atomic-sanity',
'suite': 'backends/native/kms', 'suite': 'backends/native/kms',
@ -534,12 +533,12 @@ if have_native_tests
wayland_test_utils, wayland_test_utils,
], ],
}, },
] ]
privileged_test_cases += kms_test_cases privileged_test_cases += kms_test_cases
# Wayland tests # Wayland tests
wayland_test_cases = [ wayland_test_cases = [
{ {
'name': 'wayland-client-tests', 'name': 'wayland-client-tests',
'suite': 'wayland', 'suite': 'wayland',
@ -602,12 +601,12 @@ if have_native_tests
test_client_executables.get('ycbcr'), test_client_executables.get('ycbcr'),
], ],
}, },
] ]
test_cases += wayland_test_cases test_cases += wayland_test_cases
privileged_test_cases += wayland_test_cases privileged_test_cases += wayland_test_cases
if have_xwayland if have_xwayland
x11_compositor_checker = executable('x11-compositor-checker', x11_compositor_checker = executable('x11-compositor-checker',
sources: ['x11-compositor-checker.c'], sources: ['x11-compositor-checker.c'],
include_directories: tests_includes, include_directories: tests_includes,
@ -651,10 +650,10 @@ if have_native_tests
], ],
}, },
] ]
endif endif
# Miscellaneous tests # Miscellaneous tests
test_cases += [ test_cases += [
{ {
'name': 'service-channel', 'name': 'service-channel',
'suite': 'wayland', 'suite': 'wayland',
@ -666,9 +665,9 @@ if have_native_tests
test_client_executables.get('service-client'), test_client_executables.get('service-client'),
], ],
}, },
] ]
foreach test_case: test_cases foreach test_case: test_cases
test_executable = executable('mutter-' + test_case['name'], test_executable = executable('mutter-' + test_case['name'],
sources: test_case['sources'], sources: test_case['sources'],
include_directories: tests_includes, include_directories: tests_includes,
@ -691,8 +690,7 @@ if have_native_tests
is_parallel: false, is_parallel: false,
timeout: 60, timeout: 60,
) )
endforeach endforeach
endif
stacking_tests = [ stacking_tests = [
'basic-x11', 'basic-x11',