]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix test failures on MacOS X.
authorBruno Haible <bruno@clisp.org>
Wed, 18 Aug 2004 11:09:15 +0000 (11:09 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:53 +0000 (12:11 +0200)
gettext-tools/tests/ChangeLog
gettext-tools/tests/lang-clisp
gettext-tools/tests/lang-java

index acbdb48757a648737b5283603a17e718b646fdc4..f829cc74ca3f431360a50a881d2686ffcb20611e 100644 (file)
@@ -1,3 +1,10 @@
+2004-08-13  Bruno Haible  <bruno@clisp.org>
+
+       Fix test failures on MacOS X.
+       * lang-clisp: Skip the test if clisp was not built with gettext
+       support.
+       * lang-java: Enforce encoding ISO-8859-1 for System.out.
+
 2004-07-10  Bruno Haible  <bruno@clisp.org>
 
        * tstgettext.c (expand_escape): Don't go into an endless loop when the
index b4700f2ff7dc5f23fe90ade939efa6fee8f6c7e7..57944daa889e764f7fd04bf64b6c58a546c44fe5 100755 (executable)
@@ -81,7 +81,7 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
 : ${MSGFMT=msgfmt}
 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
 
-# Test for presence of clisp version 2.28 or newer.
+# Test for presence of clisp version 2.28 or newer with gettext support.
 # Use clisp for the comparison of the version numbers; neither 'expr' nor 'bc'
 # can deal with floating-point numbers.
 (clisp --version) >/dev/null 2>/dev/null \
@@ -92,7 +92,8 @@ case $version in
     rm -fr $tmpfiles; exit 77;;
 esac
 version=`echo $version | sed -e 's/^\([0-9]*\.[0-9]*\).*/\1/'`
-clisp -norc -x "(sys::exit (not (>= $version 2.28)))" >/dev/null \
+clisp -norc -x "(sys::exit #+GETTEXT (not (>= $version 2.28)) #-GETTEXT t)" \
+      >/dev/null \
   || { rm -fr $tmpfiles; exit 77; }
 
 # Test whether the fr_FR locale is installed.
index fd3b87f9cc7b38a615831ae782311f038e160650..a8cac3ff96cf15b7da4d35e8dd64d842998d5cca 100755 (executable)
@@ -16,6 +16,7 @@ test "${TESTJAVA}" = yes || exit 77
 tmpfiles="$tmpfiles Program.java"
 cat <<\EOF > Program.java
 import java.util.*;
+import java.io.*;
 import java.text.*;
 import gnu.gettext.*;
 
@@ -24,6 +25,13 @@ public class Program {
     // Some systems (like Solaris) don't set Locale.getDefault()
     // as specified by LC_ALL. So set it by hand.
     Locale.setDefault(new Locale("fr","FR"));
+    // Some systems (like MacOS X) don't set System.out's character encoding
+    // to ISO-8859-1, which is what we need for comparison purposes.
+    try {
+      System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out),
+                                    true, "ISO-8859-1"));
+    } catch (UnsupportedEncodingException e) {
+    }
     int n = Integer.parseInt(args[0]);
     ResourceBundle catalog = ResourceBundle.getBundle("prog");
     System.out.println(GettextResource.gettext(catalog,"'Your command, please?', asked the waiter."));