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