Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-elisp-1
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test EmacsLisp support: --add-comments option.
5
6 cat <<EOF > xg-el-1.el
7 ; This comment will not be extracted.
8 (princ (_ "help"))
9 ;;  TRANSLATORS: This is an extracted comment.
10 (princ (_ "me"))
11 ; Not extracted either.
12 (princ (_ "Hey Jude"))
13 ;  TRANSLATORS:
14 ;     Nickname of the Beatles
15 (princ (_ "The Fabulous Four"))
16 EOF
17
18 : ${XGETTEXT=xgettext}
19 ${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
20   -d xg-el-1.tmp xg-el-1.el || exit 1
21 LC_ALL=C tr -d '\r' < xg-el-1.tmp.po > xg-el-1.po || exit 1
22
23 cat <<EOF > xg-el-1.ok
24 msgid "help"
25 msgstr ""
26
27 #. TRANSLATORS: This is an extracted comment.
28 msgid "me"
29 msgstr ""
30
31 msgid "Hey Jude"
32 msgstr ""
33
34 #. TRANSLATORS:
35 #. Nickname of the Beatles
36 msgid "The Fabulous Four"
37 msgstr ""
38 EOF
39
40 : ${DIFF=diff}
41 ${DIFF} xg-el-1.ok xg-el-1.po
42 result=$?
43
44 exit $result