Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-c-16
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test C support: --add-comments option.
5
6 cat <<\EOF > xg-c-16.c
7 /* a */
8 /* b */ char *string = /* c */
9 /* d */
10 /* e */ _( /* f */ "hello " /* g */ "world" /* h */ );
11 EOF
12
13 : ${XGETTEXT=xgettext}
14 ${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
15   -d xg-c-16.tmp xg-c-16.c || exit 1
16 LC_ALL=C tr -d '\r' < xg-c-16.tmp.po > xg-c-16.po || exit 1
17
18 cat <<EOF > xg-c-16.ok
19 #. a
20 #. b
21 #. c
22 #. d
23 #. e
24 #. f
25 msgid "hello world"
26 msgstr ""
27 EOF
28
29 : ${DIFF=diff}
30 ${DIFF} xg-c-16.ok xg-c-16.po
31 result=$?
32
33 exit $result