1#!/bin/sh
2
3# Test of extracted comments specified per keyword, including the case of
4# duplicated msgids.
5
6tmpfiles=""
7trap 'rm -fr $tmpfiles' 1 2 3 15
8
9tmpfiles="$tmpfiles xg-test9.c"
10cat <<\EOF > xg-test9.c
11/* xgettext: max-width 25 */
12label ("eagle");
13
14/* xgettext: xml-format */
15label ("seamew");
16
17title ("falcon");
18
19label ("falcon");
20
21label ("pigeon");
22label ("pigeon");
23EOF
24
25tmpfiles="$tmpfiles xg-test9.po"
26: ${XGETTEXT=xgettext}
27${XGETTEXT} --omit-header \
28  --keyword=label:1,\"xhtml-format\",\"xml-format\" \
29  --keyword=title:1,\"xhtml-format\",\"xml-format\" \
30  -d xg-test9 xg-test9.c
31test $? = 0 || { rm -fr $tmpfiles; exit 1; }
32
33tmpfiles="$tmpfiles xg-test9.ok"
34cat <<\EOF > xg-test9.ok
35#. xhtml-format
36#. xml-format
37#: xg-test9.c:2
38msgid "eagle"
39msgstr ""
40
41#. xhtml-format
42#. xml-format
43#: xg-test9.c:5
44msgid "seamew"
45msgstr ""
46
47#. xhtml-format
48#. xml-format
49#: xg-test9.c:7 xg-test9.c:9
50msgid "falcon"
51msgstr ""
52
53#. xhtml-format
54#. xml-format
55#: xg-test9.c:11 xg-test9.c:12
56msgid "pigeon"
57msgstr ""
58EOF
59
60: ${DIFF=diff}
61${DIFF} xg-test9.ok xg-test9.po
62result=$?
63
64rm -fr $tmpfiles
65
66exit $result
67