1#!/bin/sh
2
3# Test YCP support: --add-comments option.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-y-4.ycp"
9cat <<\EOF > xg-y-4.ycp
10/* a */
11/* b */ string = /* c */
12/* d */
13/* e */ _( /* f */ "hello " /* g */ "world" /* h */ );
14EOF
15
16tmpfiles="$tmpfiles xg-y-4.tmp.po xg-y-4.po"
17: ${XGETTEXT=xgettext}
18${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
19  -d xg-y-4.tmp xg-y-4.ycp
20test $? = 0 || { rm -fr $tmpfiles; exit 1; }
21tr -d '\r' < xg-y-4.tmp.po > xg-y-4.po
22test $? = 0 || { rm -fr $tmpfiles; exit 1; }
23
24tmpfiles="$tmpfiles xg-y-4.ok"
25cat <<EOF > xg-y-4.ok
26#. a
27#. b
28#. c
29#. d
30#. e
31#. f
32msgid "hello world"
33msgstr ""
34EOF
35
36: ${DIFF=diff}
37${DIFF} xg-y-4.ok xg-y-4.po
38result=$?
39
40rm -fr $tmpfiles
41
42exit $result
43