Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-11
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test of multi-line comment extraction.
5
6 cat <<\EOF > xg-test11.c
7 /* TRANSLATORS: this
8  is the first msgid
9  */
10 gettext ("abc");
11
12 /*
13  * TRANSLATORS: this
14  * is the second msgid
15  */
16 gettext ("def");
17 EOF
18
19 : ${XGETTEXT=xgettext}
20 ${XGETTEXT} --no-location --omit-header --add-comments=TRANSLATORS: -d xg-test11.tmp xg-test11.c || exit 1
21 LC_ALL=C tr -d '\r' < xg-test11.tmp.po > xg-test11.po || exit 1
22
23 cat <<\EOF > xg-test11.ok
24 #. TRANSLATORS: this
25 #. is the first msgid
26 #.
27 msgid "abc"
28 msgstr ""
29
30 #. TRANSLATORS: this
31 #. is the second msgid
32 #.
33 msgid "def"
34 msgstr ""
35 EOF
36
37 : ${DIFF=diff}
38 ${DIFF} xg-test11.ok xg-test11.po
39 result=$?
40
41 exit $result