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