summaryrefslogtreecommitdiff
path: root/dev-libs/libgweather/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-09-02 14:09:07 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-09-02 14:09:07 +0100
commitb17a3ef12038de50228bade1f05502c74e135321 (patch)
tree9026dffec53f92cba48ca9a500a4f778e6304380 /dev-libs/libgweather/files
parent3cf7c3ef441822c889356fd1812ebf2944a59851 (diff)
gentoo resync : 02.09.2020
Diffstat (limited to 'dev-libs/libgweather/files')
-rw-r--r--dev-libs/libgweather/files/3.36.1-autoskip-network-test.patch30
-rw-r--r--dev-libs/libgweather/files/3.36.1-tests-locale.patch52
2 files changed, 82 insertions, 0 deletions
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
new file mode 100644
index 000000000000..d6b3d2f61313
--- /dev/null
+++ b/dev-libs/libgweather/files/3.36.1-autoskip-network-test.patch
@@ -0,0 +1,30 @@
+From f2bacee194ce58aabf5a08752556177bda6ab570 Mon Sep 17 00:00:00 2001
+From: Mart Raudsepp <leio@gentoo.org>
+Date: Sun, 30 Aug 2020 10:35:13 +0300
+Subject: [PATCH] tests: Skip metar tests when METAR_SOURCES couldn't be
+ resolved
+
+---
+ libgweather/test_libgweather.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c
+index 8a21911..ef401f8 100644
+--- a/libgweather/test_libgweather.c
++++ b/libgweather/test_libgweather.c
+@@ -419,6 +419,12 @@ test_metar_weather_stations (void)
+ msg = soup_message_new ("GET", METAR_SOURCES);
+ session = soup_session_new ();
+ soup_session_send_message (session, msg);
++ if (msg->status_code == SOUP_STATUS_CANT_RESOLVE) {
++ g_test_skip ("Could not resolve " METAR_SOURCES " - network sandboxed?");
++ g_object_unref (session);
++ g_object_unref (msg);
++ return;
++ }
+ g_assert (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code));
+ g_object_unref (session);
+ g_assert_nonnull (msg->response_body);
+--
+2.20.1
+
diff --git a/dev-libs/libgweather/files/3.36.1-tests-locale.patch b/dev-libs/libgweather/files/3.36.1-tests-locale.patch
new file mode 100644
index 000000000000..fb35d2f00b7a
--- /dev/null
+++ b/dev-libs/libgweather/files/3.36.1-tests-locale.patch
@@ -0,0 +1,52 @@
+From 8b20cd91a96eae39bafe82ccf444dbc00759ad43 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@gnome.org>
+Date: Mon, 9 Mar 2020 12:21:57 +0000
+Subject: [PATCH] Do not run local-dependent tests with missing locales
+
+Not everyone has all the locales installed all the time, so let's check
+if a locale is available before using it.
+---
+ libgweather/test_libgweather.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c
+index 8a219115..77ee459b 100644
+--- a/libgweather/test_libgweather.c
++++ b/libgweather/test_libgweather.c
+@@ -643,6 +643,7 @@ static void
+ test_location_names (void)
+ {
+ GWeatherLocation *world, *brussels;
++ char *old_locale;
+
+ world = gweather_location_get_world ();
+ g_assert (world);
+@@ -653,7 +654,16 @@ test_location_names (void)
+ g_assert_cmpstr (gweather_location_get_sort_name (brussels), ==, "brussels");
+ g_assert_cmpstr (gweather_location_get_english_name (brussels), ==, "Brussels");
+
++ old_locale = g_strdup (setlocale (LC_ALL, NULL));
+ setlocale (LC_ALL, "fr_FR.UTF-8");
++ if (strstr (setlocale (LC_ALL, NULL), "fr_FR.UTF-8") == NULL)
++ {
++ g_test_skip ("locale fr_FR.UTF-8 not available, skipping localization tests");
++ setlocale (LC_ALL, old_locale);
++ g_free (old_locale);
++ return;
++ }
++
+ _gweather_location_reset_world ();
+
+ world = gweather_location_get_world ();
+@@ -665,7 +675,7 @@ test_location_names (void)
+ g_assert_cmpstr (gweather_location_get_sort_name (brussels), ==, "bruxelles");
+ g_assert_cmpstr (gweather_location_get_english_name (brussels), ==, "Brussels");
+
+- setlocale (LC_ALL, "");
++ setlocale (LC_ALL, old_locale);
+ _gweather_location_reset_world ();
+ }
+
+--
+GitLab
+