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,7 +310,6 @@ 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',
@ -692,7 +691,6 @@ if have_native_tests
timeout: 60, timeout: 60,
) )
endforeach endforeach
endif
stacking_tests = [ stacking_tests = [
'basic-x11', 'basic-x11',