2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test msgexec on a PO file with contexts.
6 # This test fails on mingw (in a Cygwin environment), due to the combination
8 # 1. The value of the environment variable MSGEXEC_MSGCTXT is stored
9 # in UTF-8 encoding (i.e. the PO file's encoding); it should be stored
10 # in the GetACP() encoding instead. This problem is inherent in msgexec,
11 # and msgexec warns about it - but in this test, we filter the warnings
13 # 2. The child process is Cygwin's sh.exe, and is affected by a Cygwin bug:
14 # the values returned by getenv() in the child process, when the parent
15 # process is a mingw program, are in the GetOEMCP() encoding (should be
16 # in the GetACP() encoding). This has been reported at
17 # <http://cygwin.com/ml/cygwin/2009-08/msg00430.html>.
19 cat <<\EOF > mex-test4.po
22 "Content-Type: text/plain; charset=UTF-8\n"
23 "Content-Transfer-Encoding: 8bit\n"
35 #. Denote a lock's state
40 #. Denote a lock's state
56 #~ msgstr "Enregistrer l'as"
61 #~ msgstr "Enregistrer sous"
64 cat <<\EOF > mex-test4.sh
66 echo "========================= $MSGEXEC_LOCATION =========================" | LC_ALL=C tr -d '\r'
67 if test -n "${MSGEXEC_MSGCTXT+set}"; then
68 echo "context: $MSGEXEC_MSGCTXT" | LC_ALL=C tr -d '\r'
75 echo | LC_ALL=C tr -d '\r'
78 chmod a+x mex-test4.sh
82 ${MSGEXEC} -i mex-test4.po ./mex-test4.sh > mex-test4.out 2> mex-test4.err
84 cat mex-test4.err | grep -v 'warning: Locale charset' | grep -v '^ '
85 test $result = 0 || { exit 1; }
87 cat <<\EOF > mex-test4.ok
88 ========================= mex-test4.po:2 =========================
91 Content-Type: text/plain; charset=UTF-8
92 Content-Transfer-Encoding: 8bit
94 ========================= mex-test4.po:9 =========================
99 ========================= mex-test4.po:14 =========================
104 ========================= mex-test4.po:19 =========================
109 ========================= mex-test4.po:24 =========================
114 ========================= mex-test4.po:29 =========================
119 ========================= mex-test4.po:34 =========================
124 ========================= mex-test4.po:37 =========================
128 ========================= mex-test4.po:42 =========================
136 ${DIFF} mex-test4.ok mex-test4.out