Skip to content

Commit 8ad64ad

Browse files
brunvonlopereneeotten
authored andcommitted
glib-networking: Skip clockid_t test on pre-macOS 10.12
1 parent c58ddff commit 8ad64ad

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

gnome/glib-networking/Portfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ depends_run-append \
3838
path:share/curl/curl-ca-bundle.crt:curl-ca-bundle
3939

4040
patchfiles-append \
41-
patch-disable-gio-querymodules-during-destroot.diff
41+
patch-disable-gio-querymodules-during-destroot.diff \
42+
patch-test_connection_session_resume_ten_minute_expiry.diff
4243

4344
compiler.c_standard 2011
4445

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/meson.build b/meson.build
2+
--- meson.build.orig
3+
+++ meson.build
4+
@@ -79,6 +79,10 @@ backends = []
5+
have_rtld_noload = cc.has_header_symbol('dlfcn.h', 'RTLD_NOLOAD')
6+
config_h.set('HAVE_RTLD_NOLOAD', have_rtld_noload)
7+
8+
+# *** Check for clockid_t ***
9+
+have_clockid_t = cc.has_header_symbol('time.h', 'clockid_t')
10+
+config_h.set('HAVE_CLOCKID_T', have_clockid_t)
11+
+
12+
# *** Checks for GnuTLS ***
13+
gnutls_dep = dependency('gnutls', version: '>= 3.7.4', required: get_option('gnutls'))
14+
15+
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
16+
--- tls/tests/connection.c.orig
17+
+++ tls/tests/connection.c
18+
@@ -585,7 +585,7 @@ read_test_data_async (TestConnection *test)
19+
g_object_unref (stream);
20+
}
21+
22+
-#if defined(G_OS_UNIX)
23+
+#if defined(G_OS_UNIX) && defined(HAVE_CLOCKID_T)
24+
typedef int (*clock_gettime_fnptr)(clockid_t clk_id, struct timespec *tp);
25+
static __thread clock_gettime_fnptr original_clock_gettime = NULL;
26+
27+
@@ -629,7 +629,7 @@ test_connection_session_resume_ten_minute_expiry (TestConnection *test,
28+
GSocketClient *client;
29+
gboolean reused = FALSE;
30+
31+
-#if !defined(G_OS_UNIX)
32+
+#if !defined(G_OS_UNIX) || !defined(HAVE_CLOCKID_T)
33+
g_test_skip ("test_connection_session_resume_ten_minute_expiry requires interposing clock_gettime which is only available in UNIX platforms");
34+
return;
35+
#endif

0 commit comments

Comments
 (0)