2 * Copyright 2019 Collabora, Ltd.
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial
14 * portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 #ifndef WESTON_TEST_FIXTURE_COMPOSITOR_H
27 #define WESTON_TEST_FIXTURE_COMPOSITOR_H
29 #include <wayland-client-protocol.h>
30 #include <libweston/libweston.h>
32 #include "weston-testsuite-data.h"
34 /** Weston renderer type
36 * \sa compositor_setup
37 * \ingroup testharness
40 /** Dummy renderer that does nothing. */
42 /** Pixman-renderer */
48 /** Weston shell plugin
50 * \sa compositor_setup
51 * \ingroup testharness
54 /** Desktop test-shell with predictable window placement and
55 * no helper clients */
56 SHELL_TEST_DESKTOP = 0,
57 /** The full desktop shell. */
61 /** The fullscreen-shell. */
65 /** Weston compositor configuration
67 * This structure determines the Weston compositor command line arguments.
68 * You should always use compositor_setup_defaults() to initialize this, then
69 * override any members you need with assignments.
71 * \ingroup testharness
73 struct compositor_setup {
74 /** The test suite quirks. */
75 struct weston_testsuite_quirks test_quirks;
76 /** The backend to use. */
77 enum weston_compositor_backend backend;
78 /** The renderer to use. */
79 enum renderer_type renderer;
80 /** The shell plugin to use. */
81 enum shell_type shell;
82 /** Whether to enable xwayland support. */
84 /** Default output width. */
86 /** Default output height. */
88 /** Default output scale. */
90 /** Default output transform, one of WL_OUTPUT_TRANSFORM_*. */
91 enum wl_output_transform transform;
92 /** The absolute path to \c weston.ini to use,
93 * or NULL for \c --no-config . */
94 const char *config_file;
95 /** Full path to an extra plugin to load, or NULL for none. */
96 const char *extra_module;
97 /** Debug scopes for the compositor log,
98 * or NULL for compositor defaults. */
99 const char *logging_scopes;
100 /** The name of this test program, used as a unique identifier. */
101 const char *testset_name;
105 compositor_setup_defaults_(struct compositor_setup *setup,
106 const char *testset_name);
108 /** Initialize compositor setup to defaults
110 * \param s The variable to initialize.
113 * - backend: headless
115 * - shell: desktop shell
120 * - transform: WL_OUTPUT_TRANSFORM_NORMAL
121 * - config_file: none
122 * - extra_module: none
123 * - logging_scopes: compositor defaults
124 * - testset_name: the test name from meson.build
126 * \ingroup testharness
128 #define compositor_setup_defaults(s) do {\
129 compositor_setup_defaults_(s, THIS_TEST_NAME); \
133 execute_compositor(const struct compositor_setup *setup,
134 struct wet_testsuite_data *data);
136 #endif /* WESTON_TEST_FIXTURE_COMPOSITOR_H */