main: Add test initialization function

Since Clutter's backend relies on MetaBackend now, initialzation has
to go through meta_init(), both in mutter and in gnome-shell.

However the compositor enum and backend gtype used to enforce the
environment used for tests are private, so instead expose a test
initialization function that can be used from both mutter and
gnome-shell.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/750
This commit is contained in:
Florian Müllner
2019-08-25 17:20:51 +03:00
committed by Jonas Ådahl
parent 556e7694de
commit dc9c5417bc
3 changed files with 25 additions and 9 deletions

View File

@ -86,13 +86,7 @@ G_BEGIN_DECLS
int \
main (int argc, char *argv[]) \
{ \
char *display_name = g_strdup ("mutter-test-display-XXXXXX");\
int fd = g_mkstemp (display_name);\
meta_wayland_override_display_name (display_name);\
meta_override_compositor_configuration (META_COMPOSITOR_TYPE_WAYLAND,\
META_TYPE_BACKEND_X11_NESTED);\
\
meta_init ();\
meta_test_init ();\
\
clutter_test_init (&argc, &argv); \
\
@ -100,8 +94,6 @@ main (int argc, char *argv[]) \
units \
} \
\
close (fd);\
g_free (display_name);\
return clutter_test_run (); \
}