From cbc9f68dd6e7928109d1cb4b3e962b0a1c6c66b3 Mon Sep 17 00:00:00 2001 From: deepend-tildeclub Date: Thu, 18 Jun 2026 18:57:49 -0600 Subject: [PATCH] Isolate GTK3 settings test data home + use xwayland-run --- packaging/fedora/zoitechat.spec | 5 +++-- src/fe-gtk/theme/tests/test-theme-gtk3-settings.c | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packaging/fedora/zoitechat.spec b/packaging/fedora/zoitechat.spec index 85bfcca2..0f17b2ba 100644 --- a/packaging/fedora/zoitechat.spec +++ b/packaging/fedora/zoitechat.spec @@ -16,7 +16,8 @@ BuildRequires: perl-devel BuildRequires: python3 BuildRequires: python3-cffi BuildRequires: publicsuffix-list -BuildRequires: xorg-x11-server-Xvfb +BuildRequires: xwayland-run +BuildRequires: weston BuildRequires: pkgconfig(ayatana-appindicator3-0.1) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(gio-2.0) >= 2.36.0 @@ -70,7 +71,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/net.zoite.Zoitechat.d appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/net.zoite.Zoitechat.appdata.xml appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/net.zoite.Zoitechat*.metainfo.xml -xvfb-run -a /usr/bin/meson test -C %{_vpath_builddir} --num-processes %{_smp_build_ncpus} --print-errorlogs \ +xwfb-run -- /usr/bin/meson test -C %{_vpath_builddir} --num-processes %{_smp_build_ncpus} --print-errorlogs \ "Theme Manager Dispatch Routing Tests" \ "Validate net.zoite.Zoitechat.desktop" \ "Theme GTK3 Settings Tests" \ diff --git a/src/fe-gtk/theme/tests/test-theme-gtk3-settings.c b/src/fe-gtk/theme/tests/test-theme-gtk3-settings.c index 55d56ce0..dec47ac6 100644 --- a/src/fe-gtk/theme/tests/test-theme-gtk3-settings.c +++ b/src/fe-gtk/theme/tests/test-theme-gtk3-settings.c @@ -35,6 +35,7 @@ struct zoitechatprefs prefs; static gboolean gtk_available; static char *temp_root; +static char *xdg_data_home; static char *theme_parent_root; static char *theme_child_root; static char *theme_switch_root; @@ -205,6 +206,10 @@ setup_themes (void) temp_root = g_dir_make_tmp ("zoitechat-theme-gtk3-settings-XXXXXX", NULL); g_assert_nonnull (temp_root); + xdg_data_home = g_build_filename (temp_root, "data", NULL); + g_assert_cmpint (g_mkdir_with_parents (xdg_data_home, 0700), ==, 0); + g_setenv ("XDG_DATA_HOME", xdg_data_home, TRUE); + theme_parent_root = g_build_filename (temp_root, "parent", NULL); theme_child_root = g_build_filename (temp_root, "child", NULL); theme_switch_root = g_build_filename (temp_root, "switch", NULL); @@ -253,10 +258,12 @@ teardown_themes (void) g_free (theme_parent_root); g_free (theme_child_root); g_free (theme_switch_root); + g_free (xdg_data_home); g_free (temp_root); theme_parent_root = NULL; theme_child_root = NULL; theme_switch_root = NULL; + xdg_data_home = NULL; temp_root = NULL; } @@ -328,8 +335,8 @@ main (int argc, char **argv) int rc; g_test_init (&argc, &argv, NULL); - gtk_available = gtk_init_check (&argc, &argv); setup_themes (); + gtk_available = gtk_init_check (&argc, &argv); g_test_add_func ("/theme/gtk3/settings_layer_precedence", test_settings_layer_precedence); g_test_add_func ("/theme/gtk3/settings_restored_on_disable_and_switch", test_settings_restored_on_disable_and_switch);