Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-c-6
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test C support: --add-comments option.
5
6 cat <<EOF > xg-c-6.in.C
7 /* This comment will not be extracted.  */
8 gettext ("help");
9
10 /*   XXX: But this one will.  */
11 gettext_noop ("me");
12
13 //XXX: ..and this
14 dcgettext ("foo", "quick", LC_MESSAGES);
15
16   /* not not not */
17 dgettext ("bar", "!");
18 EOF
19
20 : ${XGETTEXT=xgettext}
21 ${XGETTEXT} --omit-header --no-location --add-comments=XXX \
22   -d xg-c-6.tmp xg-c-6.in.C || exit 1
23 LC_ALL=C tr -d '\r' < xg-c-6.tmp.po > xg-c-6.po || exit 1
24
25 cat <<EOF > xg-c-6.ok
26 msgid "help"
27 msgstr ""
28
29 #. XXX: But this one will.
30 msgid "me"
31 msgstr ""
32
33 #. XXX: ..and this
34 msgid "quick"
35 msgstr ""
36
37 msgid "!"
38 msgstr ""
39 EOF
40
41 : ${DIFF=diff}
42 ${DIFF} xg-c-6.ok xg-c-6.po
43 result=$?
44
45 exit $result