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