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