From: Bruno Haible Date: Wed, 18 Aug 2004 11:09:15 +0000 (+0000) Subject: Fix test failures on MacOS X. X-Git-Tag: v0.14.2~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0dd732774dc6afe206851ee9a48ea4fa4495fe8;p=thirdparty%2Fgettext.git Fix test failures on MacOS X. --- diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index acbdb4875..f829cc74c 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,10 @@ +2004-08-13 Bruno Haible + + 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 * tstgettext.c (expand_escape): Don't go into an endless loop when the diff --git a/gettext-tools/tests/lang-clisp b/gettext-tools/tests/lang-clisp index b4700f2ff..57944daa8 100755 --- a/gettext-tools/tests/lang-clisp +++ b/gettext-tools/tests/lang-clisp @@ -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. diff --git a/gettext-tools/tests/lang-java b/gettext-tools/tests/lang-java index fd3b87f9c..a8cac3ff9 100755 --- a/gettext-tools/tests/lang-java +++ b/gettext-tools/tests/lang-java @@ -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."));