commit:     4813cf4d608daced07623cdcd783fdc7b0a82186
Author:     Peter Levine <plevine457 <AT> gmail <DOT> com>
AuthorDate: Sun Aug 25 23:26:04 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Oct 13 11:40:23 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4813cf4d

app-office/gnucash: Fix testcase failures

test-qof and test-gnc-numeric both depend on the existence of
en_US, en_GB, and fr_FR locales and fail if not installed.
Check the output of `locale -a` and disable the tests if not found.

Package-Manager: Portage-2.3.72, Repoman-2.3.17
Signed-off-by: Peter Levine <plevine457 <AT> gmail.com>
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 app-office/gnucash/gnucash-3.6.ebuild | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/app-office/gnucash/gnucash-3.6.ebuild 
b/app-office/gnucash/gnucash-3.6.ebuild
index 00c0d0fd915..ec42d91eaae 100644
--- a/app-office/gnucash/gnucash-3.6.ebuild
+++ b/app-office/gnucash/gnucash-3.6.ebuild
@@ -122,6 +122,26 @@ src_test() {
                   "${BUILD_DIR}"/common/test-core/ || die
        fi
 
+       LOCALE_TESTS=
+       if type locale >/dev/null 2>&1; then
+               MY_LOCALES="$(locale -a)"
+               if [[ "${MY_LOCALES}" != *en_US* ||
+                               "${MY_LOCALES}" != *en_GB* ||
+                               "${MY_LOCALES}" != *fr_FR* ]] ; then
+                       ewarn "Missing one or more of en_US, en_GB, or fr_FR 
locales."
+               else
+                       LOCALE_TESTS=true
+               fi
+       else
+               ewarn "'locale' not found."
+       fi
+
+       if [[ ! ${LOCALE_TESTS} ]]; then
+               ewarn "Disabling test-qof and test-gnc-numeric."
+               echo 'set(CTEST_CUSTOM_TESTS_IGNORE test-qof test-gnc-numeric)' 
\
+                       > "${BUILD_DIR}"/CTestCustom.cmake || die
+       fi
+
        cd "${BUILD_DIR}" || die
        XDG_DATA_HOME="${T}/$(whoami)" emake check
 }

Reply via email to