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