mirror of
https://github.com/brl/mutter.git
synced 2024-12-04 13:50:41 -05:00
efb0addb62
Test the two modes of MetaAnonymousFile, MAPMODE_SHARED and MAPMODE_PRIVATE and make sure they don't leak data to other FDs when writing to an FD provided by `meta_anonymous_file_get_fd` even though the data of both FDs is residing in the same chunk of memory. We do all the reading tests using mmap instead of read() since using read() on shared FDs is going to move the read cursor of the fd. That means using read() once on the shared FD returned by meta_anonymous_file_get_fd() in MAPMODE_PRIVATE breaks every subsequent read() call. Also test the fallback code of MetaAnonymousFile in case `memfd_create` isn't used for the same issues. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1012
78 lines
1.7 KiB
Meson
78 lines
1.7 KiB
Meson
wayland_test_client_installed_tests_libexecdir = join_paths(
|
|
mutter_installed_tests_libexecdir,
|
|
'wayland-test-clients',
|
|
)
|
|
|
|
test_driver_server_header = custom_target(
|
|
'test-driver server header',
|
|
input: 'test-driver.xml',
|
|
output: 'test-driver-server-protocol.h',
|
|
command: [
|
|
wayland_scanner,
|
|
'server-header',
|
|
'@INPUT@', '@OUTPUT@',
|
|
]
|
|
)
|
|
|
|
test_driver_client_header = custom_target(
|
|
'test-driver client header',
|
|
input: 'test-driver.xml',
|
|
output: 'test-driver-client-protocol.h',
|
|
command: [
|
|
wayland_scanner,
|
|
'client-header',
|
|
'@INPUT@', '@OUTPUT@',
|
|
]
|
|
)
|
|
|
|
test_driver_protocol_code = custom_target(
|
|
'test-driver source',
|
|
input: 'test-driver.xml',
|
|
output: 'test-driver-protocol.c',
|
|
command: [
|
|
wayland_scanner,
|
|
'private-code',
|
|
'@INPUT@', '@OUTPUT@',
|
|
]
|
|
)
|
|
|
|
common_sources = [
|
|
'wayland-test-client-utils.c',
|
|
'wayland-test-client-utils.h',
|
|
wayland_protocol_client_headers,
|
|
wayland_protocol_sources,
|
|
test_driver_client_header,
|
|
test_driver_protocol_code,
|
|
]
|
|
|
|
executable('subsurface-remap-toplevel',
|
|
sources: [
|
|
'subsurface-remap-toplevel.c',
|
|
common_sources,
|
|
],
|
|
include_directories: tests_includepath,
|
|
c_args: tests_c_args,
|
|
dependencies: [
|
|
glib_dep,
|
|
wayland_client_dep,
|
|
],
|
|
install: have_installed_tests,
|
|
install_dir: wayland_test_client_installed_tests_libexecdir,
|
|
)
|
|
|
|
executable('meta-anonymous-file',
|
|
sources: [
|
|
'meta-anonymous-file.c',
|
|
common_sources,
|
|
],
|
|
include_directories: tests_includepath,
|
|
c_args: tests_c_args,
|
|
dependencies: [
|
|
glib_dep,
|
|
wayland_client_dep,
|
|
libmutter_dep,
|
|
],
|
|
install: have_installed_tests,
|
|
install_dir: wayland_test_client_installed_tests_libexecdir,
|
|
)
|