1 Star 0 Fork 8

ocs-commit-check/glib2

forked from OpenCloudOS Stream/glib2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
8c3fda5c8d38601b6115b29e5a5e83ed9446ba39.patch 4.16 KB
一键复制 编辑 原始数据 按行查看 历史
ocs-bot 提交于 2024-12-25 17:00 . - Apply patches from rpm-tracker
From 8c3fda5c8d38601b6115b29e5a5e83ed9446ba39 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@gnome.org>
Date: Tue, 10 Dec 2024 11:47:43 +0000
Subject: [PATCH] tests: Skip unsupported dbus-appinfo test on GNU/Hurd for the
moment
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Parts of the `dbus-appinfo` test need support for converting an FD to a
path, and Hurd doesn’t currently allow that (see
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4396#note_2279923).
Since there’s no fix for that visible in the medium term (new kernel
APIs will need to be added), skip parts of the `dbus-appinfo` test which
require that functionality for now.
This prevents the whole test from failing, and means we can usefully get
results from the parts of it which don’t depend on converting FDs to
paths.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3538
---
gio/tests/dbus-appinfo.c | 24 ++++++++++++++++++++++++
gio/tests/fake-desktop-portal.c | 12 ++++++++++++
gio/tests/fake-desktop-portal.h | 2 ++
3 files changed, 38 insertions(+)
diff --git a/gio/tests/dbus-appinfo.c b/gio/tests/dbus-appinfo.c
index d2f8e50749..bd18877e8c 100644
--- a/gio/tests/dbus-appinfo.c
+++ b/gio/tests/dbus-appinfo.c
@@ -532,6 +532,12 @@ test_portal_open_file (void)
char *uri;
GFakeDesktopPortalThread *thread = NULL;
+ if (!g_fake_desktop_portal_is_supported ())
+ {
+ g_test_skip ("fake-desktop-portal not currently supported on this platform");
+ return;
+ }
+
/* Run a fake-desktop-portal */
thread = g_fake_desktop_portal_thread_new (session_bus_get_address ());
g_fake_desktop_portal_thread_run (thread);
@@ -567,6 +573,12 @@ test_portal_open_uri (void)
const char *uri = "http://example.com";
GFakeDesktopPortalThread *thread = NULL;
+ if (!g_fake_desktop_portal_is_supported ())
+ {
+ g_test_skip ("fake-desktop-portal not currently supported on this platform");
+ return;
+ }
+
/* Run a fake-desktop-portal */
thread = g_fake_desktop_portal_thread_new (session_bus_get_address ());
g_fake_desktop_portal_thread_run (thread);
@@ -611,6 +623,12 @@ test_portal_open_file_async (void)
char *uri;
GFakeDesktopPortalThread *thread = NULL;
+ if (!g_fake_desktop_portal_is_supported ())
+ {
+ g_test_skip ("fake-desktop-portal not currently supported on this platform");
+ return;
+ }
+
/* Run a fake-desktop-portal */
thread = g_fake_desktop_portal_thread_new (session_bus_get_address ());
g_fake_desktop_portal_thread_run (thread);
@@ -649,6 +667,12 @@ test_portal_open_uri_async (void)
const char *uri = "http://example.com";
GFakeDesktopPortalThread *thread = NULL;
+ if (!g_fake_desktop_portal_is_supported ())
+ {
+ g_test_skip ("fake-desktop-portal not currently supported on this platform");
+ return;
+ }
+
/* Run a fake-desktop-portal */
thread = g_fake_desktop_portal_thread_new (session_bus_get_address ());
g_fake_desktop_portal_thread_run (thread);
diff --git a/gio/tests/fake-desktop-portal.c b/gio/tests/fake-desktop-portal.c
index cb38b9ddcd..67652c5a46 100644
--- a/gio/tests/fake-desktop-portal.c
+++ b/gio/tests/fake-desktop-portal.c
@@ -494,3 +494,15 @@ g_fake_desktop_portal_thread_stop (GFakeDesktopPortalThread *self)
g_cancellable_cancel (self->cancellable);
g_thread_join (g_steal_pointer (&self->thread));
}
+
+/* Whether fake-desktop-portal is supported on this platform. This basically
+ * means whether _g_fd_query_path() will work at runtime. */
+gboolean
+g_fake_desktop_portal_is_supported (void)
+{
+#ifdef __GNU__
+ return FALSE;
+#else
+ return TRUE;
+#endif
+}
diff --git a/gio/tests/fake-desktop-portal.h b/gio/tests/fake-desktop-portal.h
index 72f1180585..1af91ca5ab 100644
--- a/gio/tests/fake-desktop-portal.h
+++ b/gio/tests/fake-desktop-portal.h
@@ -33,6 +33,8 @@ const gchar *g_fake_desktop_portal_thread_get_last_request_activation_token (GFa
void g_fake_desktop_portal_thread_run (GFakeDesktopPortalThread *self);
void g_fake_desktop_portal_thread_stop (GFakeDesktopPortalThread *self);
+gboolean g_fake_desktop_portal_is_supported (void);
+
G_END_DECLS
#endif /* __FAKE_DESKTOP_PORTAL_H__ */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ocs-commit-check/glib2.git
git@gitee.com:ocs-commit-check/glib2.git
ocs-commit-check
glib2
glib2
master

搜索帮助