Jonas Ådahl
724a7eee74
tests: Move 'wait-for-X11-display' helper to MetaContextTest
...
Gets rid of a un-prefixed helper function relying on a global singleton.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:42:40 +02:00
Jonas Ådahl
e8742be568
tests/test-utils: Remove unused init function
...
This is now dealt with by MetaContextTest.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:42:40 +02:00
Jonas Ådahl
3d5a2b2ffb
context/test: Make type derivable
...
This makes it possible to declare the type in an installed header (so
that e.g. META_CONTEXT_TEST(context) works), but without having to
expose the MetaContextClass struct.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:42:40 +02:00
Jonas Ådahl
acb0a44224
tests: Prefix test plugin name getter with meta_
...
It'll be used via the new shared library, so prefix it.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:42:40 +02:00
Jonas Ådahl
9f1f3139b8
tests/utils: Prefix AsyncWaiter with Meta
...
This too will be used by test cases via a shared library.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:42:40 +02:00
Jonas Ådahl
4a6e22311a
tests/utils: Prefix TestClient with Meta
...
Soon we'll expose it via a libmutter-test library.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:42:40 +02:00
Jonas Ådahl
f74d311d61
tests: Rename test-utils.c/h to meta-test-utils.c/h
...
Otherwise it'll conflict with other files with identical filenames,
if one would add src/tests/ to the include path, which will happen in a
later commit.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:42:39 +02:00
Jonas Ådahl
ff0afb186a
context: Move 'replace-current-wm' tracking to the context
...
This move yet another scattered global static variable into the
context's control.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:34:37 +02:00
Jonas Ådahl
50ed027b6f
context: Move X11 display policy under the context
...
The context implementations already effectively dictate the policy, so
let them do it more directly instead of going indirectly via global
variables.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:34:37 +02:00
Jonas Ådahl
7d116bee0f
main: Move MetaX11DisplayPolicy to a new meta-private-enums.h
...
As with the compositor type enum, also have the X11 display policy enum,
as it's also effectively part of the context configuration. But as with
the compositor type, move it to a header file for enums only, and since
this is a private one, create a private variant meta-enums.h.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:34:36 +02:00
Jonas Ådahl
b1c643eeaa
context: Make the context owner of the backend
...
There is still the `_backend` singleton still, as there are still the
`meta_get_backend()` that needs to work for now.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
1d4224ab07
tests/persistent-virtual-monitor: Port to MetaContext
...
Since this tests the `--virtual-monitor` command line argument, it uses
the `MetaContextMain` variant of the context, as it's there that command
line argument is handled.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
2ac262f138
tests/clutter: Port to MetaContext
...
The clutter tests neeed to start and stop, thus uses their own main loop
instead of the one in MetaContext. Shouldn't matter, since nothing
in mutter should happen that makes the test self-terminate from inside
mutter.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
2f19a5f28d
context/test: Add 'no-x11' and 'test-client' constructor flags
...
The 'no-x11' one will inhibit Xwayland from starting, and 'test-client'
will make sure the test client path is properly discovered.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
07384e18c5
clutter: Remove clutter_init_with_args()
...
Not used anymore.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
2712555c71
display: Don't include sn.h from display-private.h
...
It has some annoying macro requirement to not nag about API stability;
try to limit its exposure.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
383392f963
tests/stage-view-tests: Port to MetaContext
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
648a8b9861
tests/ref-test-sanity: Port to MetaContext
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
f8465906dd
tests/headless-start: Port to MetaContext
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
fbc00a60cf
tests/headless-start: Stop ignoring the missed frame warnings
...
They don't seem to happen anymore.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
d6ae8e7873
tests/test-runner: Port to MetaContext
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
54c9ca7d06
monitor-manager/test: Add default fall back initial config
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
f61c1a1be1
context/test: Add 'run-tests' signal that can replace g_test_run()
...
For tests that doesn't use g_test_run().
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
03242a4e2a
tests/test-runner: Assorted style cleanup
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
e09de6787f
context: Handle dealing with option entries
...
Users can add option entries, and it'll be part of the configuration
phase.
Create the main group manually to be able to set a user_data pointer;
this will be required to not have to rely on globals when parsing
options using a callback.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:21 +02:00
Jonas Ådahl
3d2160b473
tests/unit-tests: Port to MetaContext
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 11:25:20 +02:00
Jonas Ådahl
ccd8da336f
context/test: Add 'before-tests' and 'after-tests' signals
...
Will be used to set up and tear down test infrastructure.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:59:40 +02:00
Jonas Ådahl
bccd93a598
tests/native-headless: Port to MetaContext
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:59:40 +02:00
Jonas Ådahl
82d9dda08a
context/test: Add helper to run a test session
...
Takes care of setup, starting, running, and terminating, as well as
running the GLib test suite.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:59:40 +02:00
Jonas Ådahl
2e784e23a2
context: Add 'notify_ready()' vfunc and method
...
This intends to replace the call to `meta_register_with_session()` that
deals with X11 session management, and is called when the user is
"ready". In thet test context, doing that makes no sense, so make it a
no-op.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:59:40 +02:00
Jonas Ådahl
4cd1154b3d
context/test: Respect MUTTER_SYNC envvar
...
It just calls meta_set_syncing() accordingly. Is currently done by
meta_init() either when the env var is set, or when a command line
argument is passed.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:59:40 +02:00
Jonas Ådahl
fddc631599
context/test: Enable 'scale-monitor-framebuffer' backend setting
...
This is done in all tests, so make life easier by doing it here.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:59:40 +02:00
Jonas Ådahl
fe652518af
context: Load plugin during setup phase
...
The plugin must be configured by the context implementation during the
configure phase.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:59:40 +02:00
Jonas Ådahl
75f9085ab9
context: Add setup phase
...
During this phase, the backend is created and configured. Currently only
configured, but will gain more logic that currently main.c does with
various helpers.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:59:40 +02:00
Jonas Ådahl
6e4d3e0f85
context: Add create_backend() vfunc
...
This lets the context implementation create a backend. Will later be
used in a 'setup' phase.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:59:40 +02:00
Jonas Ådahl
434f5e5b7b
context/test: Add test context type enum
...
A test context type will later determine what kind of backend the test
case should use; i.e. whether the nested or headless backend should be
used.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:43:28 +02:00
Jonas Ådahl
8cb177499d
context/test: Configure test setup during configuration
...
This includes setting up the GLib test framework, overriding the X11
and Wayland display names.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:43:28 +02:00
Jonas Ådahl
bbf6d88d54
test-utils: Expose helper for ensuring client path
...
Will be used by the test context to reduce boiler plate.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:43:28 +02:00
Jonas Ådahl
6c6b5b9a48
context: Add entry points for context configuration
...
Configuration is the first step of the lifetime of a context, after
creation; it's here where argc/argv is processed, and it's determined
what kind of compositor, etc, it is going to be.
The tests always run as Wayand compositors, so the configuration is
quite simple, but will involve more steps later on.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:43:28 +02:00
Jonas Ådahl
bf84b2423d
main: Move MetaCompositorType to a new meta-enums.h
...
It'll be part of and owned by MetaContext, intending to replace
`meta_is_wayland_compositor()`, but place it in a new file for public
enums so that it can be used from wherever.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:43:28 +02:00
Jonas Ådahl
e17bf88d5e
tests: Introduce MetaContextTest
...
This introduces a MetaContext implementation aimed to be used for test
cases, with as little boiler plate as possible needed in the test.
It currently doesn't do anything, just fills out the GObject boiler
plate and sets a name.
Build it into every core test, for compilation, even though it isn't
used anywhere yet.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861 >
2021-07-15 10:43:28 +02:00
Ivan Molodetskikh
3aa0e3074f
clutter: Store vblank duration in ClutterFrameClock
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1762 >
2021-07-13 08:09:42 +00:00
Ivan Molodetskikh
e40ff9d8b7
backends/native: Add meta_calculate_drm_mode_vblank_duration_us()
...
Computes the vblank duration from mode timings.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1762 >
2021-07-13 08:09:42 +00:00
Jonas Ådahl
c2c41bbf0a
tests/kms-utils: Add some basic 16:16 fixed tests
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1927 >
2021-07-09 22:40:06 +00:00
Jonas Ådahl
021a401bc8
tests: Move out KMS utils unit tests to its own executable
...
Better to split things up a bit, so one can with more ease run a
specific test.
In the KMS utils case, we don't even need a mutter context, making it
much lighter.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1927 >
2021-07-09 22:40:05 +00:00
Christian Rauch
258b85a5a7
tests: Add test for setting min/max wayland toplevel limits
...
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1716
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1795 >
2021-07-06 09:11:10 +00:00
Jonas Ådahl
8c5b7ddc48
tests/wayland-test-driver: Add generic "sync point" request
...
This can be used by test cases to make sure the compositor tries
something after a known client state.
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1716
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1795 >
2021-07-06 09:11:10 +00:00
Jonas Ådahl
151c80d2ef
tests: Move Wayland test driver helper protocol to its own file
...
While at it, make it a GObject so one can add signals to it.
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1716
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1795 >
2021-07-06 09:11:10 +00:00
Jonas Ådahl
80caf12461
tests/stacking: Add test for initially fixed size windows
...
E.g. map a window maximized or fullscreen.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1912 >
2021-07-05 10:27:58 +00:00
Marco Trevisan (Treviño)
14c8f5f94c
mutter-all.test: Run tests in a environment with display and bus set
...
The mutter tests require to run in a valid environment where a display
is available and a session bus, however currently we rely on the current
environment, and this may lead to unexpected behaviors.
So let's just ensure that a display is running through xvfb-run and
that a session bus is running in a temporary directory.
We also ensure to use the gsettings memory backend, even because by
setting TestEnvironment we ensure that no other env variable is leaked
to the test.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1876 >
2021-05-26 21:23:29 +02:00