Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-c-5
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test C support: comments.
5
6 cat <<EOF > xg-c-5.in.cc
7 main(){printf(gettext/*puke*/(/*barf*/"Hello, " "World!" "\n")); }
8 EOF
9
10 : ${XGETTEXT=xgettext}
11 ${XGETTEXT} --omit-header --no-location --add-comments -d xg-c-5.tmp xg-c-5.in.cc || exit 1
12 LC_ALL=C tr -d '\r' < xg-c-5.tmp.po > xg-c-5.po || exit 1
13
14 cat <<EOF > xg-c-5.ok
15 #. puke
16 #. barf
17 #, c-format
18 msgid "Hello, World!\n"
19 msgstr ""
20 EOF
21
22 : ${DIFF=diff}
23 ${DIFF} xg-c-5.ok xg-c-5.po
24 result=$?
25
26 exit $result