1#! /bin/sh
2
3# Test C support: comments.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-c-5.in.cc"
9cat <<EOF > xg-c-5.in.cc
10main(){printf(gettext/*puke*/(/*barf*/"Hello, " "World!" "\n")); }
11EOF
12
13tmpfiles="$tmpfiles xg-c-5.po"
14: ${XGETTEXT=xgettext}
15${XGETTEXT} --omit-header --no-location --add-comments -d xg-c-5 xg-c-5.in.cc
16test $? = 0 || { rm -fr $tmpfiles; exit 1; }
17
18tmpfiles="$tmpfiles xg-c-5.ok"
19cat <<EOF > xg-c-5.ok
20#. puke
21#. barf
22#, c-format
23msgid "Hello, World!\n"
24msgstr ""
25EOF
26
27: ${DIFF=diff}
28${DIFF} xg-c-5.ok xg-c-5.po
29result=$?
30
31rm -fr $tmpfiles
32
33exit $result
34