public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mart Raudsepp" <leio@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libgweather/, dev-libs/libgweather/files/
Date: Sun, 30 Aug 2020 07:40:12 +0000 (UTC)	[thread overview]
Message-ID: <1598773200.40a698334696b6b915bbbefa349df23cd8ef860c.leio@gentoo> (raw)

commit:     40a698334696b6b915bbbefa349df23cd8ef860c
Author:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 30 07:05:48 2020 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Sun Aug 30 07:40:00 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40a69833

dev-libs/libgweather: fix tests when system has no French locale

Bug: https://bugs.gentoo.org/739592
Package-Manager: Portage-2.3.103, Repoman-2.3.20
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>

 .../libgweather/files/3.36.1-tests-locale.patch    | 52 ++++++++++++++++++++++
 dev-libs/libgweather/libgweather-3.36.1.ebuild     |  1 +
 2 files changed, 53 insertions(+)

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 00000000000..fb35d2f00b7
--- /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
+

diff --git a/dev-libs/libgweather/libgweather-3.36.1.ebuild b/dev-libs/libgweather/libgweather-3.36.1.ebuild
index f3d82c03f4c..0db353126e4 100644
--- a/dev-libs/libgweather/libgweather-3.36.1.ebuild
+++ b/dev-libs/libgweather/libgweather-3.36.1.ebuild
@@ -40,6 +40,7 @@ BDEPEND="
 
 PATCHES=(
 	"${FILESDIR}"/3.32.1-meson-tweaks.patch # Provide introspection optionality and don't build tests that aren't ran automatically
+	"${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
 )
 
 src_prepare() {


             reply	other threads:[~2020-08-30  7:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-30  7:40 Mart Raudsepp [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-15 15:36 [gentoo-commits] repo/gentoo:master commit in: dev-libs/libgweather/, dev-libs/libgweather/files/ Matt Turner
2021-03-27 21:47 Matt Turner
2020-08-30  7:40 Mart Raudsepp
2020-02-08 20:12 Matt Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1598773200.40a698334696b6b915bbbefa349df23cd8ef860c.leio@gentoo \
    --to=leio@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox