2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test of --tcl option.
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.
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).
15 cat <<\EOF > mu-tcl-1-version.tcl
16 fconfigure stdout -encoding utf-8
19 (tclsh mu-tcl-1-version.tcl) >/dev/null 2>/dev/null \
20 || { echo "Skipping test: tclsh not found or Tcl too old"
24 cat <<\EOF > mu-tcl-1-fr.po
26 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
29 msgid "'Your command, please?', asked the waiter."
30 msgstr "«Votre commande, s'il vous plait», dit le garçon."
32 # Reverse the arguments.
35 msgid "%s is replaced by %s."
36 msgstr "%2$s remplace %1$s."
39 test -d mu-tcl-1-msgs || mkdir mu-tcl-1-msgs
42 ${MSGFMT} --tcl -d mu-tcl-1-msgs -l fr mu-tcl-1-fr.po || exit 1
44 : ${MSGUNFMT=msgunfmt}
45 GETTEXTDATADIR="$abs_top_srcdir"/src \
46 ${MSGUNFMT} --tcl -d mu-tcl-1-msgs -l fr -o mu-tcl-1-prog.out || exit 1
48 cat <<\EOF > mu-tcl-1-prog.ok
50 msgstr "Content-Type: text/plain; charset=UTF-8\n"
52 msgid "'Your command, please?', asked the waiter."
53 msgstr "«Votre commande, s'il vous plait», dit le garçon."
55 msgid "%s is replaced by %s."
56 msgstr "%2$s remplace %1$s."
59 ${DIFF} mu-tcl-1-prog.ok mu-tcl-1-prog.out || exit 1