summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-c-5
blob: ffe142a8bec9575de6ea1317f95c8d2cdce2eeda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test C support: comments.

cat <<EOF > xg-c-5.in.cc
main(){printf(gettext/*puke*/(/*barf*/"Hello, " "World!" "\n")); }
EOF

: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments -d xg-c-5.tmp xg-c-5.in.cc || Exit 1
LC_ALL=C tr -d '\r' < xg-c-5.tmp.po > xg-c-5.po || Exit 1

cat <<EOF > xg-c-5.ok
#. puke
#. barf
#, c-format
msgid "Hello, World!\n"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-c-5.ok xg-c-5.po
result=$?

exit $result