Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-9
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test of extracted comments specified per keyword, including the case of
5 # duplicated msgids.
6
7 cat <<\EOF > xg-test9.c
8 /* xgettext: max-width 25 */
9 label ("eagle");
10
11 /* xgettext: xml-format */
12 label ("seamew");
13
14 title ("falcon");
15
16 label ("falcon");
17
18 label ("pigeon");
19 label ("pigeon");
20 EOF
21
22 : ${XGETTEXT=xgettext}
23 ${XGETTEXT} --omit-header \
24   --keyword=label:1,\"xhtml-format\",\"xml-format\" \
25   --keyword=title:1,\"xhtml-format\",\"xml-format\" \
26   -d xg-test9.tmp xg-test9.c || exit 1
27 LC_ALL=C tr -d '\r' < xg-test9.tmp.po > xg-test9.po || exit 1
28
29 cat <<\EOF > xg-test9.ok
30 #. xhtml-format
31 #. xml-format
32 #: xg-test9.c:2
33 msgid "eagle"
34 msgstr ""
35
36 #. xhtml-format
37 #. xml-format
38 #: xg-test9.c:5
39 msgid "seamew"
40 msgstr ""
41
42 #. xhtml-format
43 #. xml-format
44 #: xg-test9.c:7 xg-test9.c:9
45 msgid "falcon"
46 msgstr ""
47
48 #. xhtml-format
49 #. xml-format
50 #: xg-test9.c:11 xg-test9.c:12
51 msgid "pigeon"
52 msgstr ""
53 EOF
54
55 : ${DIFF=diff}
56 ${DIFF} xg-test9.ok xg-test9.po
57 result=$?
58
59 exit $result