1#! /bin/sh
2
3# Test C support: --add-comments option.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-c-6.in.C"
9cat <<EOF > xg-c-6.in.C
10/* This comment will not be extracted.  */
11gettext ("help");
12
13/*   XXX: But this one will.  */
14gettext_noop ("me");
15
16//XXX: ..and this
17dcgettext ("foo", "quick", LC_MESSAGES);
18
19  /* not not not */
20dgettext ("bar", "!");
21EOF
22
23tmpfiles="$tmpfiles xg-c-6.po"
24: ${XGETTEXT=xgettext}
25${XGETTEXT} --omit-header --no-location --add-comments=XXX \
26  -d xg-c-6 xg-c-6.in.C
27test $? = 0 || { rm -fr $tmpfiles; exit 1; }
28
29tmpfiles="$tmpfiles xg-c-6.ok"
30cat <<EOF > xg-c-6.ok
31msgid "help"
32msgstr ""
33
34#. XXX: But this one will.
35msgid "me"
36msgstr ""
37
38#. XXX: ..and this
39msgid "quick"
40msgstr ""
41
42msgid "!"
43msgstr ""
44EOF
45
46: ${DIFF=diff}
47${DIFF} xg-c-6.ok xg-c-6.po
48result=$?
49
50rm -fr $tmpfiles
51
52exit $result
53