From 04616d5cff135a3f2fa0dcd99c3d756b67312daa Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Wed, 14 Oct 2026 14:07:19 +0300 Subject: Test pre-init public API, header portability and integration requests Add tests/common/test_public_api.c: before yasl_init, argument errors are reported first, owner-thread calls fail with ENODEV, queries return their documented fallbacks, yasl_drop_next_path parses a crafted text/uri-list, yasl_get_system_string follows its length and NUL rules, and yasl_wake is a no-op with no display. Build tests/test_header_c11.c as strict C11 and C17 with -pedantic-errors. Extend the surface integration test, run on weston and Xwayland, with title, window requests, bell, desktop queries, drag cancel, input-less move/menu/drag calls, a popup (its parent's destroy must also remove it, checked through the display's surface list), and a clipboard round trip. Run tests/x11/test_input.c in the X11 phase of run_surfaces.py through an optional trailing argument. Co-Authored-By: Claude Haiku 5.5 --- tests/meson.build | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tests/meson.build') diff --git a/tests/meson.build b/tests/meson.build index 7e1940e..4a0f492 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -6,6 +6,14 @@ foreach kind : ['static', 'shared'] public_test = executable('yasl-' + kind + '-api-test', 'test_lifecycle.c', dependencies: dep) test(kind + '-api', public_test) endforeach +pre_init_test = executable('yasl-public-api-test', 'common/test_public_api.c', dependencies: yasl_dep) +test('public-api', pre_init_test) +foreach std : ['c11', 'c17'] + header_test = executable('yasl-header-' + std + '-test', 'test_header_c11.c', + include_directories: include_directories('../include'), + c_args: ['-pedantic-errors'], override_options: ['c_std=' + std]) + test('header-' + std, header_test) +endforeach if add_languages('cpp', native: false, required: false) cpp_api = executable('yasl-cpp-api-test', 'test_api.cpp', dependencies: shared_dep, cpp_args: ['-pedantic-errors', @@ -76,6 +84,11 @@ if has_x11 test('tablet-x11-native', python, args: [files('helpers/run_x11_tablet.py'), xorg, native_tablet], timeout: 30) endif endif +x11_input_args = [] +if has_x11 and get_option('integration_tests') + x11_input_args += [executable('yasl-input-x11-test', 'x11/test_input.c', + include_directories: inc, dependencies: yasl_dep)] +endif if get_option('integration_tests') display_test_sources = has_cocoa ? files('cocoa/display.m') : [] integration = executable('yasl-surface-integration', ['common/test_surface_integration.c'] + display_test_sources, @@ -93,7 +106,8 @@ if get_option('integration_tests') weston = find_program('weston') xwayland = find_program('Xwayland') test('surface-backends', python, args: [files('helpers/run_surfaces.py'), weston, xwayland, - integration, hello_example, tablet_example, gl_integration, vulkan_integration, notepad_example], timeout: 120) + integration, hello_example, tablet_example, gl_integration, vulkan_integration, notepad_example] + + x11_input_args, timeout: 120) if has_wayland and has_egl reconnect = executable('yasl-reconnect-test', 'wayland/test_reconnect.c', dependencies: yasl_dep, c_args: ['-DTEST_VULKAN=' + (has_vulkan ? '1' : '0')]) -- cgit v1.2.3