1 |
commit: 9714e5edfb5f13d1ae6af6a05d91430578427fc0 |
2 |
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Aug 30 07:39:07 2020 +0000 |
4 |
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Aug 30 07:40:00 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9714e5ed |
7 |
|
8 |
dev-libs/libgweather: automatically skip network test when sandboxed |
9 |
|
10 |
Closes: https://bugs.gentoo.org/739592 |
11 |
Package-Manager: Portage-2.3.103, Repoman-2.3.20 |
12 |
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org> |
13 |
|
14 |
.../files/3.36.1-autoskip-network-test.patch | 30 ++++++++++++++++++++++ |
15 |
dev-libs/libgweather/libgweather-3.36.1.ebuild | 1 + |
16 |
2 files changed, 31 insertions(+) |
17 |
|
18 |
diff --git a/dev-libs/libgweather/files/3.36.1-autoskip-network-test.patch b/dev-libs/libgweather/files/3.36.1-autoskip-network-test.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..d6b3d2f6131 |
21 |
--- /dev/null |
22 |
+++ b/dev-libs/libgweather/files/3.36.1-autoskip-network-test.patch |
23 |
@@ -0,0 +1,30 @@ |
24 |
+From f2bacee194ce58aabf5a08752556177bda6ab570 Mon Sep 17 00:00:00 2001 |
25 |
+From: Mart Raudsepp <leio@g.o> |
26 |
+Date: Sun, 30 Aug 2020 10:35:13 +0300 |
27 |
+Subject: [PATCH] tests: Skip metar tests when METAR_SOURCES couldn't be |
28 |
+ resolved |
29 |
+ |
30 |
+--- |
31 |
+ libgweather/test_libgweather.c | 6 ++++++ |
32 |
+ 1 file changed, 6 insertions(+) |
33 |
+ |
34 |
+diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c |
35 |
+index 8a21911..ef401f8 100644 |
36 |
+--- a/libgweather/test_libgweather.c |
37 |
++++ b/libgweather/test_libgweather.c |
38 |
+@@ -419,6 +419,12 @@ test_metar_weather_stations (void) |
39 |
+ msg = soup_message_new ("GET", METAR_SOURCES); |
40 |
+ session = soup_session_new (); |
41 |
+ soup_session_send_message (session, msg); |
42 |
++ if (msg->status_code == SOUP_STATUS_CANT_RESOLVE) { |
43 |
++ g_test_skip ("Could not resolve " METAR_SOURCES " - network sandboxed?"); |
44 |
++ g_object_unref (session); |
45 |
++ g_object_unref (msg); |
46 |
++ return; |
47 |
++ } |
48 |
+ g_assert (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)); |
49 |
+ g_object_unref (session); |
50 |
+ g_assert_nonnull (msg->response_body); |
51 |
+-- |
52 |
+2.20.1 |
53 |
+ |
54 |
|
55 |
diff --git a/dev-libs/libgweather/libgweather-3.36.1.ebuild b/dev-libs/libgweather/libgweather-3.36.1.ebuild |
56 |
index 0db353126e4..ae7a41a1cc9 100644 |
57 |
--- a/dev-libs/libgweather/libgweather-3.36.1.ebuild |
58 |
+++ b/dev-libs/libgweather/libgweather-3.36.1.ebuild |
59 |
@@ -41,6 +41,7 @@ BDEPEND=" |
60 |
PATCHES=( |
61 |
"${FILESDIR}"/3.32.1-meson-tweaks.patch # Provide introspection optionality and don't build tests that aren't ran automatically |
62 |
"${FILESDIR}"/3.36.1-tests-locale.patch # Don't fail tests when a locale is not present, https://gitlab.gnome.org/GNOME/libgweather/-/merge_requests/58 |
63 |
+ "${FILESDIR}"/3.36.1-autoskip-network-test.patch |
64 |
) |
65 |
|
66 |
src_prepare() { |