Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-python-4
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test Python support: --add-comments option.
5
6 cat <<\EOF > xg-py-4.py
7 # a
8 string = # b
9 # c
10 _( # d
11 "hello " "world" # e
12 );
13 EOF
14
15 : ${XGETTEXT=xgettext}
16 ${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
17   -d xg-py-4.tmp xg-py-4.py || exit 1
18 LC_ALL=C tr -d '\r' < xg-py-4.tmp.po > xg-py-4.po || exit 1
19
20 cat <<EOF > xg-py-4.ok
21 #. a
22 #. b
23 #. c
24 #. d
25 msgid "hello world"
26 msgstr ""
27 EOF
28
29 : ${DIFF=diff}
30 ${DIFF} xg-py-4.ok xg-py-4.po
31 result=$?
32
33 exit $result