summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-11
blob: 2378ceac4aa2ae6b5b62b4e07c8724fe77403759 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test of multi-line comment extraction.

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}
${DIFF} xg-test11.ok xg-test11.po
result=$?

exit $result