]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Avoid a test failure of lang-csharp on Mac OS X.
authorBruno Haible <bruno@clisp.org>
Sat, 6 Jan 2018 04:52:52 +0000 (05:52 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 6 Jan 2018 04:52:52 +0000 (05:52 +0100)
* gettext-tools/tests/lang-csharp: Don't test in $LOCALE_FR on Mac OS X.

gettext-tools/tests/lang-csharp

index eccfe54ca22b8249ac96cdb5c3d8da2007a78ac2..eac133268894b2d002e0730bb0e99e663af8168b 100755 (executable)
@@ -178,9 +178,21 @@ EOF
 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
 : ${CSHARPEXEC="/bin/sh ../../csharpexec.sh"}
 if test $LOCALE_FR != none; then
-  prepare_locale_ fr $LOCALE_FR
-  LANGUAGE= LC_ALL=$LOCALE_FR ${CSHARPEXEC} -L ../../../gettext-runtime/intl-csharp program.exe 2 > prog.out || Exit 1
-  ${DIFF} prog.ok prog.out || Exit 1
+  # On Mac OS X, with mono 4.2.3, this test would fail, because the Console's
+  # output encoding is System.Text.Encoding.Default, and this is UTF-8 even
+  # in the fr_FR.ISO8859-1 locale. System.Text.Encoding.Default is defined
+  # through InternalCodePage(), which uses g_get_charset(), which uses either
+  # locale_charset() or nl_langinfo(CODESET) [which is "ISO8859-1" in this case]
+  # or "UTF-8" - depending on platform or build configuration. So, skip this
+  # test on Mac OS X.
+  case "$host_os" in
+    darwin*) ;;
+    *)
+      prepare_locale_ fr $LOCALE_FR
+      LANGUAGE= LC_ALL=$LOCALE_FR ${CSHARPEXEC} -L ../../../gettext-runtime/intl-csharp program.exe 2 > prog.out || Exit 1
+      ${DIFF} prog.ok prog.out || Exit 1
+      ;;
+  esac
 fi
 if test $LOCALE_FR_UTF8 != none; then
   prepare_locale_ fr $LOCALE_FR_UTF8