mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 14:10:30 +00:00
Merge branch 'better-test-isolation-2' into 'master'
Better test isolation See merge request GNOME/gtk!1391
This commit is contained in:
commit
8703c7b7ac
@ -471,6 +471,14 @@ portal_file_deserializer (GdkContentDeserializer *deserializer)
|
||||
g_object_unref (output);
|
||||
}
|
||||
|
||||
static void
|
||||
connection_closed (GDBusConnection *connection,
|
||||
gboolean remote_peer_vanished,
|
||||
GError *error)
|
||||
{
|
||||
g_clear_object (&file_transfer_proxy);
|
||||
}
|
||||
|
||||
static void
|
||||
got_proxy (GObject *source,
|
||||
GAsyncResult *result,
|
||||
@ -509,6 +517,10 @@ got_proxy (GObject *source,
|
||||
portal_file_deserializer,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
/* Free the singleton when the connection closes, important for test */
|
||||
g_signal_connect (g_dbus_proxy_get_connection (G_DBUS_PROXY (file_transfer_proxy)),
|
||||
"closed", G_CALLBACK (connection_closed), NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -148,7 +148,8 @@ static const GDebugKey gdk_debug_keys[] = {
|
||||
{ "gl-gles", GDK_DEBUG_GL_GLES },
|
||||
{ "gl-debug", GDK_DEBUG_GL_DEBUG },
|
||||
{ "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE },
|
||||
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE }
|
||||
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE },
|
||||
{ "default-settings",GDK_DEBUG_DEFAULT_SETTINGS },
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -63,7 +63,8 @@ typedef enum {
|
||||
GDK_DEBUG_GL_GLES = 1 << 16,
|
||||
GDK_DEBUG_GL_DEBUG = 1 << 17,
|
||||
GDK_DEBUG_VULKAN_DISABLE = 1 << 18,
|
||||
GDK_DEBUG_VULKAN_VALIDATE = 1 << 19
|
||||
GDK_DEBUG_VULKAN_VALIDATE = 1 << 19,
|
||||
GDK_DEBUG_DEFAULT_SETTINGS= 1 << 20
|
||||
} GdkDebugFlags;
|
||||
|
||||
extern guint _gdk_debug_flags;
|
||||
|
@ -81,13 +81,17 @@ parse_boolean (char *v)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_boolean_default (Display *dpy,
|
||||
get_boolean_default (GdkX11Screen *x11_screen,
|
||||
const gchar *option,
|
||||
gboolean *value)
|
||||
{
|
||||
Display *dpy = GDK_SCREEN_XDISPLAY (x11_screen);
|
||||
gchar *v;
|
||||
gint i;
|
||||
|
||||
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (GDK_SCREEN_DISPLAY (x11_screen), DEFAULT_SETTINGS))
|
||||
return FALSE;
|
||||
|
||||
v = XGetDefault (dpy, "Xft", option);
|
||||
if (v)
|
||||
{
|
||||
@ -103,12 +107,16 @@ get_boolean_default (Display *dpy,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_double_default (Display *dpy,
|
||||
get_double_default (GdkX11Screen *x11_screen,
|
||||
const gchar *option,
|
||||
gdouble *value)
|
||||
{
|
||||
Display *dpy = GDK_SCREEN_XDISPLAY (x11_screen);
|
||||
gchar *v, *e;
|
||||
|
||||
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (GDK_SCREEN_DISPLAY (x11_screen), DEFAULT_SETTINGS))
|
||||
return FALSE;
|
||||
|
||||
v = XGetDefault (dpy, "Xft", option);
|
||||
if (v)
|
||||
{
|
||||
@ -126,12 +134,16 @@ get_double_default (Display *dpy,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_integer_default (Display *dpy,
|
||||
get_integer_default (GdkX11Screen *x11_screen,
|
||||
const gchar *option,
|
||||
gint *value)
|
||||
{
|
||||
Display *dpy = GDK_SCREEN_XDISPLAY (x11_screen);
|
||||
gchar *v, *e;
|
||||
|
||||
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (GDK_SCREEN_DISPLAY (x11_screen), DEFAULT_SETTINGS))
|
||||
return FALSE;
|
||||
|
||||
v = XGetDefault (dpy, "Xft", option);
|
||||
if (v)
|
||||
{
|
||||
@ -149,7 +161,6 @@ get_integer_default (Display *dpy,
|
||||
static void
|
||||
init_xft_settings (GdkX11Screen *x11_screen)
|
||||
{
|
||||
Display *xdisplay = GDK_SCREEN_XDISPLAY (x11_screen);
|
||||
double dpi_double;
|
||||
gboolean b;
|
||||
|
||||
@ -158,21 +169,21 @@ init_xft_settings (GdkX11Screen *x11_screen)
|
||||
|
||||
x11_screen->xft_init = TRUE;
|
||||
|
||||
if (!get_boolean_default (xdisplay, "antialias", &b))
|
||||
if (!get_boolean_default (x11_screen, "antialias", &b))
|
||||
b = TRUE;
|
||||
x11_screen->xft_antialias = b;
|
||||
|
||||
if (!get_boolean_default (xdisplay, "hinting", &b))
|
||||
if (!get_boolean_default (x11_screen, "hinting", &b))
|
||||
b = TRUE;
|
||||
x11_screen->xft_hinting = b;
|
||||
|
||||
if (!get_integer_default (xdisplay, "hintstyle", &x11_screen->xft_hintstyle))
|
||||
if (!get_integer_default (x11_screen, "hintstyle", &x11_screen->xft_hintstyle))
|
||||
x11_screen->xft_hintstyle = FC_HINT_MEDIUM;
|
||||
|
||||
if (!get_integer_default (xdisplay, "rgba", &x11_screen->xft_rgba))
|
||||
if (!get_integer_default (x11_screen, "rgba", &x11_screen->xft_rgba))
|
||||
x11_screen->xft_rgba = FC_RGBA_UNKNOWN;
|
||||
|
||||
if (!get_double_default (xdisplay, "dpi", &dpi_double))
|
||||
if (!get_double_default (x11_screen, "dpi", &dpi_double))
|
||||
dpi_double = 96.0;
|
||||
|
||||
x11_screen->xft_dpi = (int)(0.5 + PANGO_SCALE * dpi_double);
|
||||
|
@ -489,7 +489,8 @@ check_manager_window (GdkX11Screen *x11_screen,
|
||||
|
||||
gdk_x11_display_grab (display);
|
||||
|
||||
x11_screen->xsettings_manager_window = XGetSelectionOwner (xdisplay, get_selection_atom (x11_screen));
|
||||
if (!GDK_DISPLAY_DEBUG_CHECK (display, DEFAULT_SETTINGS))
|
||||
x11_screen->xsettings_manager_window = XGetSelectionOwner (xdisplay, get_selection_atom (x11_screen));
|
||||
|
||||
if (x11_screen->xsettings_manager_window != 0)
|
||||
XSelectInput (xdisplay,
|
||||
|
@ -2,7 +2,7 @@ window1
|
||||
"dialog"
|
||||
index: 0
|
||||
name: About FancyPants
|
||||
state: active enabled sensitive showing visible
|
||||
state: enabled sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: dialog
|
||||
<AtkComponent>
|
||||
|
@ -188,7 +188,8 @@ dump_relation_set (GString *string,
|
||||
}
|
||||
|
||||
static void
|
||||
dump_state_set (GString *string,
|
||||
dump_state_set (AtkObject *accessible,
|
||||
GString *string,
|
||||
guint depth,
|
||||
AtkStateSet *set)
|
||||
{
|
||||
@ -202,6 +203,10 @@ dump_state_set (GString *string,
|
||||
g_string_append_printf (string, "%*sstate:", depth, "");
|
||||
for (i = 0; i < ATK_STATE_LAST_DEFINED; i++)
|
||||
{
|
||||
/* The toplevel active state depends on focus interaction with the WM, so lets ignore it */
|
||||
if (ATK_IS_WINDOW (accessible) && i == ATK_STATE_ACTIVE)
|
||||
continue;
|
||||
|
||||
if (atk_state_set_contains_state (set, i))
|
||||
g_string_append_printf (string, " %s", atk_state_type_get_name (i));
|
||||
}
|
||||
@ -694,7 +699,7 @@ dump_accessible (AtkObject *accessible,
|
||||
if (atk_object_get_description (accessible))
|
||||
g_string_append_printf (string, "%*sdescription: %s\n", depth, "", atk_object_get_description (accessible));
|
||||
dump_relation_set (string, depth, atk_object_ref_relation_set (accessible));
|
||||
dump_state_set (string, depth, atk_object_ref_state_set (accessible));
|
||||
dump_state_set (accessible, string, depth, atk_object_ref_state_set (accessible));
|
||||
dump_attribute_set (string, depth, atk_object_get_attributes (accessible));
|
||||
|
||||
if (ATK_IS_COMPONENT (accessible))
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -2,7 +2,7 @@ window1
|
||||
"dialog"
|
||||
index: 0
|
||||
name: Select a Color
|
||||
state: active enabled sensitive showing visible
|
||||
state: enabled sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: dialog
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"frame"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"frame"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"frame"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -56,6 +56,7 @@ foreach t: a11y_state_tests
|
||||
env: [
|
||||
'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"frame"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"frame"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -1,7 +1,7 @@
|
||||
window1
|
||||
"window"
|
||||
index: 0
|
||||
state: active enabled resizable sensitive showing visible
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
window-type: normal
|
||||
<AtkComponent>
|
||||
|
@ -12,6 +12,7 @@ test('change', test_change,
|
||||
args: [ '--tap', '-k' ],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
|
@ -14,6 +14,7 @@ test('api', test_api,
|
||||
args: ['--tap', '-k' ],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
@ -30,6 +31,7 @@ test('data', test_data,
|
||||
args: ['--tap', '-k' ],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
|
@ -9,6 +9,7 @@ test('nodes', test_nodes,
|
||||
args: [ '--tap', '-k' ],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
|
@ -466,6 +466,7 @@ foreach testname : test_data
|
||||
],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
|
@ -1,4 +1,4 @@
|
||||
window.background.solid-csd:dir(ltr)
|
||||
window.background.csd:dir(ltr)
|
||||
decoration:dir(ltr)
|
||||
headerbar.titlebar:dir(ltr)
|
||||
box.horizontal.start:dir(ltr)
|
||||
|
@ -19,6 +19,7 @@ test('style', test_style,
|
||||
args: [ '--tap', '-k' ],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
|
@ -95,15 +95,35 @@ diff_with_file (const char *file1,
|
||||
return output;
|
||||
}
|
||||
|
||||
static char *
|
||||
fixup_style_differences (const char *str)
|
||||
{
|
||||
GRegex *regex;
|
||||
char *result;
|
||||
|
||||
/* normalize differences that creep in from hard-to-control environmental influences */
|
||||
regex = g_regex_new ("[.]solid-csd", 0, 0, NULL);
|
||||
result = g_regex_replace_literal (regex, str, -1, 0, ".csd", 0, NULL);
|
||||
g_regex_unref (regex);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
style_context_changed (GtkWidget *window, const char **output)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
char *str;
|
||||
|
||||
context = gtk_widget_get_style_context (window);
|
||||
|
||||
*output = gtk_style_context_to_string (context, GTK_STYLE_CONTEXT_PRINT_RECURSE |
|
||||
GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE);
|
||||
str = gtk_style_context_to_string (context, GTK_STYLE_CONTEXT_PRINT_RECURSE |
|
||||
GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE);
|
||||
|
||||
*output = fixup_style_differences (str);
|
||||
|
||||
g_free (str);
|
||||
|
||||
g_main_context_wakeup (NULL);
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@ foreach t : tests
|
||||
args: [ '--tap', '-k' ],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
|
@ -91,6 +91,7 @@ foreach renderer : renderers
|
||||
join_paths(meson.current_source_dir(), 'compare', test + '.png')],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
@ -171,6 +172,7 @@ foreach test : node_parser_tests
|
||||
],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
@ -204,6 +206,7 @@ foreach t : tests
|
||||
args: [ '--tap', '-k' ],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'GSK_RENDERER=cairo',
|
||||
|
@ -415,6 +415,19 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
g_type_class_unref (klass);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
dbind_warning_handler (const char *log_domain,
|
||||
GLogLevelFlags log_level,
|
||||
const char *message,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (strcmp (log_domain, "dbind") == 0 &&
|
||||
log_level == (G_LOG_LEVEL_WARNING|G_LOG_FLAG_FATAL))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
@ -423,14 +436,16 @@ main (int argc, char **argv)
|
||||
GTestDBus *bus;
|
||||
GMainLoop *loop;
|
||||
gint result;
|
||||
const char *display, *x_r_d;
|
||||
|
||||
/* These must be set before before gtk_test_init */
|
||||
g_setenv ("GIO_USE_VFS", "local", TRUE);
|
||||
g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);
|
||||
g_setenv ("G_ENABLE_DIAGNOSTIC", "0", TRUE);
|
||||
|
||||
gtk_test_init (&argc, &argv);
|
||||
gtk_test_register_all_types();
|
||||
/* g_test_dbus_up() helpfully clears these, so we have to re-set it */
|
||||
display = g_getenv ("DISPLAY");
|
||||
x_r_d = g_getenv ("XDG_RUNTIME_DIR");
|
||||
|
||||
/* Create one test bus for all tests, as we have a lot of very small
|
||||
* and quick tests.
|
||||
@ -438,6 +453,16 @@ main (int argc, char **argv)
|
||||
bus = g_test_dbus_new (G_TEST_DBUS_NONE);
|
||||
g_test_dbus_up (bus);
|
||||
|
||||
if (display)
|
||||
g_setenv ("DISPLAY", display, TRUE);
|
||||
if (x_r_d)
|
||||
g_setenv ("XDG_RUNTIME_DIR", x_r_d, TRUE);
|
||||
|
||||
g_test_log_set_fatal_handler (dbind_warning_handler, NULL);
|
||||
|
||||
gtk_test_init (&argc, &argv);
|
||||
gtk_test_register_all_types();
|
||||
|
||||
otypes = gtk_test_list_all_types (NULL);
|
||||
for (i = 0; otypes[i]; i++)
|
||||
{
|
||||
|
@ -94,6 +94,7 @@ foreach t : tests
|
||||
args: [ '--tap', '-k' ],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'GSK_RENDERER=cairo',
|
||||
@ -116,6 +117,7 @@ if add_languages('cpp', required: false)
|
||||
args: [ '--tap', '-k' ],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
@ -158,6 +160,7 @@ foreach test : focus_chain_tests
|
||||
join_paths(meson.current_source_dir(), 'focus-chain', test[0] + '.' + test[1]) ],
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
|
@ -101,6 +101,19 @@ test_finalize_object (gconstpointer data)
|
||||
gtk_main();
|
||||
}
|
||||
|
||||
static gboolean
|
||||
dbind_warning_handler (const char *log_domain,
|
||||
GLogLevelFlags log_level,
|
||||
const char *message,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (strcmp (log_domain, "dbind") == 0 &&
|
||||
log_level == (G_LOG_LEVEL_WARNING|G_LOG_FLAG_FATAL))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
@ -108,14 +121,15 @@ main (int argc, char **argv)
|
||||
guint n_types = 0, i;
|
||||
GTestDBus *bus;
|
||||
gint result;
|
||||
const char *display, *x_r_d;
|
||||
|
||||
/* These must be set before before gtk_test_init */
|
||||
g_setenv ("GIO_USE_VFS", "local", TRUE);
|
||||
g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);
|
||||
|
||||
/* initialize test program */
|
||||
gtk_test_init (&argc, &argv);
|
||||
gtk_test_register_all_types ();
|
||||
/* g_test_dbus_up() helpfully clears these, so we have to re-set it */
|
||||
display = g_getenv ("DISPLAY");
|
||||
x_r_d = g_getenv ("XDG_RUNTIME_DIR");
|
||||
|
||||
/* Create one test bus for all tests, as we have a lot of very small
|
||||
* and quick tests.
|
||||
@ -123,6 +137,17 @@ main (int argc, char **argv)
|
||||
bus = g_test_dbus_new (G_TEST_DBUS_NONE);
|
||||
g_test_dbus_up (bus);
|
||||
|
||||
if (display)
|
||||
g_setenv ("DISPLAY", display, TRUE);
|
||||
if (x_r_d)
|
||||
g_setenv ("XDG_RUNTIME_DIR", x_r_d, TRUE);
|
||||
|
||||
g_test_log_set_fatal_handler (dbind_warning_handler, NULL);
|
||||
|
||||
/* initialize test program */
|
||||
gtk_test_init (&argc, &argv);
|
||||
gtk_test_register_all_types ();
|
||||
|
||||
all_types = gtk_test_list_all_types (&n_types);
|
||||
|
||||
for (i = 0; i < n_types; i++)
|
||||
|
@ -445,6 +445,7 @@ foreach testname : testdata
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir),
|
||||
'GTK_CSD=1',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
|
||||
|
@ -21,6 +21,7 @@ if bash.found()
|
||||
workdir: meson.current_build_dir(),
|
||||
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
||||
'GSETTINGS_BACKEND=memory',
|
||||
'GDK_DEBUG=default-settings',
|
||||
'GTK_CSD=1',
|
||||
'G_ENABLE_DIAGNOSTIC=0',
|
||||
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||||
|
Loading…
Reference in New Issue
Block a user