1#! /bin/sh 2. "${srcdir=.}/init.sh"; path_prepend_ . ../src 3 4# Test of --tcl option. 5 6# This test fails on mingw, in the Cygwin environment: tclsh exists as 7# tclsh.exe from Cygwin. When msgunfmt invokes it, it crashes, presenting 8# a dialog "16 bit MS-DOS subsystem - The NTVDM CPU has encountered an 9# illegal instruction." When this dialog is closed, msgunfmt continues, 10# reads empty output, and refrains from creating a PO file because 11# --force-po was not specified. 12 13# Test whether we can execute Tcl programs and Tcl's fconfigure command 14# understands the -encoding option (it does since approximately Tcl 8.1). 15cat <<\EOF > mu-tcl-1-version.tcl 16fconfigure stdout -encoding utf-8 17puts $tcl_version 18EOF 19(tclsh mu-tcl-1-version.tcl) >/dev/null 2>/dev/null \ 20 || { echo "Skipping test: tclsh not found or Tcl too old" 21 Exit 77 22 } 23 24cat <<\EOF > mu-tcl-1-fr.po 25msgid "" 26msgstr "Content-Type: text/plain; charset=ISO-8859-1\n" 27 28#: program.tcl:5 29msgid "'Your command, please?', asked the waiter." 30msgstr "�Votre commande, s'il vous plait�, dit le gar�on." 31 32# Reverse the arguments. 33#: program.tcl:6 34#, tcl-format 35msgid "%s is replaced by %s." 36msgstr "%2$s remplace %1$s." 37EOF 38 39test -d mu-tcl-1-msgs || mkdir mu-tcl-1-msgs 40 41: ${MSGFMT=msgfmt} 42${MSGFMT} --tcl -d mu-tcl-1-msgs -l fr mu-tcl-1-fr.po || Exit 1 43 44: ${MSGUNFMT=msgunfmt} 45GETTEXTTCLDIR="$wabs_top_srcdir"/src \ 46${MSGUNFMT} --tcl -d mu-tcl-1-msgs -l fr -o mu-tcl-1-prog.out || Exit 1 47 48cat <<\EOF > mu-tcl-1-prog.ok 49msgid "" 50msgstr "Content-Type: text/plain; charset=UTF-8\n" 51 52msgid "'Your command, please?', asked the waiter." 53msgstr "«Votre commande, s'il vous plait», dit le garçon." 54 55msgid "%s is replaced by %s." 56msgstr "%2$s remplace %1$s." 57EOF 58: ${DIFF=diff} 59${DIFF} mu-tcl-1-prog.ok mu-tcl-1-prog.out || Exit 1 60 61Exit 0 62