]> Savannah Git Hosting - gnulib.git/commitdiff
quotearg tests: Avoid test failures on Solaris 11.
authorBruno Haible <bruno@clisp.org>
Fri, 1 Jan 2021 14:00:48 +0000 (15:00 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 1 Jan 2021 17:12:01 +0000 (18:12 +0100)
* modules/quotearg-tests (Makefile.am): Set host_os in
TESTS_ENVIRONMENT.
* tests/test-quotearg.sh: On Solaris 11 systems, make a copy of the fr/
directory that contains the .mo file.

ChangeLog
modules/quotearg-tests
tests/test-quotearg.sh

index ec7011e60c330ff367344aec0cf5c2ee77ca1b25..69ca053dfe1e3eff722f5001d6ce645c4493022d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-01-01  Bruno Haible  <bruno@clisp.org>
+
+       quotearg tests: Avoid test failures on Solaris 11.
+       * modules/quotearg-tests (Makefile.am): Set host_os in
+       TESTS_ENVIRONMENT.
+       * tests/test-quotearg.sh: On Solaris 11 systems, make a copy of the fr/
+       directory that contains the .mo file.
+
 2021-01-01  Bruno Haible  <bruno@clisp.org>
 
        maint: Update copyright notices in --version output.
index aed92ce381636518d5e00dc5de93c35fc0686f24..dc94b34afabe05510c19c9dc5451d13e69ba6a2a 100644 (file)
@@ -25,6 +25,8 @@ gt_LOCALE_FR_UTF8
 
 Makefile.am:
 TESTS += test-quotearg.sh
-TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+TESTS_ENVIRONMENT += \
+  LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+  host_os='@host_os@'
 check_PROGRAMS += test-quotearg
 test_quotearg_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIBINTL@ $(LIB_MBRTOWC)
index ae3315356d0e51b9f1ee2cd384d452d8dc0d4e9d..b9978671b9362039164b9005102c0df431df06a0 100755 (executable)
@@ -22,5 +22,30 @@ if test $locale = French_France.1252; then
   locale=fr_FR.CP1252
 fi
 
-LOCALE=$locale LOCALEDIR="$srcdir/testlocale" \
+# Work around a bug on Solaris 11 systems with no GNU gettext installed.
+# See gettext/gettext-tools/tests/init.cfg.
+localedir="$srcdir/testlocale"
+if test $locale != none && test $locale != fr; then
+  case "$host_os" in
+    solaris2.11)
+      mkdir -p testlocale
+      cp -a "$srcdir/testlocale/fr" "testlocale/$locale"
+      localedir="testlocale"
+      ;;
+  esac
+fi
+
+LOCALE=$locale LOCALEDIR="$localedir" \
 ${CHECKER} ./test-quotearg${EXEEXT}
+result=$?
+
+if test $locale != none && test $locale != fr; then
+  case "$host_os" in
+    solaris2.11)
+      rm -rf "testlocale/$locale"
+      rmdir testlocale 2>/dev/null
+      ;;
+  esac
+fi
+
+exit $result