summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-c-5
blob: 14c90feb2799f082aa87f94ed950b8304f32c808 (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