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