summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests/color-icc-output: add ICC VCGT testsLeandro Ribeiro2023-04-279-13/+74
| | | | | | | | | | | | | | | There are some ICC profiles that contain something named VCGT tag. These are usually power curves (y = x ^ exp) that were loaded in the video card when the ICC profile was created. So the compositor should mimic that in order to use the profile. Weston already has support for that, but our ICC profile tests were missing this case. This adds such tests. For testing purposes, we have added tests with different exponents per color channel. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
* tests/color-icc-output: assert that dimension is not zero when creating clutLeandro Ribeiro2023-04-271-0/+2
| | | | | | | | Without that we may crash when trying to create a PTYPE_CLUT ICC profile with dimension zeroed. This would be wrong, so with this change we are basically validating the test case arguments. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
* tests/color-icc-output: differentiate test name based on ICC profile typeLeandro Ribeiro2023-04-271-6/+6
| | | | | | | For now we have some tests with the same name. Differentiate them based on the ICC profile type that they build: CLUT vs matrix shaper. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
* tests/xwayland: Don't leak XCB replyDaniel Stone2023-04-191-0/+1
| | | | Signed-off-by: Daniel Stone <daniels@collabora.com>
* tests: ivi-shell: prepare for API simplificationMichael Olbrich2023-04-193-384/+63
| | | | | | | | The return values for most of the API functions will be removed and replaced by asserts. So checking return values will no longer work and passing invalid arguments will trigger asserts. Modify and remove the tests accordingly. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* tests: Allow DRM fixture setup to cleanly skipDaniel Stone2023-04-121-28/+22
| | | | | | | | | | Move our DRM test fixture setup later, where we already have a bunch of per-backend splits, so we can choose to skip our tests at the right time. Doing this allows us to skip DRM tests with no memory leaks. Signed-off-by: Daniel Stone <daniels@collabora.com>
* tests: Move prog_args_save() laterDaniel Stone2023-04-121-4/+4
| | | | | | This allows us to append to the arguments later on. Signed-off-by: Daniel Stone <daniels@collabora.com>
* tests/color-icc-output: make use of color debug scopesLeandro Ribeiro2023-04-121-0/+1
| | | | | | | Now that we have color profile, transformation and optimizer debug scopes, make use them in this test. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
* tests: do not leak renderer argumentPekka Paalanen2023-04-111-1/+1
| | | | | | | Noticed by ASan. The strdup() is not necessary, str_printf() returns an allocated string. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests/xwayland-test: Also print out Weston log messagesMarius Vlad2023-03-311-1/+1
| | | | | | | | We don't accumulate log scopes with was previous set internally so enable the "log" scope (explicitly) for the xwayland-test to see what Weston prints out. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* tests/xwayland: Enable xwayland XWM debug log scope and more debugMarius Vlad2023-03-282-2/+2
| | | | | | | | | We're still timing out with our basic xwayland test in CI, so this enables the XWM logging scope, and enables some further print debugs we have available in our helper library, in an attempt to further investigate and determine why we're still timing out. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* tests: add writeback sreenshooter testLeandro Ribeiro2023-03-223-0/+151
| | | | | | | This adds a test to ensure that the DRM-backend writeback screenshooter is working properly. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
* xcb-client-helper: Add a XCB client helper for testsMarius Vlad2023-03-034-63/+1109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a small library wrapper around XCB to be used in Xwayland tests. It's being designed such that we do not advance without accounting for all X11 events when changing the window state. It adds a fence that waits for all events to be processed, and only after all the events have been accounted for, to proceed further, resuming execution of the tests. This works by keeping a tentative_state list for the client and a window state that gets applied when the event we waited for has been received. This is useful in test clients, which could verify at the end after receiving all events that the correct state has been applied. Acts as a way to verify that the we never get or have a different state than the one we expect. With it, this converts test-xwayland to using libxcb (together with xcb-cursor-dev) rather than using Xlib, and with it it removes any Xlib dependency we might have in the tests. This only adds support for map/unmap/create/destroy/property notify. A follow-up would be to expand this library to track window movement and resizing. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* libweston: Use weston_coord in surface committed handlerDerek Foreman2023-02-241-1/+2
| | | | | | | I also snuck in a trivial change to drag_surface_configure at the same time to avoid yet another micro patch. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* libweston: Use weston_coord in struct weston_pointerDerek Foreman2023-02-171-3/+7
| | | | | | | | | | Convert the bare x,y coordinates into struct weston_coord and update all users. We keep the surface position in wl_fixed_t for now so it still exactly matches the position most recently sent to clients. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* input: Convert weston_pointer_motion_event to weston_coordDerek Foreman2023-02-091-3/+2
| | | | | | This struct has a lot of members that can be converted to weston_coord. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* backend: Make input notification functions use weston_coordDerek Foreman2023-02-091-2/+6
| | | | | | | | | | | Push weston_coord into the notification functions instead of passing two doubles. The touch handlers are passed a pointer to a weston_coord, which is unusual. This is done so we can pass a NULL pointer instead of a fabricated invalid coordinate when the touch type is TOUCH_UP. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* tests: Don't send real coordinates with WL_TOUCH_UP eventsDerek Foreman2023-02-092-3/+46
| | | | | | | | | | Wayland protocol can't do this, but the way our test protocol handles touch through a single event can - ensure that we don't by accident. This will matter more shortly when we add assert()s to prevent having coordinates with WL_TOUCH_UP events internally later. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* clipping: Use struct weston_coord in vertex clipping codeDerek Foreman2023-02-091-57/+111
| | | | | | | Remove the independent x, y floats from the clipping code and replace them with struct weston_cord. This includes the polygon8 structure as well. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* compositor: Add dirty bits to paint nodesDerek Foreman2023-02-021-0/+1
| | | | | | | | | We're pushing more and more mutable state into paint nodes, but this state has a non-zero cost to rebuild every render. Let's take care to track when we need to rebuild the state. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* libweston: Use weston_coord space conversion functionsDerek Foreman2023-02-012-34/+46
| | | | | | | Update users of the old coordinate space conversion functions that take x, y pairs to the new weston_coord versions. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* drm-smoke-test: Explicitly set-up the output name DRM testMarius Vlad2023-01-251-1/+1
| | | | | | | | In case we have multiple outputs let's us choose the first output, rather use the last one, which would happen when multiple are present in the system. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* tests: Add the ability the specify the output nameMarius Vlad2023-01-2514-23/+43
| | | | | | | In preparation of having multiple outputs available we should be able to specify by its name. We just use the default one if none was set-up at all. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* tests: use enum weston_renderer_typePhilipp Zabel2023-01-1819-58/+44
| | | | | | | Now that enum weston_renderer_type is public, there is no need for a local enum renderer_type in the tests. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
* matrix-transform-test: Test vector transformsDerek Foreman2023-01-161-0/+55
| | | | | | | | Add an output transform function that doesn't use matrices so we can test our matrix generation by applying it to vectors and comparing with the non-matrix variant. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* tests: add TAP version lineThomas Weißschuh2023-01-101-0/+1
| | | | | | Otherwise new versions of "meson test" will report a warning about every test. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
* frontend: Add common --renderer=foo argumentDaniel Stone2023-01-101-26/+10
| | | | | | | | | | Rather than reinventing --use-pixman and --use-gl throughout each backend, just have a common --renderer=foo argument which can be used to explicitly specify the renderer. The old arguments are still handled for backwards compatibility. Signed-off-by: Daniel Stone <daniels@collabora.com>
* frontend: Use short-form names for shell argumentDaniel Stone2023-01-101-4/+4
| | | | | | | | | | Instead of passing --shell=foo-shell.so, just pass --shell=foo, whilst accepting the old form for compatibility. Whilst we're at it, document the --shell argument in the manpage and README. Signed-off-by: Daniel Stone <daniels@collabora.com>
* shell-utils: Integrate shell-utils into libwestonMarius Vlad2023-01-093-10/+10
| | | | | | | | | | | These shell utils functions are potentially useful to other shells as well, so make them widely available. Renamed all functions to weston_shell_utils namespace. No functional change, copied ad litteram. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* tests: Don't leak single-pixel-buffer factory objectDaniel Stone2022-12-291-0/+1
| | | | Signed-off-by: Daniel Stone <daniels@collabora.com>
* tests: Store output description into correct fieldDaniel Stone2022-12-291-1/+1
| | | | | | | We were storing the output description into the name field, which was harmless but did cause a leak. Signed-off-by: Daniel Stone <daniels@collabora.com>
* compositor: support loading backend via shortened namePhilipp Zabel2022-12-081-5/+6
| | | | | | | | | | | | | | | | | | | | While the --backend parameter looks like it takes a file name, it really is selected from a list of supported strings that are then funneled through a translation to enum weston_compositor_backend [1]. Because all backend parameters are of the form "...-backend.so", and writing "--backend=...-backend.so" is boring, allow the --backend option to match the backend name without "-backend.so" suffix instead. For example, this allows to use "--backend=headless" instead of "--backend=headless-backend.so". Update help text and documentation. Keep the old way working for backwards compatibility. [1] 50dbf385140b ("libweston: use enum to choose the backend") Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
* tests: add output_icc_decorationsPekka Paalanen2022-12-024-0/+40
| | | | | | | | Here are more tests for output decorations drawing, this time through the color-lcms plugin. This is the only practical way to exercise the input-to-output category of color transformations. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: add output-decorationsPekka Paalanen2022-12-025-2/+96
| | | | | | | This adds a new test checking that output decorations (used in the wayland-backend, here tested with headless-backend) are drawn correctly. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: change shot argument type in verify_image()Pekka Paalanen2022-12-024-10/+10
| | | | | | | | | | Only the 'image' field of struct buffer is ever used here, so just pass pixman_image_t instead of struct buffer. This allows a future test to mangle a screenshot (e.g. convert pixel format) before feeding it in. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: rewrite screenshooting to use new protocolPekka Paalanen2022-11-293-44/+136
| | | | | | | | | | | | Migrate the tst suite to using the new screenshooting protocol. This ensures the new protocol and implementation work, and removes a user of the old protocol so that the old protocol can be removed in the future. Now that the compositor chooses the pixel format, capture_screenshot_of_output() needs to convert to the expected format in the tests when necessary. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: add output-capture-protocol testPekka Paalanen2022-11-294-1/+355
| | | | | | | For exercising various code paths in the server side protocol implementation. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: use pixel-formats.h in create_shm_buffer()Pekka Paalanen2022-11-292-6/+16
| | | | | | | | | | Instead of starting yet another hand-crafted pixel format mapping table, use the one we have. Following patches want to be able to create XRGB8888 buffers, and later even other formats. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* matrix-transform-test: Add additional testsDerek Foreman2022-11-251-0/+122
| | | | | | | | Add tests to validate that weston_matrix_to_transform() works properly on the matrices generated by weston_surface_build_buffer_matrix() and weston_output_update_matrix() Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* libweston: Add function to find the output transform of a matrixDerek Foreman2022-11-252-0/+290
| | | | | | | | | | | | | | | When we build up a matrix from a series of operations, it's very useful to know if the combined operations still result in something that matches a wl_output_transform. This adds a function to test if a matrix leads to a standard output transform, and returns the transform if it does. Tests are provided that check if complex series of operations return expected results - the weston_matrix_needs_filtering function is tested at the same time. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* libweston: Send name,description, update wl_output to ver 4Marius Vlad2022-11-102-0/+20
| | | | | | | | | These have been in wayland a while back with version 1.20.0. We also need to update the test client helper with this bump, as those bind to version 4. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* tests: Use weston-test-desktop-shell by defaultDaniel Stone2022-11-042-2/+2
| | | | | | | Spinning up the full desktop-shell is pointless overhead for most tests, which don't need the full load. Signed-off-by: Daniel Stone <daniels@collabora.com>
* tests: Use test-desktop-shell more widelyDaniel Stone2022-11-0414-0/+15
| | | | | | | | There's no need to spin up the full desktop-shell for the vast majority of our tests. Rework them to use weston-test-desktop-shell, which is more lightweight and sensible. Signed-off-by: Daniel Stone <daniels@collabora.com>
* tests: Explicitly use desktop-shell for text-testDaniel Stone2022-11-041-0/+1
| | | | | | | text-test wants to use the real desktop-shell so it can launch the input method. Signed-off-by: Daniel Stone <daniels@collabora.com>
* helpers: Add a u64 from 2 u32 helperDerek Foreman2022-10-271-1/+1
| | | | | | | We do this enough that having a single implementation for it is probably a win. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* tests/color-icc-output: replace dump file nameVitaly Prosyak2022-09-281-2/+2
| | | | | | | | Not a functional change. The replacement of const dump file to use suffix of appropriate sub tests (sRGB->sRGB, sRGB->adobeRGB, etc). Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
* libweston/desktop: Migrate libweston-desktop/libweston-desktop.hMarius Vlad2022-09-231-1/+1
| | | | | | | | | | | With commit 'Move libweston-desktop into libweston' we've moved out libweston-desktop DSO into libweston. Move also the header to libweston/desktop. This removes removes the libweston-desktop pc file and bumps libweston major version to 12. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* Implement wp_single_pixel_buffer_v1 protocolDaniel Stone2022-07-263-0/+119
| | | | | | | | | | | This protocol allows clients to create single-pixel RGBA buffers. Now that we have proper support for these buffers internally within Weston, we can expose them to clients. This bumps the build container version, as we now depend on wayland-protocols v1.26. Signed-off-by: Daniel Stone <daniels@collabora.com>
* custom-env: Add helper to parse combined env/arg stringsDaniel Stone2022-07-191-0/+52
| | | | | | | | | | Users like desktop-shell want to parse a provided string containing a combination of environment and arg, e.g.: ENV=stuff /path/to/thing --good Add support to custom-env for parsing this, with tests, so we can delete the custom implementation inside desktop-shell. Signed-off-by: Daniel Stone <daniels@collabora.com>
* custom-env: Add support for argument arrayDaniel Stone2022-07-191-0/+19
| | | | | | | | | | execve() takes the same form for arguments as environment: an array of constant pointers to mutable strings, terminated by a NULL. To make it easier for users who want to build up their own argument strings to pass to execve, add support for argument arrays to custom_env. Signed-off-by: Daniel Stone <daniels@collabora.com>