2021-05-06 21:37:35 +00:00
|
|
|
mutter_test_sources = [
|
2021-03-03 09:57:40 +00:00
|
|
|
'meta-backend-test.c',
|
|
|
|
'meta-backend-test.h',
|
|
|
|
'meta-context-test.c',
|
|
|
|
'meta-gpu-test.c',
|
|
|
|
'meta-gpu-test.h',
|
|
|
|
'meta-monitor-manager-test.c',
|
|
|
|
'meta-monitor-manager-test.h',
|
2022-01-28 15:28:32 +00:00
|
|
|
'meta-monitor-test-utils.c',
|
|
|
|
'meta-monitor-test-utils.h',
|
2022-01-28 07:33:50 +00:00
|
|
|
'meta-ref-test.c',
|
|
|
|
'meta-ref-test.h',
|
2020-05-04 17:22:35 +00:00
|
|
|
'meta-sensors-proxy-mock.c',
|
|
|
|
'meta-sensors-proxy-mock.h',
|
2023-02-02 15:18:54 +00:00
|
|
|
'meta-test-monitor.c',
|
2021-04-20 16:39:53 +00:00
|
|
|
'meta-test-utils.c',
|
|
|
|
'meta-test-utils.h',
|
2021-03-03 09:57:40 +00:00
|
|
|
]
|
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
libmutter_test_name = 'mutter-test-' + libmutter_api_version
|
|
|
|
|
2022-08-04 16:53:56 +00:00
|
|
|
cogl_test_utils = files (
|
|
|
|
'cogl-test-utils.c',
|
|
|
|
'cogl-test-utils.h',
|
|
|
|
)
|
|
|
|
|
2019-07-03 11:43:25 +00:00
|
|
|
clutter_test_utils = files (
|
|
|
|
'clutter-test-utils.c',
|
|
|
|
'clutter-test-utils.h',
|
|
|
|
)
|
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
tests_includepath = include_directories('.')
|
|
|
|
tests_includes = mutter_includes
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
tests_c_args = mutter_c_args
|
|
|
|
|
2023-02-02 15:14:37 +00:00
|
|
|
subdir('meta-test')
|
|
|
|
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
tests_deps = [
|
|
|
|
libmutter_cogl_dep,
|
|
|
|
libmutter_clutter_dep,
|
2023-02-05 09:53:14 +00:00
|
|
|
libmutter_dep,
|
|
|
|
mutter_deps,
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
]
|
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
libmutter_test = shared_library(libmutter_test_name,
|
|
|
|
mutter_test_sources,
|
|
|
|
gnu_symbol_visibility: 'hidden',
|
|
|
|
include_directories: tests_includes,
|
2022-04-28 14:09:11 +00:00
|
|
|
c_args: [
|
|
|
|
tests_c_args,
|
|
|
|
'-DG_LOG_DOMAIN="libmutter-test"',
|
|
|
|
],
|
2021-05-06 21:37:35 +00:00
|
|
|
dependencies: tests_deps,
|
|
|
|
install_rpath: pkglibdir,
|
|
|
|
install_dir: libdir,
|
|
|
|
install: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
libmutter_test_dep = declare_dependency(
|
|
|
|
link_with: libmutter_test,
|
|
|
|
include_directories: tests_includes,
|
|
|
|
dependencies: tests_deps,
|
|
|
|
)
|
|
|
|
|
2023-02-02 15:14:37 +00:00
|
|
|
if have_introspection
|
|
|
|
mutter_test_introspected_sources = []
|
|
|
|
foreach source: mutter_test_sources
|
|
|
|
if source.endswith('.c')
|
|
|
|
mutter_test_introspected_sources += source
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
libmutter_test_gir = gnome.generate_gir(libmutter_test,
|
|
|
|
sources: [
|
|
|
|
mutter_test_introspected_sources,
|
|
|
|
mutter_test_public_headers,
|
|
|
|
],
|
|
|
|
nsversion: libmutter_api_version,
|
|
|
|
namespace: 'MetaTest',
|
|
|
|
symbol_prefix: 'meta',
|
|
|
|
identifier_prefix: 'Meta',
|
|
|
|
includes: [
|
|
|
|
'GObject-2.0',
|
|
|
|
'GDesktopEnums-3.0',
|
|
|
|
'xlib-2.0',
|
|
|
|
'xfixes-4.0',
|
|
|
|
libmutter_cogl_gir[0],
|
|
|
|
libmutter_cogl_pango_gir[0],
|
|
|
|
libmutter_clutter_gir[0],
|
|
|
|
libmutter_gir[0],
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
libmutter_test_dep,
|
2023-02-04 11:17:38 +00:00
|
|
|
libmutter_dep,
|
|
|
|
mutter_deps,
|
2023-02-02 15:14:37 +00:00
|
|
|
],
|
|
|
|
extra_args: mutter_c_args + introspection_args,
|
|
|
|
install_dir_gir: pkglibdir,
|
|
|
|
install_dir_typelib: pkglibdir,
|
|
|
|
install: true
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
pkg.generate(libmutter_test,
|
|
|
|
name: 'Meta (test framework)',
|
|
|
|
filebase: 'libmutter-test-' + libmutter_api_version,
|
|
|
|
description: 'Mutter test framework',
|
|
|
|
subdirs: pkgname,
|
|
|
|
requires: ['libmutter-' + libmutter_api_version],
|
|
|
|
version: meson.project_version(),
|
|
|
|
variables: [
|
|
|
|
'apiversion=' + libmutter_api_version,
|
2022-08-16 13:50:33 +00:00
|
|
|
'tests_datadir=${prefix}/share/mutter-' + libmutter_api_version + '/tests',
|
2021-05-06 21:37:35 +00:00
|
|
|
],
|
|
|
|
install_dir: pcdir,
|
|
|
|
)
|
|
|
|
|
2022-08-04 16:53:56 +00:00
|
|
|
if have_cogl_tests
|
|
|
|
subdir('cogl')
|
|
|
|
endif
|
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
if have_clutter_tests
|
|
|
|
subdir('clutter')
|
|
|
|
endif
|
|
|
|
|
2023-01-27 10:41:26 +00:00
|
|
|
subdir('protocol')
|
2022-06-10 21:19:03 +00:00
|
|
|
subdir('drm-mock')
|
2019-12-06 18:05:32 +00:00
|
|
|
subdir('wayland-test-clients')
|
|
|
|
|
2018-12-17 15:26:07 +00:00
|
|
|
if have_installed_tests
|
2023-05-04 11:49:59 +00:00
|
|
|
stacking_files_datadir = pkgdatadir / 'tests'
|
2018-12-17 15:26:07 +00:00
|
|
|
install_subdir('stacking', install_dir: stacking_files_datadir)
|
|
|
|
endif
|
|
|
|
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
test_env = environment()
|
2022-02-09 09:35:53 +00:00
|
|
|
|
|
|
|
test_env_variables = {
|
2023-05-04 11:49:59 +00:00
|
|
|
'G_TEST_SRCDIR': mutter_srcdir / 'src',
|
2022-02-09 09:35:53 +00:00
|
|
|
'G_TEST_BUILDDIR': mutter_builddir,
|
2023-05-04 11:49:59 +00:00
|
|
|
'XDG_CONFIG_HOME': mutter_builddir / '.config',
|
2022-02-09 09:35:53 +00:00
|
|
|
'MUTTER_TEST_PLUGIN_PATH': '@0@'.format(default_plugin.full_path()),
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach name, value: test_env_variables
|
|
|
|
test_env.set(name, value)
|
|
|
|
endforeach
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
|
|
|
|
test_client = executable('mutter-test-client',
|
|
|
|
sources: ['test-client.c'],
|
2021-05-06 21:37:35 +00:00
|
|
|
include_directories: tests_includes,
|
2022-04-28 14:09:11 +00:00
|
|
|
c_args: [
|
|
|
|
tests_c_args,
|
|
|
|
'-DG_LOG_DOMAIN="mutter-test-client"',
|
|
|
|
],
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
dependencies: [
|
|
|
|
gtk3_dep,
|
|
|
|
gio_unix_dep,
|
2018-11-13 03:04:22 +00:00
|
|
|
x11_dep,
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
xext_dep,
|
2022-05-09 09:48:57 +00:00
|
|
|
graphene_dep,
|
|
|
|
json_glib_dep,
|
|
|
|
gsettings_desktop_schemas_dep,
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
],
|
2018-12-17 15:26:07 +00:00
|
|
|
install: have_installed_tests,
|
|
|
|
install_dir: mutter_installed_tests_libexecdir,
|
2022-08-17 15:47:49 +00:00
|
|
|
install_rpath: pkglibdir,
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
test_runner = executable('mutter-test-runner',
|
|
|
|
sources: [
|
|
|
|
'test-runner.c',
|
|
|
|
],
|
2021-05-06 21:37:35 +00:00
|
|
|
include_directories: tests_includes,
|
2022-04-28 14:09:11 +00:00
|
|
|
c_args: [
|
|
|
|
tests_c_args,
|
|
|
|
'-DG_LOG_DOMAIN="mutter-test-runner"',
|
|
|
|
],
|
2021-05-06 21:37:35 +00:00
|
|
|
dependencies: libmutter_test_dep,
|
2018-12-17 15:26:07 +00:00
|
|
|
install: have_installed_tests,
|
|
|
|
install_dir: mutter_installed_tests_libexecdir,
|
2022-08-17 15:47:49 +00:00
|
|
|
install_rpath: pkglibdir,
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
)
|
|
|
|
|
2021-12-10 22:49:48 +00:00
|
|
|
meta_dbus_runner = find_program('meta-dbus-runner.py')
|
|
|
|
|
2023-05-04 11:49:59 +00:00
|
|
|
tests_datadir = pkgdatadir / 'tests'
|
2022-08-16 13:50:33 +00:00
|
|
|
|
|
|
|
install_data('mutter_dbusrunner.py',
|
|
|
|
install_dir: tests_datadir,
|
|
|
|
)
|
|
|
|
install_subdir('dbusmock-templates',
|
|
|
|
install_dir: tests_datadir,
|
|
|
|
)
|
|
|
|
|
2020-05-04 17:22:35 +00:00
|
|
|
if have_installed_tests
|
2022-08-16 13:50:33 +00:00
|
|
|
configure_file(
|
|
|
|
input: 'mutter-installed-dbus-session.py.in',
|
|
|
|
output: 'mutter-installed-dbus-session.py',
|
|
|
|
configuration: {'tests_datadir': tests_datadir},
|
|
|
|
install: true,
|
|
|
|
install_mode: 'rwxr-xr-x',
|
2020-05-04 17:22:35 +00:00
|
|
|
install_dir: mutter_installed_tests_libexecdir,
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2022-01-28 16:32:58 +00:00
|
|
|
wayland_test_utils = [
|
|
|
|
'meta-wayland-test-driver.c',
|
|
|
|
'meta-wayland-test-driver.h',
|
|
|
|
'meta-wayland-test-utils.c',
|
|
|
|
'meta-wayland-test-utils.h',
|
|
|
|
test_driver_server_header,
|
|
|
|
test_driver_protocol_code,
|
|
|
|
]
|
2022-01-14 21:16:46 +00:00
|
|
|
|
2022-01-28 16:32:58 +00:00
|
|
|
# The test_cases is a list of dictionaries each one representing one test case.
|
|
|
|
# It consists of the following keys:
|
|
|
|
# - 'name' - the test name
|
|
|
|
# - 'suite' - the test suite
|
|
|
|
# - 'sources' - a list of source code files
|
|
|
|
|
|
|
|
test_cases = []
|
|
|
|
privileged_test_cases = []
|
|
|
|
|
|
|
|
test_cases += [
|
|
|
|
{
|
|
|
|
'name': 'unit',
|
|
|
|
'suite': 'unit',
|
|
|
|
'sources': [
|
|
|
|
'unit-tests.c',
|
|
|
|
'boxes-tests.c',
|
|
|
|
'boxes-tests.h',
|
|
|
|
'monitor-config-migration-unit-tests.c',
|
|
|
|
'monitor-config-migration-unit-tests.h',
|
|
|
|
'monitor-store-unit-tests.c',
|
|
|
|
'monitor-store-unit-tests.h',
|
|
|
|
'monitor-transform-tests.c',
|
|
|
|
'monitor-transform-tests.h',
|
|
|
|
'orientation-manager-unit-tests.c',
|
2023-03-03 15:37:34 +00:00
|
|
|
'hdr-metadata-unit-tests.c',
|
2021-01-26 16:07:09 +00:00
|
|
|
],
|
2023-06-23 19:34:27 +00:00
|
|
|
'depends': [
|
|
|
|
test_client,
|
|
|
|
],
|
2022-01-28 16:32:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'monitor-unit',
|
|
|
|
'suite': 'backend',
|
|
|
|
'sources': [ 'monitor-unit-tests.c', ],
|
2023-06-23 19:34:27 +00:00
|
|
|
'depends': [
|
|
|
|
test_client,
|
|
|
|
x11_frames,
|
|
|
|
],
|
2022-01-28 16:32:58 +00:00
|
|
|
},
|
2022-07-26 22:25:22 +00:00
|
|
|
{
|
|
|
|
'name': 'monitor-utils',
|
|
|
|
'suite': 'unit',
|
|
|
|
'sources': [ 'monitor-util-tests.c', ],
|
|
|
|
},
|
2022-01-28 16:32:58 +00:00
|
|
|
{
|
|
|
|
'name': 'stage-views',
|
|
|
|
'suite': 'compositor',
|
|
|
|
'sources': [ 'stage-view-tests.c', ],
|
2023-06-23 19:34:27 +00:00
|
|
|
'depends': [
|
|
|
|
test_client,
|
|
|
|
x11_frames,
|
|
|
|
],
|
2022-01-28 16:32:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'anonymous-file',
|
|
|
|
'suite': 'unit',
|
|
|
|
'sources': [ 'anonymous-file.c', ],
|
|
|
|
},
|
2022-03-25 19:15:31 +00:00
|
|
|
{
|
|
|
|
'name': 'edid',
|
|
|
|
'suite': 'unit',
|
|
|
|
'sources': [ 'edid-tests.c', ],
|
|
|
|
},
|
2021-11-29 16:27:27 +00:00
|
|
|
{
|
|
|
|
'name': 'color-management',
|
|
|
|
'suite': 'unit',
|
|
|
|
'sources': [ 'color-management-tests.c', ],
|
|
|
|
},
|
2022-09-13 16:28:41 +00:00
|
|
|
{
|
|
|
|
'name': 'color-management-profile-conflict',
|
|
|
|
'suite': 'unit',
|
|
|
|
'sources': [ 'color-management-profile-conflict-test.c', ],
|
|
|
|
},
|
2022-01-28 16:32:58 +00:00
|
|
|
]
|
2021-02-01 19:32:27 +00:00
|
|
|
|
2022-01-28 16:32:58 +00:00
|
|
|
if have_native_tests
|
2021-02-01 19:32:27 +00:00
|
|
|
screen_cast_client = executable('mutter-screen-cast-client',
|
|
|
|
sources: [
|
|
|
|
'screen-cast-client.c',
|
2023-01-27 15:42:15 +00:00
|
|
|
built_dbus_sources['meta-dbus-remote-desktop'],
|
|
|
|
built_dbus_sources['meta-dbus-screen-cast'],
|
2021-02-01 19:32:27 +00:00
|
|
|
],
|
2021-05-06 21:37:35 +00:00
|
|
|
include_directories: tests_includes,
|
2022-04-28 14:09:11 +00:00
|
|
|
c_args: [
|
|
|
|
tests_c_args,
|
|
|
|
'-DG_LOG_DOMAIN="mutter-screen-cast-client"',
|
|
|
|
],
|
2021-02-01 19:32:27 +00:00
|
|
|
dependencies: [
|
|
|
|
gio_dep,
|
|
|
|
libpipewire_dep,
|
|
|
|
],
|
|
|
|
install: have_installed_tests,
|
|
|
|
install_dir: mutter_installed_tests_libexecdir,
|
2022-08-17 15:47:49 +00:00
|
|
|
install_rpath: pkglibdir,
|
2021-02-01 19:32:27 +00:00
|
|
|
)
|
2021-02-03 10:01:13 +00:00
|
|
|
|
2022-03-30 15:27:51 +00:00
|
|
|
input_capture_client = executable('mutter-input-capture-test-client',
|
|
|
|
sources: [
|
|
|
|
'input-capture-test-client.c',
|
2022-04-27 08:50:43 +00:00
|
|
|
'../backends/meta-fd-source.c',
|
|
|
|
'../backends/meta-fd-source.h',
|
2022-03-30 15:27:51 +00:00
|
|
|
dbus_input_capture_built_sources,
|
|
|
|
],
|
|
|
|
include_directories: tests_includes,
|
|
|
|
c_args: [
|
|
|
|
tests_c_args,
|
|
|
|
'-DG_LOG_DOMAIN="mutter-input-capture-test-client"',
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
gio_unix_dep,
|
2022-04-27 08:50:43 +00:00
|
|
|
libei_dep,
|
2022-03-30 15:27:51 +00:00
|
|
|
],
|
|
|
|
install: have_installed_tests,
|
|
|
|
install_dir: mutter_installed_tests_libexecdir,
|
|
|
|
)
|
|
|
|
|
2022-01-28 16:32:58 +00:00
|
|
|
# Native backend tests
|
|
|
|
test_cases += [
|
|
|
|
{
|
|
|
|
'name': 'kms-utils',
|
|
|
|
'suite': 'backends/native',
|
|
|
|
'sources': [ 'kms-utils-unit-tests.c', ],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'native-unit',
|
|
|
|
'suite': 'backends/native',
|
|
|
|
'sources': [
|
|
|
|
'native-headless.c',
|
|
|
|
'native-screen-cast.c',
|
|
|
|
'native-screen-cast.h',
|
|
|
|
'native-virtual-monitor.c',
|
|
|
|
'native-virtual-monitor.h',
|
|
|
|
],
|
2023-06-23 19:34:27 +00:00
|
|
|
'depends': [
|
|
|
|
screen_cast_client,
|
|
|
|
],
|
2022-01-28 16:32:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'pointer-constraints',
|
|
|
|
'suite': 'backends/native',
|
|
|
|
'sources': [ 'native-pointer-constraints.c' ],
|
2023-04-18 21:45:30 +00:00
|
|
|
'depends': [ test_client ],
|
2022-01-28 16:32:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'ref-test-sanity',
|
|
|
|
'suite': 'backends/native',
|
|
|
|
'sources': [ 'ref-test-sanity.c' ],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'persistent-virtual-monitor',
|
|
|
|
'suite': 'backends/native',
|
|
|
|
'sources': [ 'native-persistent-virtual-monitor.c' ],
|
|
|
|
},
|
2022-03-30 15:27:51 +00:00
|
|
|
{
|
|
|
|
'name': 'input-capture',
|
|
|
|
'suite': 'backends/native',
|
|
|
|
'sources': [ 'input-capture-tests.c' ],
|
|
|
|
},
|
2021-05-26 06:58:18 +00:00
|
|
|
{
|
|
|
|
'name': 'thread',
|
|
|
|
'suite': 'backends/native',
|
|
|
|
'sources': [
|
|
|
|
'native-thread.c',
|
|
|
|
'meta-thread-test.c',
|
|
|
|
'meta-thread-test.h',
|
|
|
|
'meta-thread-impl-test.c',
|
|
|
|
'meta-thread-impl-test.h',
|
|
|
|
],
|
|
|
|
},
|
2022-01-28 16:32:58 +00:00
|
|
|
]
|
2021-05-17 17:18:08 +00:00
|
|
|
|
2021-06-28 09:51:57 +00:00
|
|
|
# KMS tests
|
|
|
|
kms_test_variants = []
|
|
|
|
kms_atomic_variables = {'MUTTER_DEBUG_FORCE_KMS_MODE': 'atomic'}
|
|
|
|
kms_simple_variables = {'MUTTER_DEBUG_FORCE_KMS_MODE': 'simple'}
|
|
|
|
kms_variants = [
|
|
|
|
['atomic', kms_atomic_variables],
|
|
|
|
['simple', kms_simple_variables],
|
|
|
|
]
|
|
|
|
foreach variant: kms_variants
|
|
|
|
name = variant[0]
|
|
|
|
variables = variant[1]
|
|
|
|
suffix = '-@0@'.format(name)
|
|
|
|
|
|
|
|
kms_test_env_variables = test_env_variables + variables
|
|
|
|
kms_test_variants += [[suffix, kms_test_env_variables]]
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
kms_test_cases = [
|
|
|
|
{
|
|
|
|
'name': 'kms-force-atomic-sanity',
|
|
|
|
'suite': 'backends/native/kms',
|
|
|
|
'sources': [
|
|
|
|
'native-kms-force-atomic-sanity.c',
|
|
|
|
],
|
|
|
|
'variants': [['', test_env_variables + kms_atomic_variables]],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'kms-force-simple-sanity',
|
|
|
|
'suite': 'backends/native/kms',
|
|
|
|
'sources': [
|
|
|
|
'native-kms-force-simple-sanity.c',
|
|
|
|
],
|
|
|
|
'variants': [['', test_env_variables + kms_simple_variables]],
|
|
|
|
},
|
2022-01-28 16:32:58 +00:00
|
|
|
{
|
|
|
|
'name': 'kms-render',
|
|
|
|
'suite': 'backends/native/kms',
|
2022-05-13 20:09:35 +00:00
|
|
|
'sources': [
|
|
|
|
'native-kms-render.c',
|
|
|
|
wayland_test_utils,
|
|
|
|
],
|
2021-06-28 09:51:57 +00:00
|
|
|
'variants': kms_test_variants,
|
2022-01-28 16:32:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'kms-device',
|
|
|
|
'suite': 'backends/native/kms',
|
|
|
|
'sources': [
|
|
|
|
'meta-kms-test-utils.c',
|
|
|
|
'meta-kms-test-utils.h',
|
|
|
|
'native-kms-device.c',
|
|
|
|
],
|
2021-06-28 09:51:57 +00:00
|
|
|
'variants': kms_test_variants,
|
2022-01-28 16:32:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'kms-update',
|
|
|
|
'suite': 'backends/native/kms',
|
|
|
|
'sources': [
|
|
|
|
'meta-kms-test-utils.c',
|
|
|
|
'meta-kms-test-utils.h',
|
|
|
|
'native-kms-updates.c',
|
|
|
|
],
|
2021-06-28 09:51:57 +00:00
|
|
|
'variants': kms_test_variants,
|
2022-01-28 16:32:58 +00:00
|
|
|
},
|
2023-02-01 11:21:49 +00:00
|
|
|
{
|
|
|
|
'name': 'kms-headless-start',
|
|
|
|
'suite': 'backend/native/kms',
|
|
|
|
'sources': [ 'native-kms-headless-start.c', ],
|
|
|
|
},
|
2023-03-03 21:37:43 +00:00
|
|
|
{
|
|
|
|
'name': 'kms-hotplug',
|
|
|
|
'suite': 'backends/native/kms',
|
|
|
|
'sources': [
|
|
|
|
'meta-kms-test-utils.c',
|
|
|
|
'meta-kms-test-utils.h',
|
|
|
|
'native-kms-hotplug.c',
|
|
|
|
],
|
|
|
|
'variants': kms_test_variants,
|
|
|
|
},
|
2023-04-17 16:35:37 +00:00
|
|
|
{
|
|
|
|
'name': 'kms-cursor-hotplug',
|
|
|
|
'suite': 'backends/native',
|
|
|
|
'sources': [
|
|
|
|
'native-kms-cursor-hotplug.c',
|
|
|
|
wayland_test_utils,
|
|
|
|
],
|
|
|
|
},
|
2022-01-28 16:32:58 +00:00
|
|
|
]
|
2021-06-16 09:34:12 +00:00
|
|
|
|
2021-06-28 09:51:57 +00:00
|
|
|
privileged_test_cases += kms_test_cases
|
|
|
|
|
2022-01-28 16:32:58 +00:00
|
|
|
# Wayland tests
|
|
|
|
test_cases += [
|
|
|
|
{
|
2023-03-03 15:30:31 +00:00
|
|
|
'name': 'wayland-client-tests',
|
2022-01-28 16:32:58 +00:00
|
|
|
'suite': 'wayland',
|
|
|
|
'sources': [
|
2023-03-03 15:30:31 +00:00
|
|
|
'wayland-client-tests.c',
|
2022-01-28 16:32:58 +00:00
|
|
|
],
|
|
|
|
},
|
2022-03-04 14:04:59 +00:00
|
|
|
{
|
|
|
|
'name': 'wayland-fullscreen',
|
|
|
|
'suite': 'wayland',
|
|
|
|
'sources': [
|
|
|
|
'wayland-fullscreen-test.c',
|
|
|
|
wayland_test_utils,
|
|
|
|
],
|
2023-06-23 19:34:27 +00:00
|
|
|
'depends': [
|
|
|
|
test_client_executables.get('fullscreen'),
|
|
|
|
],
|
2022-03-04 14:04:59 +00:00
|
|
|
},
|
2023-01-26 21:53:56 +00:00
|
|
|
{
|
2023-03-01 22:36:42 +00:00
|
|
|
'name': 'wayland-fractional-scale',
|
2023-01-26 21:53:56 +00:00
|
|
|
'suite': 'wayland',
|
|
|
|
'sources': [
|
2023-03-01 22:36:42 +00:00
|
|
|
'wayland-fractional-scale-test.c',
|
|
|
|
wayland_test_utils,
|
2023-01-26 21:53:56 +00:00
|
|
|
],
|
2023-06-23 19:34:27 +00:00
|
|
|
'depends': [
|
|
|
|
test_client_executables.get('fractional-scale'),
|
|
|
|
],
|
2023-01-26 21:53:56 +00:00
|
|
|
},
|
2023-03-03 15:30:31 +00:00
|
|
|
{
|
|
|
|
'name': 'wayland-unit',
|
|
|
|
'suite': 'wayland',
|
|
|
|
'sources': [
|
|
|
|
'wayland-unit-tests.c',
|
|
|
|
dummy_client_header,
|
|
|
|
dummy_server_header,
|
|
|
|
dummy_protocol_code,
|
|
|
|
wayland_test_utils,
|
|
|
|
],
|
2023-06-23 19:34:27 +00:00
|
|
|
'depends': [
|
|
|
|
test_client,
|
|
|
|
test_client_executables.get('buffer-transform'),
|
|
|
|
test_client_executables.get('invalid-subsurfaces'),
|
|
|
|
test_client_executables.get('invalid-xdg-shell-actions'),
|
|
|
|
test_client_executables.get('single-pixel-buffer'),
|
|
|
|
test_client_executables.get('subsurface-parent-unmapped'),
|
|
|
|
test_client_executables.get('subsurface-remap-toplevel'),
|
|
|
|
test_client_executables.get('subsurface-reparenting'),
|
|
|
|
test_client_executables.get('xdg-activation'),
|
|
|
|
test_client_executables.get('xdg-apply-limits'),
|
|
|
|
test_client_executables.get('xdg-foreign'),
|
|
|
|
test_client_executables.get('xdg-toplevel-bounds'),
|
|
|
|
],
|
2023-03-03 15:30:31 +00:00
|
|
|
},
|
2022-01-28 16:32:58 +00:00
|
|
|
]
|
2022-12-02 11:41:52 +00:00
|
|
|
if have_xwayland
|
2023-04-18 21:55:30 +00:00
|
|
|
x11_compositor_checker = executable('x11-compositor-checker',
|
|
|
|
sources: ['x11-compositor-checker.c'],
|
|
|
|
include_directories: tests_includes,
|
|
|
|
c_args: [
|
|
|
|
tests_c_args,
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
x11_dep,
|
|
|
|
],
|
|
|
|
install: have_installed_tests,
|
|
|
|
install_dir: mutter_installed_tests_libexecdir,
|
|
|
|
install_rpath: pkglibdir,
|
|
|
|
)
|
|
|
|
|
2022-12-02 11:41:52 +00:00
|
|
|
test_cases += [
|
2023-03-28 13:12:27 +00:00
|
|
|
{
|
|
|
|
'name': 'wayland-x11-interop',
|
|
|
|
'suite': 'wayland',
|
|
|
|
'sources': [
|
|
|
|
'wayland-x11-interop-tests.c',
|
|
|
|
wayland_test_client_utils,
|
|
|
|
wayland_test_utils,
|
|
|
|
wayland_protocol_files['mutter-x11-interop']['protocol-code'],
|
|
|
|
built_dbus_sources['meta-dbus-service-channel'],
|
|
|
|
],
|
2023-06-23 19:34:27 +00:00
|
|
|
'depends': [
|
|
|
|
test_client,
|
|
|
|
x11_frames,
|
|
|
|
],
|
2023-03-28 13:12:27 +00:00
|
|
|
},
|
2022-12-02 11:41:52 +00:00
|
|
|
{
|
|
|
|
'name': 'xwayland',
|
|
|
|
'suite': 'wayland',
|
2023-04-18 21:55:30 +00:00
|
|
|
'depends': [
|
|
|
|
test_client,
|
|
|
|
x11_compositor_checker,
|
2023-06-23 19:34:27 +00:00
|
|
|
x11_frames,
|
2023-04-18 21:55:30 +00:00
|
|
|
],
|
2022-12-02 11:41:52 +00:00
|
|
|
'sources': [
|
|
|
|
'xwayland-tests.c',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
endif
|
2021-06-23 08:10:35 +00:00
|
|
|
|
2023-03-04 16:01:44 +00:00
|
|
|
# Miscellaneous tests
|
|
|
|
test_cases += [
|
|
|
|
{
|
|
|
|
'name': 'service-channel',
|
|
|
|
'suite': 'wayland',
|
|
|
|
'sources': [
|
|
|
|
'service-channel-tests.c',
|
|
|
|
wayland_test_utils,
|
|
|
|
],
|
2023-06-23 19:34:27 +00:00
|
|
|
'depends': [
|
|
|
|
test_client_executables.get('service-client'),
|
|
|
|
],
|
2023-03-04 16:01:44 +00:00
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2022-01-28 16:32:58 +00:00
|
|
|
foreach test_case: test_cases
|
|
|
|
test_executable = executable('mutter-' + test_case['name'],
|
|
|
|
sources: test_case['sources'],
|
|
|
|
include_directories: tests_includes,
|
2022-04-28 14:09:11 +00:00
|
|
|
c_args: [
|
|
|
|
tests_c_args,
|
|
|
|
'-DG_LOG_DOMAIN="mutter-@0@-test"'.format(test_case['name']),
|
|
|
|
],
|
2022-01-28 16:32:58 +00:00
|
|
|
dependencies: libmutter_test_dep,
|
|
|
|
install: have_installed_tests,
|
|
|
|
install_dir: mutter_installed_tests_libexecdir,
|
2022-08-17 15:47:49 +00:00
|
|
|
install_rpath: pkglibdir,
|
2022-01-28 16:32:58 +00:00
|
|
|
)
|
|
|
|
|
2023-06-23 19:34:27 +00:00
|
|
|
test_depends = [ default_plugin ] + test_case.get('depends', [])
|
|
|
|
|
2022-01-28 16:32:58 +00:00
|
|
|
test(test_case['name'], test_executable,
|
|
|
|
suite: ['core', 'mutter/' + test_case['suite']],
|
|
|
|
env: test_env,
|
2023-06-23 19:34:27 +00:00
|
|
|
depends: test_depends,
|
2022-01-28 16:32:58 +00:00
|
|
|
is_parallel: false,
|
|
|
|
timeout: 60,
|
|
|
|
)
|
|
|
|
endforeach
|
2021-01-19 16:48:04 +00:00
|
|
|
endif
|
|
|
|
|
2018-11-14 01:36:35 +00:00
|
|
|
stacking_tests = [
|
|
|
|
'basic-x11',
|
|
|
|
'basic-wayland',
|
|
|
|
'client-side-decorated',
|
|
|
|
'closed-transient',
|
2020-06-26 19:32:39 +00:00
|
|
|
'closed-transient-no-default-focus',
|
2018-11-13 06:48:53 +00:00
|
|
|
'closed-transient-no-input-no-take-focus-parent',
|
|
|
|
'closed-transient-no-input-no-take-focus-parents',
|
|
|
|
'closed-transient-no-input-parent',
|
2018-11-13 23:08:34 +00:00
|
|
|
'closed-transient-no-input-parent-delayed-focus-default-cancelled',
|
window-x11: Use any focusable window as fallback delayed focus window
As per commit f71151a5 we focus an input window if no take-focus-window accepts
it. This might lead to an infinite loop if there are various focusable but
non-input windows in the stack.
When the current focus window is unmanaging and we're trying to focus a
WM_TAKE_FOCUS window, we intent to give the focus to the first focusable input
window in the stack.
However, if an application (such as the Java ones) only uses non-input
WM_TAKE_FOCUS windows, are not requesting these ones to get the focus. This
might lead to a state where no window is focused, or a wrong one is.
So, instead of only focus the first eventually input window available, try to
request to all the take-focus windows that are in the stack between the
destroyed one and the first input one to acquire the input focus.
Use a queue to keep track of those windows, that is passed around stealing
ownership, while we protect for unmanaged queued windows.
Also, reduce the default timeout value, as the previous one might lead to an
excessive long wait.
Added metatests verifying these situations.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/660
https://gitlab.gnome.org/GNOME/mutter/merge_requests/669
2019-07-03 10:04:08 +00:00
|
|
|
'closed-transient-no-input-parents',
|
|
|
|
'closed-transient-no-input-parents-queued-default-focus-destroyed',
|
|
|
|
'closed-transient-only-take-focus-parents',
|
2018-11-14 01:36:35 +00:00
|
|
|
'minimized',
|
|
|
|
'mixed-windows',
|
|
|
|
'set-parent',
|
|
|
|
'override-redirect',
|
2019-10-29 03:22:19 +00:00
|
|
|
'set-override-redirect-parent',
|
2018-11-14 01:36:35 +00:00
|
|
|
'set-parent-exported',
|
2020-04-02 14:20:34 +00:00
|
|
|
'restore-size',
|
2020-04-02 16:22:34 +00:00
|
|
|
'unmaximize-new-size',
|
2020-04-02 16:28:24 +00:00
|
|
|
'fullscreen-maximize',
|
2021-10-29 19:34:09 +00:00
|
|
|
'unfullscreen-strut-change',
|
2020-04-02 17:26:16 +00:00
|
|
|
'restore-position',
|
2020-04-06 10:12:02 +00:00
|
|
|
'default-size',
|
2020-12-16 22:27:19 +00:00
|
|
|
'modals',
|
2021-07-02 08:14:48 +00:00
|
|
|
'map-fixed-size',
|
2021-11-18 16:24:55 +00:00
|
|
|
'client-resize-respect-constraints',
|
2022-08-03 21:10:00 +00:00
|
|
|
'map-on-hotplug',
|
2022-07-07 13:47:10 +00:00
|
|
|
'workspace-basic',
|
|
|
|
'workspace-test',
|
2022-07-09 10:30:23 +00:00
|
|
|
'always-on-top',
|
2022-07-13 16:21:56 +00:00
|
|
|
'focus-default-window-globally-active-input',
|
2023-01-04 02:46:33 +00:00
|
|
|
'workspace-unmanaging-window',
|
2022-12-07 20:28:45 +00:00
|
|
|
'click-to-focus-and-raise',
|
2022-12-07 22:05:29 +00:00
|
|
|
'workspace-only-on-primary-focus',
|
2018-11-14 01:36:35 +00:00
|
|
|
]
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
|
2018-11-14 01:36:35 +00:00
|
|
|
foreach stacking_test: stacking_tests
|
|
|
|
test(stacking_test, test_runner,
|
|
|
|
suite: ['core', 'mutter/stacking'],
|
|
|
|
env: test_env,
|
|
|
|
args: [
|
2023-05-04 11:49:59 +00:00
|
|
|
files('stacking' / stacking_test + '.metatest'),
|
2018-11-14 01:36:35 +00:00
|
|
|
],
|
|
|
|
is_parallel: false,
|
|
|
|
timeout: 60,
|
|
|
|
)
|
2022-12-18 13:28:40 +00:00
|
|
|
|
|
|
|
if have_installed_tests
|
|
|
|
installed_tests_cdata = configuration_data()
|
|
|
|
installed_tests_cdata.set('apiversion', libmutter_api_version)
|
|
|
|
installed_tests_cdata.set('libexecdir', libexecdir)
|
|
|
|
installed_tests_cdata.set('tests_datadir', tests_datadir)
|
|
|
|
installed_tests_cdata.set('stacking_test', stacking_test)
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
input: 'stacking.test.in',
|
|
|
|
output: stacking_test + '.test',
|
|
|
|
configuration: installed_tests_cdata,
|
|
|
|
install: true,
|
|
|
|
install_dir: mutter_installed_tests_datadir,
|
|
|
|
)
|
|
|
|
endif
|
2018-11-14 01:36:35 +00:00
|
|
|
endforeach
|
Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.
There are some differences between the autotools setup and the new
meson. Here are a few:
The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.
The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.
Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-05-22 13:55:35 +00:00
|
|
|
|
2021-12-13 09:39:45 +00:00
|
|
|
if have_kvm_tests or have_tty_tests
|
2022-01-28 16:32:58 +00:00
|
|
|
privileged_tests = []
|
|
|
|
foreach test_case: privileged_test_cases
|
2021-06-28 09:51:57 +00:00
|
|
|
if test_case.has_key('variants')
|
|
|
|
variants = test_case['variants']
|
|
|
|
else
|
|
|
|
variants = [['', test_env_variables, []]]
|
|
|
|
endif
|
|
|
|
|
2022-01-28 16:32:58 +00:00
|
|
|
test_executable = executable('mutter-' + test_case['name'],
|
|
|
|
sources: test_case['sources'],
|
|
|
|
include_directories: tests_includes,
|
2022-04-28 14:09:11 +00:00
|
|
|
c_args: [
|
|
|
|
tests_c_args,
|
|
|
|
'-DG_LOG_DOMAIN="mutter-@0@-test"'.format(test_case['name']),
|
|
|
|
],
|
2022-06-10 21:21:10 +00:00
|
|
|
dependencies: [
|
|
|
|
libmutter_test_dep,
|
|
|
|
drm_mock_dep
|
|
|
|
],
|
2022-01-28 16:32:58 +00:00
|
|
|
install: have_installed_tests,
|
|
|
|
install_dir: mutter_installed_tests_libexecdir,
|
2022-08-17 15:47:49 +00:00
|
|
|
install_rpath: pkglibdir,
|
2022-01-28 16:32:58 +00:00
|
|
|
)
|
2021-06-28 09:51:57 +00:00
|
|
|
|
|
|
|
foreach variant: variants
|
|
|
|
variant_env = environment()
|
|
|
|
foreach name, value: variant[1]
|
|
|
|
variant_env.set(name, value)
|
|
|
|
endforeach
|
|
|
|
privileged_tests += [
|
|
|
|
{
|
|
|
|
'name': '@0@@1@'.format(test_case['name'], variant[0]),
|
|
|
|
'suite': test_case['suite'],
|
|
|
|
'executable': test_executable,
|
|
|
|
'variables': variant[1],
|
|
|
|
'env': variant_env,
|
|
|
|
},
|
|
|
|
]
|
|
|
|
endforeach
|
2022-01-28 16:32:58 +00:00
|
|
|
endforeach
|
2021-12-10 22:49:48 +00:00
|
|
|
|
|
|
|
if have_kvm_tests
|
|
|
|
subdir('kvm')
|
|
|
|
endif
|
2021-12-13 09:39:45 +00:00
|
|
|
|
|
|
|
if have_tty_tests
|
2022-01-28 16:32:58 +00:00
|
|
|
foreach test_case: privileged_tests
|
|
|
|
test('tty-' + test_case['name'], test_case['executable'],
|
|
|
|
suite: ['core', 'mutter/tty', 'mutter/tty/' + test_case['suite']],
|
2021-06-28 09:51:57 +00:00
|
|
|
env: test_case['env'],
|
2021-12-13 09:39:45 +00:00
|
|
|
is_parallel: false,
|
|
|
|
timeout: 60,
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
endif
|
2021-01-19 16:48:04 +00:00
|
|
|
endif
|
2022-05-27 15:12:46 +00:00
|
|
|
|
|
|
|
if have_x11
|
2023-05-24 12:39:55 +00:00
|
|
|
foreach mode: ['', 'sync']
|
|
|
|
x11_env = test_env
|
|
|
|
if mode == 'sync'
|
|
|
|
x11_env.set('MUTTER_SYNC', '1')
|
|
|
|
endif
|
|
|
|
test('x11' + (mode != '' ? '-' + mode : ''), xvfb,
|
|
|
|
args: [
|
|
|
|
xvfb_args,
|
|
|
|
find_program('x11-test.sh').full_path(),
|
|
|
|
mutter.full_path(),
|
|
|
|
],
|
|
|
|
depends: [
|
|
|
|
mutter,
|
|
|
|
default_plugin,
|
|
|
|
x11_frames,
|
|
|
|
],
|
|
|
|
env: x11_env,
|
|
|
|
suite: ['core', 'mutter/x11'],
|
|
|
|
is_parallel: false,
|
|
|
|
timeout: 60,
|
|
|
|
)
|
|
|
|
endforeach
|
2022-05-27 15:12:46 +00:00
|
|
|
endif
|
2022-06-01 11:30:27 +00:00
|
|
|
|
2022-06-27 08:41:35 +00:00
|
|
|
tools_test_env = test_env
|
|
|
|
tools_test_env.set('G_DEBUG', 'fatal-warnings')
|
|
|
|
|
2022-06-27 08:40:57 +00:00
|
|
|
test('get-state-tool-gio', mutter,
|
2022-06-01 11:30:27 +00:00
|
|
|
args: [
|
|
|
|
'--headless',
|
|
|
|
'--mutter-plugin=@0@'.format(default_plugin.full_path()),
|
|
|
|
'--virtual-monitor', '800x600',
|
2022-06-27 08:41:35 +00:00
|
|
|
'--wayland-display', 'get-state-gio',
|
2022-06-01 11:30:27 +00:00
|
|
|
get_state_tool.full_path(),
|
|
|
|
],
|
2023-06-23 19:34:27 +00:00
|
|
|
depends: [
|
|
|
|
default_plugin,
|
|
|
|
],
|
2022-06-01 11:30:27 +00:00
|
|
|
suite: ['tools'],
|
2022-06-27 08:41:35 +00:00
|
|
|
env: tools_test_env,
|
2022-06-01 11:30:27 +00:00
|
|
|
is_parallel: false,
|
|
|
|
timeout: 60,
|
|
|
|
)
|
2022-06-27 08:40:57 +00:00
|
|
|
|
|
|
|
test('get-state-tool-gdbus', mutter,
|
|
|
|
args: [
|
|
|
|
'--headless',
|
|
|
|
'--mutter-plugin=@0@'.format(default_plugin.full_path()),
|
|
|
|
'--virtual-monitor', '800x600',
|
2022-06-27 08:41:35 +00:00
|
|
|
'--wayland-display', 'get-state-gdbus',
|
2022-06-27 08:40:57 +00:00
|
|
|
'--',
|
|
|
|
get_state_tool.full_path(),
|
|
|
|
'--gdbus',
|
|
|
|
],
|
2023-06-23 19:34:27 +00:00
|
|
|
depends: [
|
|
|
|
default_plugin,
|
|
|
|
],
|
2022-06-27 08:40:57 +00:00
|
|
|
suite: ['tools'],
|
2022-06-27 08:41:35 +00:00
|
|
|
env: tools_test_env,
|
2022-06-27 08:40:57 +00:00
|
|
|
is_parallel: false,
|
|
|
|
timeout: 60,
|
|
|
|
)
|