xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/xgettext-7 (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#!/bin/sh
2
3# Test of comment extraction in the case of duplicated msgids.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-test7.c"
9cat <<\EOF > xg-test7.c
10/* first comment */
11/* xgettext: c-format */
12gettext ("abc");
13
14/* first comment */
15/* xgettext: lisp-format */
16gettext ("abc");
17
18/* second comment */
19/* xgettext: python-format */
20gettext ("abc");
21EOF
22
23tmpfiles="$tmpfiles xg-test7.po"
24: ${XGETTEXT=xgettext}
25${XGETTEXT} --omit-header --add-comments -d xg-test7 xg-test7.c
26test $? = 0 || { rm -fr $tmpfiles; exit 1; }
27
28tmpfiles="$tmpfiles xg-test7.ok"
29cat <<\EOF > xg-test7.ok
30#. first comment
31#. second comment
32#: xg-test7.c:3 xg-test7.c:7 xg-test7.c:11
33#, c-format, python-format, lisp-format
34msgid "abc"
35msgstr ""
36EOF
37
38: ${DIFF=diff}
39${DIFF} xg-test7.ok xg-test7.po
40result=$?
41
42rm -fr $tmpfiles
43
44exit $result
45