1#! /bin/sh 2 3# Test of --java option. 4 5# Note: This test fails when using gcj from GCC 3.1 and GCC 3.2, due to a bug 6# (libgcj/6576). It is fixed in GCC 3.3. 7 8tmpfiles="" 9trap 'rm -fr $tmpfiles' 1 2 3 15 10 11# Test whether we can compile and execute Java programs. 12test "${JAVA_CHOICE}" != no || { 13 echo "Skipping test: configured with --disable-java" 14 exit 77 15} 16test "${BUILDJAVA}" = yes || { 17 echo "Skipping test: Java compiler or jar not found" 18 exit 77 19} 20test "${TESTJAVA}" = yes || { 21 echo "Skipping test: Java engine not found" 22 exit 77 23} 24 25tmpfiles="$tmpfiles fr.po" 26cat <<\EOF > fr.po 27msgid "" 28msgstr "" 29"Content-Type: text/plain; charset=ISO-8859-1\n" 30"Plural-Forms: nplurals=2; plural=(n > 1);\n" 31 32msgid "'Your command, please?', asked the waiter." 33msgstr "�Votre commande, s'il vous plait�, dit le gar�on." 34 35# Les gateaux allemands sont les meilleurs du monde. 36#, java-format 37msgid "a piece of cake" 38msgid_plural "{0,number} pieces of cake" 39msgstr[0] "un morceau de gateau" 40msgstr[1] "{0,number} morceaux de gateau" 41 42# Reverse the arguments. 43#, java-format 44msgid "{0} is replaced by {1}." 45msgstr "{1} remplace {0}." 46 47# A proximity measure. 48msgid "Close" 49msgstr "Proche" 50 51# A menu entry. 52msgctxt "File" 53msgid "Close" 54msgstr "Fermer" 55EOF 56 57tmpfiles="$tmpfiles prog_fr.class" 58: ${MSGFMT=msgfmt} 59${MSGFMT} -j -d . -r prog -l fr fr.po || exit 1 60 61tmpfiles="$tmpfiles prog.out" 62: ${MSGUNFMT=msgunfmt} 63CLASSPATH=.${CLASSPATH:+:$CLASSPATH} \ 64GETTEXTJEXEDIR=../src GETTEXTJAR=../src/gettext.jar \ 65${MSGUNFMT} --java -d . -r prog -l fr -o prog.out || exit 1 66 67tmpfiles="$tmpfiles prog.sort" 68: ${MSGCAT=msgcat} 69${MSGCAT} -s -o prog.sort prog.out || exit 1 70 71tmpfiles="$tmpfiles prog.ok" 72cat <<\EOF > prog.ok 73msgid "" 74msgstr "" 75"Content-Type: text/plain; charset=UTF-8\n" 76"Plural-Forms: nplurals=2; plural=(n > 1);\n" 77 78msgid "'Your command, please?', asked the waiter." 79msgstr "��Votre commande, s'il vous plait��, dit le gar��on." 80 81msgid "Close" 82msgstr "Proche" 83 84msgctxt "File" 85msgid "Close" 86msgstr "Fermer" 87 88msgid "a piece of cake" 89msgid_plural "{0,number} pieces of cake" 90msgstr[0] "un morceau de gateau" 91msgstr[1] "{0,number} morceaux de gateau" 92 93msgid "{0} is replaced by {1}." 94msgstr "{1} remplace {0}." 95EOF 96: ${DIFF=diff} 97${DIFF} prog.ok prog.sort || exit 1 98 99rm -fr $tmpfiles 100 101exit 0 102