app-office/gnucash: Fix testcase failures
authorPeter Levine <plevine457@gmail.com>
Sun, 25 Aug 2019 23:26:04 +0000 (19:26 -0400)
committerAndreas Sturmlechner <asturm@gentoo.org>
Sun, 13 Oct 2019 11:40:23 +0000 (13:40 +0200)
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@gmail.com>
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
app-office/gnucash/gnucash-3.6.ebuild

index 00c0d0fd915ee3a00912644cd308a68aaa8396a0..ec42d91eaae7b7c22298b4d731ac03e63fe86ed3 100644 (file)
@@ -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
 }