bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* quotearg tests: Avoid test failures on Solaris 11
@ 2021-01-01 17:24 Bruno Haible
  2021-01-04  3:03 ` Bruno Haible
  0 siblings, 1 reply; 2+ messages in thread
From: Bruno Haible @ 2021-01-01 17:24 UTC (permalink / raw)
  To: bug-gnulib

A testdir of modules 'quotearg' and 'gettext' fails on Solaris 11
machines that don't have GNU gettext installed. Specifically on
  - Solaris 11.0, 11.3,
  - Solaris 11 OpenIndiana,
  - Solaris 11 OmniOS.

The reason is that Solaris 11 libc has a gettext() function that
supports GNU .mo files, but it does not look them up in all possible
locations in which we install them. It's fixed in Solaris 11.4.
For OpenIndiana, I've reported it at <https://www.illumos.org/issues/13423>.

This patch provides a workaround.


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.

diff --git a/modules/quotearg-tests b/modules/quotearg-tests
index aed92ce..dc94b34 100644
--- a/modules/quotearg-tests
+++ b/modules/quotearg-tests
@@ -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)
diff --git a/tests/test-quotearg.sh b/tests/test-quotearg.sh
index ae33153..b997867 100755
--- a/tests/test-quotearg.sh
+++ b/tests/test-quotearg.sh
@@ -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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: quotearg tests: Avoid test failures on Solaris 11
  2021-01-01 17:24 quotearg tests: Avoid test failures on Solaris 11 Bruno Haible
@ 2021-01-04  3:03 ` Bruno Haible
  0 siblings, 0 replies; 2+ messages in thread
From: Bruno Haible @ 2021-01-04  3:03 UTC (permalink / raw)
  To: bug-gnulib

> 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.

This patch worked for Solaris OpenIndiana and Solaris OmniOS, but not on
Solaris 11.3. On this platform, the 'cp' program does not support the '-a'
option. 'cp -pR' comes closest.


2021-01-03  Bruno Haible  <bruno@clisp.org>

	quotearg tests: Avoid test failures on Solaris 11.3.
	* tests/test-quotearg.sh: Copy the fr/ directory using 'cp -R', not
	'cp -a'.

diff --git a/tests/test-quotearg.sh b/tests/test-quotearg.sh
index b997867..e11b667 100755
--- a/tests/test-quotearg.sh
+++ b/tests/test-quotearg.sh
@@ -29,7 +29,7 @@ if test $locale != none && test $locale != fr; then
   case "$host_os" in
     solaris2.11)
       mkdir -p testlocale
-      cp -a "$srcdir/testlocale/fr" "testlocale/$locale"
+      cp -R "$srcdir/testlocale/fr" "testlocale/$locale"
       localedir="testlocale"
       ;;
   esac



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-04  3:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01 17:24 quotearg tests: Avoid test failures on Solaris 11 Bruno Haible
2021-01-04  3:03 ` Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).