#!/bin/sh

# Test of multi-line comment extraction.

tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15

tmpfiles="$tmpfiles xg-test11.c xg-test11.ok xg-test11.tmp.po xg-test11.po xg-test11.out xg-test11.err"

cat <<\EOF > xg-test11.c
/* TRANSLATORS: this
 is the first msgid
 */
gettext ("abc");

/*
 * TRANSLATORS: this
 * is the second msgid
 */
gettext ("def");
EOF

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

cat <<\EOF > xg-test11.ok
#. TRANSLATORS: this
#. is the first msgid
#.
msgid "abc"
msgstr ""

#. TRANSLATORS: this
#. is the second msgid
#.
msgid "def"
msgstr ""
EOF

: ${DIFF=diff -b}
${DIFF} xg-test11.ok xg-test11.po
result=$?

rm -fr $tmpfiles

exit $result
